diff --git a/CHANGELOG b/CHANGELOG index 362f04159..d32690ac0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-09-09 Version: patch +- Release DetectChefCap. + 2020-09-09 Version: patch - Release DetectKneeKeypointXRay, DetectHipKeypointXRay, CalcCACS, RunCTRegistration, ClassifyFNF. diff --git a/facebody/CMakeLists.txt b/facebody/CMakeLists.txt index 96fd6049e..416b90cc8 100644 --- a/facebody/CMakeLists.txt +++ b/facebody/CMakeLists.txt @@ -43,6 +43,8 @@ set(facebody_public_header_model include/alibabacloud/facebody/model/DetectBodyCountResult.h include/alibabacloud/facebody/model/DetectCelebrityRequest.h include/alibabacloud/facebody/model/DetectCelebrityResult.h + include/alibabacloud/facebody/model/DetectChefCapRequest.h + include/alibabacloud/facebody/model/DetectChefCapResult.h include/alibabacloud/facebody/model/DetectFaceRequest.h include/alibabacloud/facebody/model/DetectFaceResult.h include/alibabacloud/facebody/model/DetectIPCPedestrianRequest.h @@ -57,6 +59,8 @@ set(facebody_public_header_model include/alibabacloud/facebody/model/DetectVideoLivingFaceResult.h include/alibabacloud/facebody/model/EnhanceFaceRequest.h include/alibabacloud/facebody/model/EnhanceFaceResult.h + include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrRequest.h + include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrResult.h include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttributeRequest.h include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttributeResult.h include/alibabacloud/facebody/model/FaceBeautyRequest.h @@ -116,6 +120,8 @@ set(facebody_src src/model/DetectBodyCountResult.cc src/model/DetectCelebrityRequest.cc src/model/DetectCelebrityResult.cc + src/model/DetectChefCapRequest.cc + src/model/DetectChefCapResult.cc src/model/DetectFaceRequest.cc src/model/DetectFaceResult.cc src/model/DetectIPCPedestrianRequest.cc @@ -130,6 +136,8 @@ set(facebody_src src/model/DetectVideoLivingFaceResult.cc src/model/EnhanceFaceRequest.cc src/model/EnhanceFaceResult.cc + src/model/ExtractPedestrianFeatureAttrRequest.cc + src/model/ExtractPedestrianFeatureAttrResult.cc src/model/ExtractPedestrianFeatureAttributeRequest.cc src/model/ExtractPedestrianFeatureAttributeResult.cc src/model/FaceBeautyRequest.cc diff --git a/facebody/include/alibabacloud/facebody/FacebodyClient.h b/facebody/include/alibabacloud/facebody/FacebodyClient.h index bd7912d7c..5fd734fa7 100644 --- a/facebody/include/alibabacloud/facebody/FacebodyClient.h +++ b/facebody/include/alibabacloud/facebody/FacebodyClient.h @@ -44,6 +44,8 @@ #include "model/DetectBodyCountResult.h" #include "model/DetectCelebrityRequest.h" #include "model/DetectCelebrityResult.h" +#include "model/DetectChefCapRequest.h" +#include "model/DetectChefCapResult.h" #include "model/DetectFaceRequest.h" #include "model/DetectFaceResult.h" #include "model/DetectIPCPedestrianRequest.h" @@ -58,6 +60,8 @@ #include "model/DetectVideoLivingFaceResult.h" #include "model/EnhanceFaceRequest.h" #include "model/EnhanceFaceResult.h" +#include "model/ExtractPedestrianFeatureAttrRequest.h" +#include "model/ExtractPedestrianFeatureAttrResult.h" #include "model/ExtractPedestrianFeatureAttributeRequest.h" #include "model/ExtractPedestrianFeatureAttributeResult.h" #include "model/FaceBeautyRequest.h" @@ -134,6 +138,9 @@ namespace AlibabaCloud typedef Outcome DetectCelebrityOutcome; typedef std::future DetectCelebrityOutcomeCallable; typedef std::function&)> DetectCelebrityAsyncHandler; + typedef Outcome DetectChefCapOutcome; + typedef std::future DetectChefCapOutcomeCallable; + typedef std::function&)> DetectChefCapAsyncHandler; typedef Outcome DetectFaceOutcome; typedef std::future DetectFaceOutcomeCallable; typedef std::function&)> DetectFaceAsyncHandler; @@ -155,6 +162,9 @@ namespace AlibabaCloud typedef Outcome EnhanceFaceOutcome; typedef std::future EnhanceFaceOutcomeCallable; typedef std::function&)> EnhanceFaceAsyncHandler; + typedef Outcome ExtractPedestrianFeatureAttrOutcome; + typedef std::future ExtractPedestrianFeatureAttrOutcomeCallable; + typedef std::function&)> ExtractPedestrianFeatureAttrAsyncHandler; typedef Outcome ExtractPedestrianFeatureAttributeOutcome; typedef std::future ExtractPedestrianFeatureAttributeOutcomeCallable; typedef std::function&)> ExtractPedestrianFeatureAttributeAsyncHandler; @@ -244,6 +254,9 @@ namespace AlibabaCloud DetectCelebrityOutcome detectCelebrity(const Model::DetectCelebrityRequest &request)const; void detectCelebrityAsync(const Model::DetectCelebrityRequest& request, const DetectCelebrityAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DetectCelebrityOutcomeCallable detectCelebrityCallable(const Model::DetectCelebrityRequest& request) const; + DetectChefCapOutcome detectChefCap(const Model::DetectChefCapRequest &request)const; + void detectChefCapAsync(const Model::DetectChefCapRequest& request, const DetectChefCapAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DetectChefCapOutcomeCallable detectChefCapCallable(const Model::DetectChefCapRequest& request) const; DetectFaceOutcome detectFace(const Model::DetectFaceRequest &request)const; void detectFaceAsync(const Model::DetectFaceRequest& request, const DetectFaceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DetectFaceOutcomeCallable detectFaceCallable(const Model::DetectFaceRequest& request) const; @@ -265,6 +278,9 @@ namespace AlibabaCloud EnhanceFaceOutcome enhanceFace(const Model::EnhanceFaceRequest &request)const; void enhanceFaceAsync(const Model::EnhanceFaceRequest& request, const EnhanceFaceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; EnhanceFaceOutcomeCallable enhanceFaceCallable(const Model::EnhanceFaceRequest& request) const; + ExtractPedestrianFeatureAttrOutcome extractPedestrianFeatureAttr(const Model::ExtractPedestrianFeatureAttrRequest &request)const; + void extractPedestrianFeatureAttrAsync(const Model::ExtractPedestrianFeatureAttrRequest& request, const ExtractPedestrianFeatureAttrAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ExtractPedestrianFeatureAttrOutcomeCallable extractPedestrianFeatureAttrCallable(const Model::ExtractPedestrianFeatureAttrRequest& request) const; ExtractPedestrianFeatureAttributeOutcome extractPedestrianFeatureAttribute(const Model::ExtractPedestrianFeatureAttributeRequest &request)const; void extractPedestrianFeatureAttributeAsync(const Model::ExtractPedestrianFeatureAttributeRequest& request, const ExtractPedestrianFeatureAttributeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ExtractPedestrianFeatureAttributeOutcomeCallable extractPedestrianFeatureAttributeCallable(const Model::ExtractPedestrianFeatureAttributeRequest& request) const; diff --git a/facebody/include/alibabacloud/facebody/model/DetectChefCapRequest.h b/facebody/include/alibabacloud/facebody/model/DetectChefCapRequest.h new file mode 100644 index 000000000..4653ed6ba --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/DetectChefCapRequest.h @@ -0,0 +1,48 @@ +/* + * 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_DETECTCHEFCAPREQUEST_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_DETECTCHEFCAPREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT DetectChefCapRequest : public RpcServiceRequest + { + + public: + DetectChefCapRequest(); + ~DetectChefCapRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_DETECTCHEFCAPREQUEST_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/DetectChefCapResult.h b/facebody/include/alibabacloud/facebody/model/DetectChefCapResult.h new file mode 100644 index 000000000..f6cf8b047 --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/DetectChefCapResult.h @@ -0,0 +1,61 @@ +/* + * 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_DETECTCHEFCAPRESULT_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_DETECTCHEFCAPRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT DetectChefCapResult : public ServiceResult + { + public: + struct Data + { + struct ElementsItem + { + std::string category; + float confidence; + std::vector box; + }; + std::vector elements; + }; + + + DetectChefCapResult(); + explicit DetectChefCapResult(const std::string &payload); + ~DetectChefCapResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_DETECTCHEFCAPRESULT_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrRequest.h b/facebody/include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrRequest.h new file mode 100644 index 000000000..33af1b78a --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrRequest.h @@ -0,0 +1,51 @@ +/* + * 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_EXTRACTPEDESTRIANFEATUREATTRREQUEST_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_EXTRACTPEDESTRIANFEATUREATTRREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT ExtractPedestrianFeatureAttrRequest : public RpcServiceRequest + { + + public: + ExtractPedestrianFeatureAttrRequest(); + ~ExtractPedestrianFeatureAttrRequest(); + + std::string getMode()const; + void setMode(const std::string& mode); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string mode_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_EXTRACTPEDESTRIANFEATUREATTRREQUEST_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrResult.h b/facebody/include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrResult.h new file mode 100644 index 000000000..e5915f41c --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/ExtractPedestrianFeatureAttrResult.h @@ -0,0 +1,72 @@ +/* + * 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_EXTRACTPEDESTRIANFEATUREATTRRESULT_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_EXTRACTPEDESTRIANFEATUREATTRRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT ExtractPedestrianFeatureAttrResult : public ServiceResult + { + public: + struct Data + { + std::string hair; + std::string upperType; + float upperTypeScore; + float qualityScore; + std::string lowerColor; + std::string gender; + std::string feature; + float upperColorScore; + float lowerColorScore; + float genderScore; + std::string objType; + float lowerTypeScore; + float hairScore; + std::string upperColor; + std::string lowerType; + float ageScore; + float objTypeScore; + std::string age; + }; + + + ExtractPedestrianFeatureAttrResult(); + explicit ExtractPedestrianFeatureAttrResult(const std::string &payload); + ~ExtractPedestrianFeatureAttrResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_EXTRACTPEDESTRIANFEATUREATTRRESULT_H_ \ No newline at end of file diff --git a/facebody/src/FacebodyClient.cc b/facebody/src/FacebodyClient.cc index 3ba464a9c..8945dcb9d 100644 --- a/facebody/src/FacebodyClient.cc +++ b/facebody/src/FacebodyClient.cc @@ -447,6 +447,42 @@ FacebodyClient::DetectCelebrityOutcomeCallable FacebodyClient::detectCelebrityCa return task->get_future(); } +FacebodyClient::DetectChefCapOutcome FacebodyClient::detectChefCap(const DetectChefCapRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DetectChefCapOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DetectChefCapOutcome(DetectChefCapResult(outcome.result())); + else + return DetectChefCapOutcome(outcome.error()); +} + +void FacebodyClient::detectChefCapAsync(const DetectChefCapRequest& request, const DetectChefCapAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, detectChefCap(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +FacebodyClient::DetectChefCapOutcomeCallable FacebodyClient::detectChefCapCallable(const DetectChefCapRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->detectChefCap(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + FacebodyClient::DetectFaceOutcome FacebodyClient::detectFace(const DetectFaceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -699,6 +735,42 @@ FacebodyClient::EnhanceFaceOutcomeCallable FacebodyClient::enhanceFaceCallable(c return task->get_future(); } +FacebodyClient::ExtractPedestrianFeatureAttrOutcome FacebodyClient::extractPedestrianFeatureAttr(const ExtractPedestrianFeatureAttrRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ExtractPedestrianFeatureAttrOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ExtractPedestrianFeatureAttrOutcome(ExtractPedestrianFeatureAttrResult(outcome.result())); + else + return ExtractPedestrianFeatureAttrOutcome(outcome.error()); +} + +void FacebodyClient::extractPedestrianFeatureAttrAsync(const ExtractPedestrianFeatureAttrRequest& request, const ExtractPedestrianFeatureAttrAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, extractPedestrianFeatureAttr(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +FacebodyClient::ExtractPedestrianFeatureAttrOutcomeCallable FacebodyClient::extractPedestrianFeatureAttrCallable(const ExtractPedestrianFeatureAttrRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->extractPedestrianFeatureAttr(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + FacebodyClient::ExtractPedestrianFeatureAttributeOutcome FacebodyClient::extractPedestrianFeatureAttribute(const ExtractPedestrianFeatureAttributeRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/facebody/src/model/DetectChefCapRequest.cc b/facebody/src/model/DetectChefCapRequest.cc new file mode 100644 index 000000000..973e8a89b --- /dev/null +++ b/facebody/src/model/DetectChefCapRequest.cc @@ -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 + +using AlibabaCloud::Facebody::Model::DetectChefCapRequest; + +DetectChefCapRequest::DetectChefCapRequest() : + RpcServiceRequest("facebody", "2019-12-30", "DetectChefCap") +{ + setMethod(HttpRequest::Method::Post); +} + +DetectChefCapRequest::~DetectChefCapRequest() +{} + +std::string DetectChefCapRequest::getImageURL()const +{ + return imageURL_; +} + +void DetectChefCapRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/facebody/src/model/DetectChefCapResult.cc b/facebody/src/model/DetectChefCapResult.cc new file mode 100644 index 000000000..b9196ef4e --- /dev/null +++ b/facebody/src/model/DetectChefCapResult.cc @@ -0,0 +1,63 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Facebody; +using namespace AlibabaCloud::Facebody::Model; + +DetectChefCapResult::DetectChefCapResult() : + ServiceResult() +{} + +DetectChefCapResult::DetectChefCapResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DetectChefCapResult::~DetectChefCapResult() +{} + +void DetectChefCapResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allElementsNode = dataNode["Elements"]["ElementsItem"]; + for (auto dataNodeElementsElementsItem : allElementsNode) + { + Data::ElementsItem elementsItemObject; + if(!dataNodeElementsElementsItem["Category"].isNull()) + elementsItemObject.category = dataNodeElementsElementsItem["Category"].asString(); + if(!dataNodeElementsElementsItem["Confidence"].isNull()) + elementsItemObject.confidence = std::stof(dataNodeElementsElementsItem["Confidence"].asString()); + auto allBox = value["Box"]["Box"]; + for (auto value : allBox) + elementsItemObject.box.push_back(value.asString()); + data_.elements.push_back(elementsItemObject); + } + +} + +DetectChefCapResult::Data DetectChefCapResult::getData()const +{ + return data_; +} + diff --git a/facebody/src/model/ExtractPedestrianFeatureAttrRequest.cc b/facebody/src/model/ExtractPedestrianFeatureAttrRequest.cc new file mode 100644 index 000000000..edcf75357 --- /dev/null +++ b/facebody/src/model/ExtractPedestrianFeatureAttrRequest.cc @@ -0,0 +1,51 @@ +/* + * 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 + +using AlibabaCloud::Facebody::Model::ExtractPedestrianFeatureAttrRequest; + +ExtractPedestrianFeatureAttrRequest::ExtractPedestrianFeatureAttrRequest() : + RpcServiceRequest("facebody", "2019-12-30", "ExtractPedestrianFeatureAttr") +{ + setMethod(HttpRequest::Method::Post); +} + +ExtractPedestrianFeatureAttrRequest::~ExtractPedestrianFeatureAttrRequest() +{} + +std::string ExtractPedestrianFeatureAttrRequest::getMode()const +{ + return mode_; +} + +void ExtractPedestrianFeatureAttrRequest::setMode(const std::string& mode) +{ + mode_ = mode; + setBodyParameter("Mode", mode); +} + +std::string ExtractPedestrianFeatureAttrRequest::getImageURL()const +{ + return imageURL_; +} + +void ExtractPedestrianFeatureAttrRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/facebody/src/model/ExtractPedestrianFeatureAttrResult.cc b/facebody/src/model/ExtractPedestrianFeatureAttrResult.cc new file mode 100644 index 000000000..16a10b09b --- /dev/null +++ b/facebody/src/model/ExtractPedestrianFeatureAttrResult.cc @@ -0,0 +1,86 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Facebody; +using namespace AlibabaCloud::Facebody::Model; + +ExtractPedestrianFeatureAttrResult::ExtractPedestrianFeatureAttrResult() : + ServiceResult() +{} + +ExtractPedestrianFeatureAttrResult::ExtractPedestrianFeatureAttrResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ExtractPedestrianFeatureAttrResult::~ExtractPedestrianFeatureAttrResult() +{} + +void ExtractPedestrianFeatureAttrResult::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["ObjType"].isNull()) + data_.objType = dataNode["ObjType"].asString(); + if(!dataNode["ObjTypeScore"].isNull()) + data_.objTypeScore = std::stof(dataNode["ObjTypeScore"].asString()); + if(!dataNode["Feature"].isNull()) + data_.feature = dataNode["Feature"].asString(); + if(!dataNode["QualityScore"].isNull()) + data_.qualityScore = std::stof(dataNode["QualityScore"].asString()); + if(!dataNode["UpperColor"].isNull()) + data_.upperColor = dataNode["UpperColor"].asString(); + if(!dataNode["UpperColorScore"].isNull()) + data_.upperColorScore = std::stof(dataNode["UpperColorScore"].asString()); + if(!dataNode["UpperType"].isNull()) + data_.upperType = dataNode["UpperType"].asString(); + if(!dataNode["UpperTypeScore"].isNull()) + data_.upperTypeScore = std::stof(dataNode["UpperTypeScore"].asString()); + if(!dataNode["LowerColor"].isNull()) + data_.lowerColor = dataNode["LowerColor"].asString(); + if(!dataNode["LowerColorScore"].isNull()) + data_.lowerColorScore = std::stof(dataNode["LowerColorScore"].asString()); + if(!dataNode["LowerType"].isNull()) + data_.lowerType = dataNode["LowerType"].asString(); + if(!dataNode["LowerTypeScore"].isNull()) + data_.lowerTypeScore = std::stof(dataNode["LowerTypeScore"].asString()); + if(!dataNode["Gender"].isNull()) + data_.gender = dataNode["Gender"].asString(); + if(!dataNode["GenderScore"].isNull()) + data_.genderScore = std::stof(dataNode["GenderScore"].asString()); + if(!dataNode["Hair"].isNull()) + data_.hair = dataNode["Hair"].asString(); + if(!dataNode["HairScore"].isNull()) + data_.hairScore = std::stof(dataNode["HairScore"].asString()); + if(!dataNode["Age"].isNull()) + data_.age = dataNode["Age"].asString(); + if(!dataNode["AgeScore"].isNull()) + data_.ageScore = std::stof(dataNode["AgeScore"].asString()); + +} + +ExtractPedestrianFeatureAttrResult::Data ExtractPedestrianFeatureAttrResult::getData()const +{ + return data_; +} +