Release PedestrianDetectAttribute.
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
2020-10-13 Version: patch
|
||||||
|
- Release PedestrianDetectAttribute.
|
||||||
|
|
||||||
2020-10-13 Version: patch
|
2020-10-13 Version: patch
|
||||||
- Release GenerateDynamicImage.
|
- Release GenerateDynamicImage.
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ set(facebody_public_header_model
|
|||||||
include/alibabacloud/facebody/model/DetectFaceResult.h
|
include/alibabacloud/facebody/model/DetectFaceResult.h
|
||||||
include/alibabacloud/facebody/model/DetectIPCPedestrianRequest.h
|
include/alibabacloud/facebody/model/DetectIPCPedestrianRequest.h
|
||||||
include/alibabacloud/facebody/model/DetectIPCPedestrianResult.h
|
include/alibabacloud/facebody/model/DetectIPCPedestrianResult.h
|
||||||
include/alibabacloud/facebody/model/DetectIPCPedestrianOptimizedRequest.h
|
|
||||||
include/alibabacloud/facebody/model/DetectIPCPedestrianOptimizedResult.h
|
|
||||||
include/alibabacloud/facebody/model/DetectLivingFaceRequest.h
|
include/alibabacloud/facebody/model/DetectLivingFaceRequest.h
|
||||||
include/alibabacloud/facebody/model/DetectLivingFaceResult.h
|
include/alibabacloud/facebody/model/DetectLivingFaceResult.h
|
||||||
include/alibabacloud/facebody/model/DetectMaskRequest.h
|
include/alibabacloud/facebody/model/DetectMaskRequest.h
|
||||||
@@ -81,6 +79,8 @@ set(facebody_public_header_model
|
|||||||
include/alibabacloud/facebody/model/ListFaceDbsResult.h
|
include/alibabacloud/facebody/model/ListFaceDbsResult.h
|
||||||
include/alibabacloud/facebody/model/ListFaceEntitiesRequest.h
|
include/alibabacloud/facebody/model/ListFaceEntitiesRequest.h
|
||||||
include/alibabacloud/facebody/model/ListFaceEntitiesResult.h
|
include/alibabacloud/facebody/model/ListFaceEntitiesResult.h
|
||||||
|
include/alibabacloud/facebody/model/PedestrianDetectAttributeRequest.h
|
||||||
|
include/alibabacloud/facebody/model/PedestrianDetectAttributeResult.h
|
||||||
include/alibabacloud/facebody/model/RecognizeActionRequest.h
|
include/alibabacloud/facebody/model/RecognizeActionRequest.h
|
||||||
include/alibabacloud/facebody/model/RecognizeActionResult.h
|
include/alibabacloud/facebody/model/RecognizeActionResult.h
|
||||||
include/alibabacloud/facebody/model/RecognizeExpressionRequest.h
|
include/alibabacloud/facebody/model/RecognizeExpressionRequest.h
|
||||||
@@ -128,8 +128,6 @@ set(facebody_src
|
|||||||
src/model/DetectFaceResult.cc
|
src/model/DetectFaceResult.cc
|
||||||
src/model/DetectIPCPedestrianRequest.cc
|
src/model/DetectIPCPedestrianRequest.cc
|
||||||
src/model/DetectIPCPedestrianResult.cc
|
src/model/DetectIPCPedestrianResult.cc
|
||||||
src/model/DetectIPCPedestrianOptimizedRequest.cc
|
|
||||||
src/model/DetectIPCPedestrianOptimizedResult.cc
|
|
||||||
src/model/DetectLivingFaceRequest.cc
|
src/model/DetectLivingFaceRequest.cc
|
||||||
src/model/DetectLivingFaceResult.cc
|
src/model/DetectLivingFaceResult.cc
|
||||||
src/model/DetectMaskRequest.cc
|
src/model/DetectMaskRequest.cc
|
||||||
@@ -160,6 +158,8 @@ set(facebody_src
|
|||||||
src/model/ListFaceDbsResult.cc
|
src/model/ListFaceDbsResult.cc
|
||||||
src/model/ListFaceEntitiesRequest.cc
|
src/model/ListFaceEntitiesRequest.cc
|
||||||
src/model/ListFaceEntitiesResult.cc
|
src/model/ListFaceEntitiesResult.cc
|
||||||
|
src/model/PedestrianDetectAttributeRequest.cc
|
||||||
|
src/model/PedestrianDetectAttributeResult.cc
|
||||||
src/model/RecognizeActionRequest.cc
|
src/model/RecognizeActionRequest.cc
|
||||||
src/model/RecognizeActionResult.cc
|
src/model/RecognizeActionResult.cc
|
||||||
src/model/RecognizeExpressionRequest.cc
|
src/model/RecognizeExpressionRequest.cc
|
||||||
|
|||||||
@@ -50,8 +50,6 @@
|
|||||||
#include "model/DetectFaceResult.h"
|
#include "model/DetectFaceResult.h"
|
||||||
#include "model/DetectIPCPedestrianRequest.h"
|
#include "model/DetectIPCPedestrianRequest.h"
|
||||||
#include "model/DetectIPCPedestrianResult.h"
|
#include "model/DetectIPCPedestrianResult.h"
|
||||||
#include "model/DetectIPCPedestrianOptimizedRequest.h"
|
|
||||||
#include "model/DetectIPCPedestrianOptimizedResult.h"
|
|
||||||
#include "model/DetectLivingFaceRequest.h"
|
#include "model/DetectLivingFaceRequest.h"
|
||||||
#include "model/DetectLivingFaceResult.h"
|
#include "model/DetectLivingFaceResult.h"
|
||||||
#include "model/DetectMaskRequest.h"
|
#include "model/DetectMaskRequest.h"
|
||||||
@@ -82,6 +80,8 @@
|
|||||||
#include "model/ListFaceDbsResult.h"
|
#include "model/ListFaceDbsResult.h"
|
||||||
#include "model/ListFaceEntitiesRequest.h"
|
#include "model/ListFaceEntitiesRequest.h"
|
||||||
#include "model/ListFaceEntitiesResult.h"
|
#include "model/ListFaceEntitiesResult.h"
|
||||||
|
#include "model/PedestrianDetectAttributeRequest.h"
|
||||||
|
#include "model/PedestrianDetectAttributeResult.h"
|
||||||
#include "model/RecognizeActionRequest.h"
|
#include "model/RecognizeActionRequest.h"
|
||||||
#include "model/RecognizeActionResult.h"
|
#include "model/RecognizeActionResult.h"
|
||||||
#include "model/RecognizeExpressionRequest.h"
|
#include "model/RecognizeExpressionRequest.h"
|
||||||
@@ -149,9 +149,6 @@ namespace AlibabaCloud
|
|||||||
typedef Outcome<Error, Model::DetectIPCPedestrianResult> DetectIPCPedestrianOutcome;
|
typedef Outcome<Error, Model::DetectIPCPedestrianResult> DetectIPCPedestrianOutcome;
|
||||||
typedef std::future<DetectIPCPedestrianOutcome> DetectIPCPedestrianOutcomeCallable;
|
typedef std::future<DetectIPCPedestrianOutcome> DetectIPCPedestrianOutcomeCallable;
|
||||||
typedef std::function<void(const FacebodyClient*, const Model::DetectIPCPedestrianRequest&, const DetectIPCPedestrianOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectIPCPedestrianAsyncHandler;
|
typedef std::function<void(const FacebodyClient*, const Model::DetectIPCPedestrianRequest&, const DetectIPCPedestrianOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectIPCPedestrianAsyncHandler;
|
||||||
typedef Outcome<Error, Model::DetectIPCPedestrianOptimizedResult> DetectIPCPedestrianOptimizedOutcome;
|
|
||||||
typedef std::future<DetectIPCPedestrianOptimizedOutcome> DetectIPCPedestrianOptimizedOutcomeCallable;
|
|
||||||
typedef std::function<void(const FacebodyClient*, const Model::DetectIPCPedestrianOptimizedRequest&, const DetectIPCPedestrianOptimizedOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectIPCPedestrianOptimizedAsyncHandler;
|
|
||||||
typedef Outcome<Error, Model::DetectLivingFaceResult> DetectLivingFaceOutcome;
|
typedef Outcome<Error, Model::DetectLivingFaceResult> DetectLivingFaceOutcome;
|
||||||
typedef std::future<DetectLivingFaceOutcome> DetectLivingFaceOutcomeCallable;
|
typedef std::future<DetectLivingFaceOutcome> DetectLivingFaceOutcomeCallable;
|
||||||
typedef std::function<void(const FacebodyClient*, const Model::DetectLivingFaceRequest&, const DetectLivingFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectLivingFaceAsyncHandler;
|
typedef std::function<void(const FacebodyClient*, const Model::DetectLivingFaceRequest&, const DetectLivingFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectLivingFaceAsyncHandler;
|
||||||
@@ -197,6 +194,9 @@ namespace AlibabaCloud
|
|||||||
typedef Outcome<Error, Model::ListFaceEntitiesResult> ListFaceEntitiesOutcome;
|
typedef Outcome<Error, Model::ListFaceEntitiesResult> ListFaceEntitiesOutcome;
|
||||||
typedef std::future<ListFaceEntitiesOutcome> ListFaceEntitiesOutcomeCallable;
|
typedef std::future<ListFaceEntitiesOutcome> ListFaceEntitiesOutcomeCallable;
|
||||||
typedef std::function<void(const FacebodyClient*, const Model::ListFaceEntitiesRequest&, const ListFaceEntitiesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListFaceEntitiesAsyncHandler;
|
typedef std::function<void(const FacebodyClient*, const Model::ListFaceEntitiesRequest&, const ListFaceEntitiesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListFaceEntitiesAsyncHandler;
|
||||||
|
typedef Outcome<Error, Model::PedestrianDetectAttributeResult> PedestrianDetectAttributeOutcome;
|
||||||
|
typedef std::future<PedestrianDetectAttributeOutcome> PedestrianDetectAttributeOutcomeCallable;
|
||||||
|
typedef std::function<void(const FacebodyClient*, const Model::PedestrianDetectAttributeRequest&, const PedestrianDetectAttributeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PedestrianDetectAttributeAsyncHandler;
|
||||||
typedef Outcome<Error, Model::RecognizeActionResult> RecognizeActionOutcome;
|
typedef Outcome<Error, Model::RecognizeActionResult> RecognizeActionOutcome;
|
||||||
typedef std::future<RecognizeActionOutcome> RecognizeActionOutcomeCallable;
|
typedef std::future<RecognizeActionOutcome> RecognizeActionOutcomeCallable;
|
||||||
typedef std::function<void(const FacebodyClient*, const Model::RecognizeActionRequest&, const RecognizeActionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeActionAsyncHandler;
|
typedef std::function<void(const FacebodyClient*, const Model::RecognizeActionRequest&, const RecognizeActionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeActionAsyncHandler;
|
||||||
@@ -268,9 +268,6 @@ namespace AlibabaCloud
|
|||||||
DetectIPCPedestrianOutcome detectIPCPedestrian(const Model::DetectIPCPedestrianRequest &request)const;
|
DetectIPCPedestrianOutcome detectIPCPedestrian(const Model::DetectIPCPedestrianRequest &request)const;
|
||||||
void detectIPCPedestrianAsync(const Model::DetectIPCPedestrianRequest& request, const DetectIPCPedestrianAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
void detectIPCPedestrianAsync(const Model::DetectIPCPedestrianRequest& request, const DetectIPCPedestrianAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
DetectIPCPedestrianOutcomeCallable detectIPCPedestrianCallable(const Model::DetectIPCPedestrianRequest& request) const;
|
DetectIPCPedestrianOutcomeCallable detectIPCPedestrianCallable(const Model::DetectIPCPedestrianRequest& request) const;
|
||||||
DetectIPCPedestrianOptimizedOutcome detectIPCPedestrianOptimized(const Model::DetectIPCPedestrianOptimizedRequest &request)const;
|
|
||||||
void detectIPCPedestrianOptimizedAsync(const Model::DetectIPCPedestrianOptimizedRequest& request, const DetectIPCPedestrianOptimizedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
|
||||||
DetectIPCPedestrianOptimizedOutcomeCallable detectIPCPedestrianOptimizedCallable(const Model::DetectIPCPedestrianOptimizedRequest& request) const;
|
|
||||||
DetectLivingFaceOutcome detectLivingFace(const Model::DetectLivingFaceRequest &request)const;
|
DetectLivingFaceOutcome detectLivingFace(const Model::DetectLivingFaceRequest &request)const;
|
||||||
void detectLivingFaceAsync(const Model::DetectLivingFaceRequest& request, const DetectLivingFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
void detectLivingFaceAsync(const Model::DetectLivingFaceRequest& request, const DetectLivingFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
DetectLivingFaceOutcomeCallable detectLivingFaceCallable(const Model::DetectLivingFaceRequest& request) const;
|
DetectLivingFaceOutcomeCallable detectLivingFaceCallable(const Model::DetectLivingFaceRequest& request) const;
|
||||||
@@ -316,6 +313,9 @@ namespace AlibabaCloud
|
|||||||
ListFaceEntitiesOutcome listFaceEntities(const Model::ListFaceEntitiesRequest &request)const;
|
ListFaceEntitiesOutcome listFaceEntities(const Model::ListFaceEntitiesRequest &request)const;
|
||||||
void listFaceEntitiesAsync(const Model::ListFaceEntitiesRequest& request, const ListFaceEntitiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
void listFaceEntitiesAsync(const Model::ListFaceEntitiesRequest& request, const ListFaceEntitiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
ListFaceEntitiesOutcomeCallable listFaceEntitiesCallable(const Model::ListFaceEntitiesRequest& request) const;
|
ListFaceEntitiesOutcomeCallable listFaceEntitiesCallable(const Model::ListFaceEntitiesRequest& request) const;
|
||||||
|
PedestrianDetectAttributeOutcome pedestrianDetectAttribute(const Model::PedestrianDetectAttributeRequest &request)const;
|
||||||
|
void pedestrianDetectAttributeAsync(const Model::PedestrianDetectAttributeRequest& request, const PedestrianDetectAttributeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
|
PedestrianDetectAttributeOutcomeCallable pedestrianDetectAttributeCallable(const Model::PedestrianDetectAttributeRequest& request) const;
|
||||||
RecognizeActionOutcome recognizeAction(const Model::RecognizeActionRequest &request)const;
|
RecognizeActionOutcome recognizeAction(const Model::RecognizeActionRequest &request)const;
|
||||||
void recognizeActionAsync(const Model::RecognizeActionRequest& request, const RecognizeActionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
void recognizeActionAsync(const Model::RecognizeActionRequest& request, const RecognizeActionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||||
RecognizeActionOutcomeCallable recognizeActionCallable(const Model::RecognizeActionRequest& request) const;
|
RecognizeActionOutcomeCallable recognizeActionCallable(const Model::RecognizeActionRequest& request) const;
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANOPTIMIZEDRESULT_H_
|
|
||||||
#define ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANOPTIMIZEDRESULT_H_
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <utility>
|
|
||||||
#include <alibabacloud/core/ServiceResult.h>
|
|
||||||
#include <alibabacloud/facebody/FacebodyExport.h>
|
|
||||||
|
|
||||||
namespace AlibabaCloud
|
|
||||||
{
|
|
||||||
namespace Facebody
|
|
||||||
{
|
|
||||||
namespace Model
|
|
||||||
{
|
|
||||||
class ALIBABACLOUD_FACEBODY_EXPORT DetectIPCPedestrianOptimizedResult : public ServiceResult
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
struct Data
|
|
||||||
{
|
|
||||||
struct ImageInfoListItem
|
|
||||||
{
|
|
||||||
struct Element
|
|
||||||
{
|
|
||||||
float score;
|
|
||||||
std::vector<std::string> boxes;
|
|
||||||
};
|
|
||||||
std::vector<ImageInfoListItem::Element> elements;
|
|
||||||
};
|
|
||||||
std::vector<ImageInfoListItem> imageInfoList;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedResult();
|
|
||||||
explicit DetectIPCPedestrianOptimizedResult(const std::string &payload);
|
|
||||||
~DetectIPCPedestrianOptimizedResult();
|
|
||||||
Data getData()const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void parse(const std::string &payload);
|
|
||||||
private:
|
|
||||||
Data data_;
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANOPTIMIZEDRESULT_H_
|
|
||||||
@@ -35,10 +35,13 @@ namespace AlibabaCloud
|
|||||||
ExtractPedestrianFeatureAttributeRequest();
|
ExtractPedestrianFeatureAttributeRequest();
|
||||||
~ExtractPedestrianFeatureAttributeRequest();
|
~ExtractPedestrianFeatureAttributeRequest();
|
||||||
|
|
||||||
|
std::string getMode()const;
|
||||||
|
void setMode(const std::string& mode);
|
||||||
std::string getImageURL()const;
|
std::string getImageURL()const;
|
||||||
void setImageURL(const std::string& imageURL);
|
void setImageURL(const std::string& imageURL);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string mode_;
|
||||||
std::string imageURL_;
|
std::string imageURL_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANOPTIMIZEDREQUEST_H_
|
#ifndef ALIBABACLOUD_FACEBODY_MODEL_PEDESTRIANDETECTATTRIBUTEREQUEST_H_
|
||||||
#define ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANOPTIMIZEDREQUEST_H_
|
#define ALIBABACLOUD_FACEBODY_MODEL_PEDESTRIANDETECTATTRIBUTEREQUEST_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||||
#include <alibabacloud/facebody/FacebodyExport.h>
|
#include <alibabacloud/facebody/FacebodyExport.h>
|
||||||
|
|
||||||
namespace AlibabaCloud
|
namespace AlibabaCloud
|
||||||
@@ -28,27 +28,21 @@ namespace AlibabaCloud
|
|||||||
{
|
{
|
||||||
namespace Model
|
namespace Model
|
||||||
{
|
{
|
||||||
class ALIBABACLOUD_FACEBODY_EXPORT DetectIPCPedestrianOptimizedRequest : public RoaServiceRequest
|
class ALIBABACLOUD_FACEBODY_EXPORT PedestrianDetectAttributeRequest : public RpcServiceRequest
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DetectIPCPedestrianOptimizedRequest();
|
PedestrianDetectAttributeRequest();
|
||||||
~DetectIPCPedestrianOptimizedRequest();
|
~PedestrianDetectAttributeRequest();
|
||||||
|
|
||||||
std::string getImageData()const;
|
std::string getImageURL()const;
|
||||||
void setImageData(const std::string& imageData);
|
void setImageURL(const std::string& imageURL);
|
||||||
long getWidth()const;
|
|
||||||
void setWidth(long width);
|
|
||||||
long getHeight()const;
|
|
||||||
void setHeight(long height);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string imageData_;
|
std::string imageURL_;
|
||||||
long width_;
|
|
||||||
long height_;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANOPTIMIZEDREQUEST_H_
|
#endif // !ALIBABACLOUD_FACEBODY_MODEL_PEDESTRIANDETECTATTRIBUTEREQUEST_H_
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ALIBABACLOUD_FACEBODY_MODEL_PEDESTRIANDETECTATTRIBUTERESULT_H_
|
||||||
|
#define ALIBABACLOUD_FACEBODY_MODEL_PEDESTRIANDETECTATTRIBUTERESULT_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <alibabacloud/core/ServiceResult.h>
|
||||||
|
#include <alibabacloud/facebody/FacebodyExport.h>
|
||||||
|
|
||||||
|
namespace AlibabaCloud
|
||||||
|
{
|
||||||
|
namespace Facebody
|
||||||
|
{
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
class ALIBABACLOUD_FACEBODY_EXPORT PedestrianDetectAttributeResult : public ServiceResult
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
struct AttributesItem
|
||||||
|
{
|
||||||
|
struct Age
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct Backpack
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct Gender
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct Glasses
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct Handbag
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct Hat
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct LowerColor
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct LowerWear
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct Orient
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct ShoulderBag
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct UpperColor
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
struct UpperWear
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
Backpack backpack;
|
||||||
|
LowerWear lowerWear;
|
||||||
|
Orient orient;
|
||||||
|
ShoulderBag shoulderBag;
|
||||||
|
LowerColor lowerColor;
|
||||||
|
Glasses glasses;
|
||||||
|
UpperColor upperColor;
|
||||||
|
Handbag handbag;
|
||||||
|
Hat hat;
|
||||||
|
Gender gender;
|
||||||
|
Age age;
|
||||||
|
UpperWear upperWear;
|
||||||
|
};
|
||||||
|
struct BoxesItem
|
||||||
|
{
|
||||||
|
float score;
|
||||||
|
float bottomRightY;
|
||||||
|
float bottomRightX;
|
||||||
|
float topLeftY;
|
||||||
|
float topLeftX;
|
||||||
|
};
|
||||||
|
int personNumber;
|
||||||
|
std::vector<AttributesItem> attributes;
|
||||||
|
std::vector<BoxesItem> boxes;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
PedestrianDetectAttributeResult();
|
||||||
|
explicit PedestrianDetectAttributeResult(const std::string &payload);
|
||||||
|
~PedestrianDetectAttributeResult();
|
||||||
|
Data getData()const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void parse(const std::string &payload);
|
||||||
|
private:
|
||||||
|
Data data_;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // !ALIBABACLOUD_FACEBODY_MODEL_PEDESTRIANDETECTATTRIBUTERESULT_H_
|
||||||
@@ -31,21 +31,21 @@ FacebodyClient::FacebodyClient(const Credentials &credentials, const ClientConfi
|
|||||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||||
{
|
{
|
||||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "facebody");
|
||||||
}
|
}
|
||||||
|
|
||||||
FacebodyClient::FacebodyClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
FacebodyClient::FacebodyClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||||
{
|
{
|
||||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "facebody");
|
||||||
}
|
}
|
||||||
|
|
||||||
FacebodyClient::FacebodyClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
FacebodyClient::FacebodyClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||||
{
|
{
|
||||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "facebody");
|
||||||
}
|
}
|
||||||
|
|
||||||
FacebodyClient::~FacebodyClient()
|
FacebodyClient::~FacebodyClient()
|
||||||
@@ -555,42 +555,6 @@ FacebodyClient::DetectIPCPedestrianOutcomeCallable FacebodyClient::detectIPCPede
|
|||||||
return task->get_future();
|
return task->get_future();
|
||||||
}
|
}
|
||||||
|
|
||||||
FacebodyClient::DetectIPCPedestrianOptimizedOutcome FacebodyClient::detectIPCPedestrianOptimized(const DetectIPCPedestrianOptimizedRequest &request) const
|
|
||||||
{
|
|
||||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
|
||||||
if (!endpointOutcome.isSuccess())
|
|
||||||
return DetectIPCPedestrianOptimizedOutcome(endpointOutcome.error());
|
|
||||||
|
|
||||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
|
||||||
|
|
||||||
if (outcome.isSuccess())
|
|
||||||
return DetectIPCPedestrianOptimizedOutcome(DetectIPCPedestrianOptimizedResult(outcome.result()));
|
|
||||||
else
|
|
||||||
return DetectIPCPedestrianOptimizedOutcome(outcome.error());
|
|
||||||
}
|
|
||||||
|
|
||||||
void FacebodyClient::detectIPCPedestrianOptimizedAsync(const DetectIPCPedestrianOptimizedRequest& request, const DetectIPCPedestrianOptimizedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
|
||||||
{
|
|
||||||
auto fn = [this, request, handler, context]()
|
|
||||||
{
|
|
||||||
handler(this, request, detectIPCPedestrianOptimized(request), context);
|
|
||||||
};
|
|
||||||
|
|
||||||
asyncExecute(new Runnable(fn));
|
|
||||||
}
|
|
||||||
|
|
||||||
FacebodyClient::DetectIPCPedestrianOptimizedOutcomeCallable FacebodyClient::detectIPCPedestrianOptimizedCallable(const DetectIPCPedestrianOptimizedRequest &request) const
|
|
||||||
{
|
|
||||||
auto task = std::make_shared<std::packaged_task<DetectIPCPedestrianOptimizedOutcome()>>(
|
|
||||||
[this, request]()
|
|
||||||
{
|
|
||||||
return this->detectIPCPedestrianOptimized(request);
|
|
||||||
});
|
|
||||||
|
|
||||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
|
||||||
return task->get_future();
|
|
||||||
}
|
|
||||||
|
|
||||||
FacebodyClient::DetectLivingFaceOutcome FacebodyClient::detectLivingFace(const DetectLivingFaceRequest &request) const
|
FacebodyClient::DetectLivingFaceOutcome FacebodyClient::detectLivingFace(const DetectLivingFaceRequest &request) const
|
||||||
{
|
{
|
||||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||||
@@ -1131,6 +1095,42 @@ FacebodyClient::ListFaceEntitiesOutcomeCallable FacebodyClient::listFaceEntities
|
|||||||
return task->get_future();
|
return task->get_future();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FacebodyClient::PedestrianDetectAttributeOutcome FacebodyClient::pedestrianDetectAttribute(const PedestrianDetectAttributeRequest &request) const
|
||||||
|
{
|
||||||
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||||
|
if (!endpointOutcome.isSuccess())
|
||||||
|
return PedestrianDetectAttributeOutcome(endpointOutcome.error());
|
||||||
|
|
||||||
|
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||||
|
|
||||||
|
if (outcome.isSuccess())
|
||||||
|
return PedestrianDetectAttributeOutcome(PedestrianDetectAttributeResult(outcome.result()));
|
||||||
|
else
|
||||||
|
return PedestrianDetectAttributeOutcome(outcome.error());
|
||||||
|
}
|
||||||
|
|
||||||
|
void FacebodyClient::pedestrianDetectAttributeAsync(const PedestrianDetectAttributeRequest& request, const PedestrianDetectAttributeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||||
|
{
|
||||||
|
auto fn = [this, request, handler, context]()
|
||||||
|
{
|
||||||
|
handler(this, request, pedestrianDetectAttribute(request), context);
|
||||||
|
};
|
||||||
|
|
||||||
|
asyncExecute(new Runnable(fn));
|
||||||
|
}
|
||||||
|
|
||||||
|
FacebodyClient::PedestrianDetectAttributeOutcomeCallable FacebodyClient::pedestrianDetectAttributeCallable(const PedestrianDetectAttributeRequest &request) const
|
||||||
|
{
|
||||||
|
auto task = std::make_shared<std::packaged_task<PedestrianDetectAttributeOutcome()>>(
|
||||||
|
[this, request]()
|
||||||
|
{
|
||||||
|
return this->pedestrianDetectAttribute(request);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||||
|
return task->get_future();
|
||||||
|
}
|
||||||
|
|
||||||
FacebodyClient::RecognizeActionOutcome FacebodyClient::recognizeAction(const RecognizeActionRequest &request) const
|
FacebodyClient::RecognizeActionOutcome FacebodyClient::recognizeAction(const RecognizeActionRequest &request) const
|
||||||
{
|
{
|
||||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <alibabacloud/facebody/model/DetectIPCPedestrianOptimizedRequest.h>
|
|
||||||
|
|
||||||
using AlibabaCloud::Facebody::Model::DetectIPCPedestrianOptimizedRequest;
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedRequest::DetectIPCPedestrianOptimizedRequest() :
|
|
||||||
RoaServiceRequest("facebody", "2020-09-10")
|
|
||||||
{
|
|
||||||
setResourcePath("/viapi/k8s/facebody/detect-ipc-pedestrian-optimized");
|
|
||||||
setMethod(HttpRequest::Method::Post);
|
|
||||||
}
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedRequest::~DetectIPCPedestrianOptimizedRequest()
|
|
||||||
{}
|
|
||||||
|
|
||||||
std::string DetectIPCPedestrianOptimizedRequest::getImageData()const
|
|
||||||
{
|
|
||||||
return imageData_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DetectIPCPedestrianOptimizedRequest::setImageData(const std::string& imageData)
|
|
||||||
{
|
|
||||||
imageData_ = imageData;
|
|
||||||
setBodyParameter("ImageData", imageData);
|
|
||||||
}
|
|
||||||
|
|
||||||
long DetectIPCPedestrianOptimizedRequest::getWidth()const
|
|
||||||
{
|
|
||||||
return width_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DetectIPCPedestrianOptimizedRequest::setWidth(long width)
|
|
||||||
{
|
|
||||||
width_ = width;
|
|
||||||
setBodyParameter("Width", std::to_string(width));
|
|
||||||
}
|
|
||||||
|
|
||||||
long DetectIPCPedestrianOptimizedRequest::getHeight()const
|
|
||||||
{
|
|
||||||
return height_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DetectIPCPedestrianOptimizedRequest::setHeight(long height)
|
|
||||||
{
|
|
||||||
height_ = height;
|
|
||||||
setBodyParameter("Height", std::to_string(height));
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <alibabacloud/facebody/model/DetectIPCPedestrianOptimizedResult.h>
|
|
||||||
#include <json/json.h>
|
|
||||||
|
|
||||||
using namespace AlibabaCloud::Facebody;
|
|
||||||
using namespace AlibabaCloud::Facebody::Model;
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedResult::DetectIPCPedestrianOptimizedResult() :
|
|
||||||
ServiceResult()
|
|
||||||
{}
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedResult::DetectIPCPedestrianOptimizedResult(const std::string &payload) :
|
|
||||||
ServiceResult()
|
|
||||||
{
|
|
||||||
parse(payload);
|
|
||||||
}
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedResult::~DetectIPCPedestrianOptimizedResult()
|
|
||||||
{}
|
|
||||||
|
|
||||||
void DetectIPCPedestrianOptimizedResult::parse(const std::string &payload)
|
|
||||||
{
|
|
||||||
Json::Reader reader;
|
|
||||||
Json::Value value;
|
|
||||||
reader.parse(payload, value);
|
|
||||||
setRequestId(value["RequestId"].asString());
|
|
||||||
auto dataNode = value["Data"];
|
|
||||||
auto allImageInfoListNode = dataNode["ImageInfoList"]["imageInfoListItem"];
|
|
||||||
for (auto dataNodeImageInfoListimageInfoListItem : allImageInfoListNode)
|
|
||||||
{
|
|
||||||
Data::ImageInfoListItem imageInfoListItemObject;
|
|
||||||
auto allElementsNode = allImageInfoListNode["Elements"]["Element"];
|
|
||||||
for (auto allImageInfoListNodeElementsElement : allElementsNode)
|
|
||||||
{
|
|
||||||
Data::ImageInfoListItem::Element elementsObject;
|
|
||||||
if(!allImageInfoListNodeElementsElement["Score"].isNull())
|
|
||||||
elementsObject.score = std::stof(allImageInfoListNodeElementsElement["Score"].asString());
|
|
||||||
auto allBoxes = value["Boxes"]["Box"];
|
|
||||||
for (auto value : allBoxes)
|
|
||||||
elementsObject.boxes.push_back(value.asString());
|
|
||||||
imageInfoListItemObject.elements.push_back(elementsObject);
|
|
||||||
}
|
|
||||||
data_.imageInfoList.push_back(imageInfoListItemObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DetectIPCPedestrianOptimizedResult::Data DetectIPCPedestrianOptimizedResult::getData()const
|
|
||||||
{
|
|
||||||
return data_;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -27,6 +27,17 @@ ExtractPedestrianFeatureAttributeRequest::ExtractPedestrianFeatureAttributeReque
|
|||||||
ExtractPedestrianFeatureAttributeRequest::~ExtractPedestrianFeatureAttributeRequest()
|
ExtractPedestrianFeatureAttributeRequest::~ExtractPedestrianFeatureAttributeRequest()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
std::string ExtractPedestrianFeatureAttributeRequest::getMode()const
|
||||||
|
{
|
||||||
|
return mode_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExtractPedestrianFeatureAttributeRequest::setMode(const std::string& mode)
|
||||||
|
{
|
||||||
|
mode_ = mode;
|
||||||
|
setBodyParameter("Mode", mode);
|
||||||
|
}
|
||||||
|
|
||||||
std::string ExtractPedestrianFeatureAttributeRequest::getImageURL()const
|
std::string ExtractPedestrianFeatureAttributeRequest::getImageURL()const
|
||||||
{
|
{
|
||||||
return imageURL_;
|
return imageURL_;
|
||||||
|
|||||||
40
facebody/src/model/PedestrianDetectAttributeRequest.cc
Normal file
40
facebody/src/model/PedestrianDetectAttributeRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <alibabacloud/facebody/model/PedestrianDetectAttributeRequest.h>
|
||||||
|
|
||||||
|
using AlibabaCloud::Facebody::Model::PedestrianDetectAttributeRequest;
|
||||||
|
|
||||||
|
PedestrianDetectAttributeRequest::PedestrianDetectAttributeRequest() :
|
||||||
|
RpcServiceRequest("facebody", "2019-12-30", "PedestrianDetectAttribute")
|
||||||
|
{
|
||||||
|
setMethod(HttpRequest::Method::Post);
|
||||||
|
}
|
||||||
|
|
||||||
|
PedestrianDetectAttributeRequest::~PedestrianDetectAttributeRequest()
|
||||||
|
{}
|
||||||
|
|
||||||
|
std::string PedestrianDetectAttributeRequest::getImageURL()const
|
||||||
|
{
|
||||||
|
return imageURL_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PedestrianDetectAttributeRequest::setImageURL(const std::string& imageURL)
|
||||||
|
{
|
||||||
|
imageURL_ = imageURL;
|
||||||
|
setBodyParameter("ImageURL", imageURL);
|
||||||
|
}
|
||||||
|
|
||||||
134
facebody/src/model/PedestrianDetectAttributeResult.cc
Normal file
134
facebody/src/model/PedestrianDetectAttributeResult.cc
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <alibabacloud/facebody/model/PedestrianDetectAttributeResult.h>
|
||||||
|
#include <json/json.h>
|
||||||
|
|
||||||
|
using namespace AlibabaCloud::Facebody;
|
||||||
|
using namespace AlibabaCloud::Facebody::Model;
|
||||||
|
|
||||||
|
PedestrianDetectAttributeResult::PedestrianDetectAttributeResult() :
|
||||||
|
ServiceResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
PedestrianDetectAttributeResult::PedestrianDetectAttributeResult(const std::string &payload) :
|
||||||
|
ServiceResult()
|
||||||
|
{
|
||||||
|
parse(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
PedestrianDetectAttributeResult::~PedestrianDetectAttributeResult()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void PedestrianDetectAttributeResult::parse(const std::string &payload)
|
||||||
|
{
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value value;
|
||||||
|
reader.parse(payload, value);
|
||||||
|
setRequestId(value["RequestId"].asString());
|
||||||
|
auto dataNode = value["Data"];
|
||||||
|
if(!dataNode["PersonNumber"].isNull())
|
||||||
|
data_.personNumber = std::stoi(dataNode["PersonNumber"].asString());
|
||||||
|
auto allAttributesNode = dataNode["Attributes"]["AttributesItem"];
|
||||||
|
for (auto dataNodeAttributesAttributesItem : allAttributesNode)
|
||||||
|
{
|
||||||
|
Data::AttributesItem attributesItemObject;
|
||||||
|
auto ageNode = value["Age"];
|
||||||
|
if(!ageNode["Name"].isNull())
|
||||||
|
attributesItemObject.age.name = ageNode["Name"].asString();
|
||||||
|
if(!ageNode["Score"].isNull())
|
||||||
|
attributesItemObject.age.score = std::stof(ageNode["Score"].asString());
|
||||||
|
auto backpackNode = value["Backpack"];
|
||||||
|
if(!backpackNode["Name"].isNull())
|
||||||
|
attributesItemObject.backpack.name = backpackNode["Name"].asString();
|
||||||
|
if(!backpackNode["Score"].isNull())
|
||||||
|
attributesItemObject.backpack.score = std::stof(backpackNode["Score"].asString());
|
||||||
|
auto genderNode = value["Gender"];
|
||||||
|
if(!genderNode["Name"].isNull())
|
||||||
|
attributesItemObject.gender.name = genderNode["Name"].asString();
|
||||||
|
if(!genderNode["Score"].isNull())
|
||||||
|
attributesItemObject.gender.score = std::stof(genderNode["Score"].asString());
|
||||||
|
auto glassesNode = value["Glasses"];
|
||||||
|
if(!glassesNode["Name"].isNull())
|
||||||
|
attributesItemObject.glasses.name = glassesNode["Name"].asString();
|
||||||
|
if(!glassesNode["Score"].isNull())
|
||||||
|
attributesItemObject.glasses.score = std::stof(glassesNode["Score"].asString());
|
||||||
|
auto handbagNode = value["Handbag"];
|
||||||
|
if(!handbagNode["Name"].isNull())
|
||||||
|
attributesItemObject.handbag.name = handbagNode["Name"].asString();
|
||||||
|
if(!handbagNode["Score"].isNull())
|
||||||
|
attributesItemObject.handbag.score = std::stof(handbagNode["Score"].asString());
|
||||||
|
auto hatNode = value["Hat"];
|
||||||
|
if(!hatNode["Name"].isNull())
|
||||||
|
attributesItemObject.hat.name = hatNode["Name"].asString();
|
||||||
|
if(!hatNode["Score"].isNull())
|
||||||
|
attributesItemObject.hat.score = std::stof(hatNode["Score"].asString());
|
||||||
|
auto lowerColorNode = value["LowerColor"];
|
||||||
|
if(!lowerColorNode["Name"].isNull())
|
||||||
|
attributesItemObject.lowerColor.name = lowerColorNode["Name"].asString();
|
||||||
|
if(!lowerColorNode["Score"].isNull())
|
||||||
|
attributesItemObject.lowerColor.score = std::stof(lowerColorNode["Score"].asString());
|
||||||
|
auto lowerWearNode = value["LowerWear"];
|
||||||
|
if(!lowerWearNode["Name"].isNull())
|
||||||
|
attributesItemObject.lowerWear.name = lowerWearNode["Name"].asString();
|
||||||
|
if(!lowerWearNode["Score"].isNull())
|
||||||
|
attributesItemObject.lowerWear.score = std::stof(lowerWearNode["Score"].asString());
|
||||||
|
auto orientNode = value["Orient"];
|
||||||
|
if(!orientNode["Name"].isNull())
|
||||||
|
attributesItemObject.orient.name = orientNode["Name"].asString();
|
||||||
|
if(!orientNode["Score"].isNull())
|
||||||
|
attributesItemObject.orient.score = std::stof(orientNode["Score"].asString());
|
||||||
|
auto shoulderBagNode = value["ShoulderBag"];
|
||||||
|
if(!shoulderBagNode["Name"].isNull())
|
||||||
|
attributesItemObject.shoulderBag.name = shoulderBagNode["Name"].asString();
|
||||||
|
if(!shoulderBagNode["Score"].isNull())
|
||||||
|
attributesItemObject.shoulderBag.score = std::stof(shoulderBagNode["Score"].asString());
|
||||||
|
auto upperColorNode = value["UpperColor"];
|
||||||
|
if(!upperColorNode["Name"].isNull())
|
||||||
|
attributesItemObject.upperColor.name = upperColorNode["Name"].asString();
|
||||||
|
if(!upperColorNode["Score"].isNull())
|
||||||
|
attributesItemObject.upperColor.score = std::stof(upperColorNode["Score"].asString());
|
||||||
|
auto upperWearNode = value["UpperWear"];
|
||||||
|
if(!upperWearNode["Name"].isNull())
|
||||||
|
attributesItemObject.upperWear.name = upperWearNode["Name"].asString();
|
||||||
|
if(!upperWearNode["Score"].isNull())
|
||||||
|
attributesItemObject.upperWear.score = std::stof(upperWearNode["Score"].asString());
|
||||||
|
data_.attributes.push_back(attributesItemObject);
|
||||||
|
}
|
||||||
|
auto allBoxesNode = dataNode["Boxes"]["BoxesItem"];
|
||||||
|
for (auto dataNodeBoxesBoxesItem : allBoxesNode)
|
||||||
|
{
|
||||||
|
Data::BoxesItem boxesItemObject;
|
||||||
|
if(!dataNodeBoxesBoxesItem["Score"].isNull())
|
||||||
|
boxesItemObject.score = std::stof(dataNodeBoxesBoxesItem["Score"].asString());
|
||||||
|
if(!dataNodeBoxesBoxesItem["TopLeftX"].isNull())
|
||||||
|
boxesItemObject.topLeftX = std::stof(dataNodeBoxesBoxesItem["TopLeftX"].asString());
|
||||||
|
if(!dataNodeBoxesBoxesItem["TopLeftY"].isNull())
|
||||||
|
boxesItemObject.topLeftY = std::stof(dataNodeBoxesBoxesItem["TopLeftY"].asString());
|
||||||
|
if(!dataNodeBoxesBoxesItem["BottomRightX"].isNull())
|
||||||
|
boxesItemObject.bottomRightX = std::stof(dataNodeBoxesBoxesItem["BottomRightX"].asString());
|
||||||
|
if(!dataNodeBoxesBoxesItem["BottomRightY"].isNull())
|
||||||
|
boxesItemObject.bottomRightY = std::stof(dataNodeBoxesBoxesItem["BottomRightY"].asString());
|
||||||
|
data_.boxes.push_back(boxesItemObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PedestrianDetectAttributeResult::Data PedestrianDetectAttributeResult::getData()const
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user