diff --git a/CHANGELOG b/CHANGELOG index 18f989dd4..3a51f54b6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-08-19 Version: 1.36.853 +- Release BeautifyBody. + 2021-08-13 Version: 1.36.852 - Supported etlOperatorColumnReference for ModifyDtsJob. diff --git a/VERSION b/VERSION index e6b688697..8e18b4f2b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.852 \ No newline at end of file +1.36.853 \ No newline at end of file diff --git a/facebody/CMakeLists.txt b/facebody/CMakeLists.txt index 170b65c12..0e88cb95c 100644 --- a/facebody/CMakeLists.txt +++ b/facebody/CMakeLists.txt @@ -29,6 +29,8 @@ set(facebody_public_header_model include/alibabacloud/facebody/model/AddFaceEntityResult.h include/alibabacloud/facebody/model/AddFaceImageTemplateRequest.h include/alibabacloud/facebody/model/AddFaceImageTemplateResult.h + include/alibabacloud/facebody/model/BeautifyBodyRequest.h + include/alibabacloud/facebody/model/BeautifyBodyResult.h include/alibabacloud/facebody/model/BlurFaceRequest.h include/alibabacloud/facebody/model/BlurFaceResult.h include/alibabacloud/facebody/model/BodyPostureRequest.h @@ -152,6 +154,8 @@ set(facebody_src src/model/AddFaceEntityResult.cc src/model/AddFaceImageTemplateRequest.cc src/model/AddFaceImageTemplateResult.cc + src/model/BeautifyBodyRequest.cc + src/model/BeautifyBodyResult.cc src/model/BlurFaceRequest.cc src/model/BlurFaceResult.cc src/model/BodyPostureRequest.cc diff --git a/facebody/include/alibabacloud/facebody/FacebodyClient.h b/facebody/include/alibabacloud/facebody/FacebodyClient.h index 0aeca304a..e8241b8cd 100644 --- a/facebody/include/alibabacloud/facebody/FacebodyClient.h +++ b/facebody/include/alibabacloud/facebody/FacebodyClient.h @@ -30,6 +30,8 @@ #include "model/AddFaceEntityResult.h" #include "model/AddFaceImageTemplateRequest.h" #include "model/AddFaceImageTemplateResult.h" +#include "model/BeautifyBodyRequest.h" +#include "model/BeautifyBodyResult.h" #include "model/BlurFaceRequest.h" #include "model/BlurFaceResult.h" #include "model/BodyPostureRequest.h" @@ -163,6 +165,9 @@ namespace AlibabaCloud typedef Outcome AddFaceImageTemplateOutcome; typedef std::future AddFaceImageTemplateOutcomeCallable; typedef std::function&)> AddFaceImageTemplateAsyncHandler; + typedef Outcome BeautifyBodyOutcome; + typedef std::future BeautifyBodyOutcomeCallable; + typedef std::function&)> BeautifyBodyAsyncHandler; typedef Outcome BlurFaceOutcome; typedef std::future BlurFaceOutcomeCallable; typedef std::function&)> BlurFaceAsyncHandler; @@ -348,6 +353,9 @@ namespace AlibabaCloud AddFaceImageTemplateOutcome addFaceImageTemplate(const Model::AddFaceImageTemplateRequest &request)const; void addFaceImageTemplateAsync(const Model::AddFaceImageTemplateRequest& request, const AddFaceImageTemplateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AddFaceImageTemplateOutcomeCallable addFaceImageTemplateCallable(const Model::AddFaceImageTemplateRequest& request) const; + BeautifyBodyOutcome beautifyBody(const Model::BeautifyBodyRequest &request)const; + void beautifyBodyAsync(const Model::BeautifyBodyRequest& request, const BeautifyBodyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BeautifyBodyOutcomeCallable beautifyBodyCallable(const Model::BeautifyBodyRequest& request) const; BlurFaceOutcome blurFace(const Model::BlurFaceRequest &request)const; void blurFaceAsync(const Model::BlurFaceRequest& request, const BlurFaceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BlurFaceOutcomeCallable blurFaceCallable(const Model::BlurFaceRequest& request) const; diff --git a/facebody/include/alibabacloud/facebody/model/BeautifyBodyRequest.h b/facebody/include/alibabacloud/facebody/model/BeautifyBodyRequest.h new file mode 100644 index 000000000..f56e753d8 --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/BeautifyBodyRequest.h @@ -0,0 +1,78 @@ +/* + * 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_BEAUTIFYBODYREQUEST_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_BEAUTIFYBODYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT BeautifyBodyRequest : public RpcServiceRequest + { + + public: + BeautifyBodyRequest(); + ~BeautifyBodyRequest(); + + Array getBodyBoxes()const; + void setBodyBoxes(const Array& bodyBoxes); + float getLengthenDegree()const; + void setLengthenDegree(float lengthenDegree); + float getMaleLiquifyDegree()const; + void setMaleLiquifyDegree(float maleLiquifyDegree); + long getOriginalWidth()const; + void setOriginalWidth(long originalWidth); + Array getFaceList()const; + void setFaceList(const Array& faceList); + Struct getAgeRange()const; + void setAgeRange(const Struct& ageRange); + long getCustom()const; + void setCustom(long custom); + long getOriginalHeight()const; + void setOriginalHeight(long originalHeight); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + float getFemaleLiquifyDegree()const; + void setFemaleLiquifyDegree(float femaleLiquifyDegree); + Array getPoseList()const; + void setPoseList(const Array& poseList); + + private: + Array bodyBoxes_; + float lengthenDegree_; + float maleLiquifyDegree_; + long originalWidth_; + Array faceList_; + Struct ageRange_; + long custom_; + long originalHeight_; + std::string imageURL_; + float femaleLiquifyDegree_; + Array poseList_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_BEAUTIFYBODYREQUEST_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/BeautifyBodyResult.h b/facebody/include/alibabacloud/facebody/model/BeautifyBodyResult.h new file mode 100644 index 000000000..f5cd3e777 --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/BeautifyBodyResult.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_BEAUTIFYBODYRESULT_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_BEAUTIFYBODYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT BeautifyBodyResult : public ServiceResult + { + public: + struct Data + { + std::string action; + std::string xFlowURL; + std::string yFlowURL; + }; + + + BeautifyBodyResult(); + explicit BeautifyBodyResult(const std::string &payload); + ~BeautifyBodyResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_BEAUTIFYBODYRESULT_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/CompareFaceResult.h b/facebody/include/alibabacloud/facebody/model/CompareFaceResult.h index 758c92b4a..a92699a0e 100644 --- a/facebody/include/alibabacloud/facebody/model/CompareFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/CompareFaceResult.h @@ -34,8 +34,8 @@ namespace AlibabaCloud public: struct Data { - std::string messageTips; float qualityScoreA; + std::string messageTips; float qualityScoreB; std::vector thresholds; float confidence; diff --git a/facebody/include/alibabacloud/facebody/model/DetectFaceResult.h b/facebody/include/alibabacloud/facebody/model/DetectFaceResult.h index ab119f681..4b7e4bc92 100644 --- a/facebody/include/alibabacloud/facebody/model/DetectFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/DetectFaceResult.h @@ -36,12 +36,12 @@ namespace AlibabaCloud { struct Qualities { - std::vector noiseList; std::vector scoreList; + std::vector noiseList; std::vector blurList; - std::vector maskList; - std::vector glassList; std::vector fnfList; + std::vector glassList; + std::vector maskList; std::vector poseList1; std::vector illuList; }; @@ -51,8 +51,8 @@ namespace AlibabaCloud std::vector landmarks; Qualities qualities; int faceCount; - std::vector poseList; std::vector pupils; + std::vector poseList; }; diff --git a/facebody/include/alibabacloud/facebody/model/GenRealPersonVerificationTokenRequest.h b/facebody/include/alibabacloud/facebody/model/GenRealPersonVerificationTokenRequest.h index 2f999ece9..0f6c16fb3 100644 --- a/facebody/include/alibabacloud/facebody/model/GenRealPersonVerificationTokenRequest.h +++ b/facebody/include/alibabacloud/facebody/model/GenRealPersonVerificationTokenRequest.h @@ -35,17 +35,17 @@ namespace AlibabaCloud GenRealPersonVerificationTokenRequest(); ~GenRealPersonVerificationTokenRequest(); + std::string getMetaInfo()const; + void setMetaInfo(const std::string& metaInfo); std::string getCertificateNumber()const; void setCertificateNumber(const std::string& certificateNumber); std::string getCertificateName()const; void setCertificateName(const std::string& certificateName); - std::string getMetaInfo()const; - void setMetaInfo(const std::string& metaInfo); private: + std::string metaInfo_; std::string certificateNumber_; std::string certificateName_; - std::string metaInfo_; }; } diff --git a/facebody/include/alibabacloud/facebody/model/PedestrianDetectAttributeResult.h b/facebody/include/alibabacloud/facebody/model/PedestrianDetectAttributeResult.h index b195459cc..cb309197b 100644 --- a/facebody/include/alibabacloud/facebody/model/PedestrianDetectAttributeResult.h +++ b/facebody/include/alibabacloud/facebody/model/PedestrianDetectAttributeResult.h @@ -36,17 +36,7 @@ namespace AlibabaCloud { struct AttributesItem { - struct Backpack - { - float score; - std::string name; - }; - struct LowerWear - { - float score; - std::string name; - }; - struct ShoulderBag + struct Gender { float score; std::string name; @@ -56,32 +46,7 @@ namespace AlibabaCloud float score; std::string name; }; - struct LowerColor - { - float score; - std::string name; - }; - struct Glasses - { - float score; - std::string name; - }; - struct UpperColor - { - float score; - std::string name; - }; - struct Handbag - { - float score; - std::string name; - }; - struct Hat - { - float score; - std::string name; - }; - struct Gender + struct Age { float score; std::string name; @@ -91,23 +56,58 @@ namespace AlibabaCloud float score; std::string name; }; - struct Age + struct Glasses + { + float score; + std::string name; + }; + struct LowerWear + { + float score; + std::string name; + }; + struct LowerColor + { + float score; + std::string name; + }; + struct Hat + { + float score; + std::string name; + }; + struct Handbag + { + float score; + std::string name; + }; + struct Backpack + { + float score; + std::string name; + }; + struct UpperColor + { + float score; + std::string name; + }; + struct ShoulderBag { float score; std::string name; }; - Backpack backpack; LowerWear lowerWear; - ShoulderBag shoulderBag; + Backpack backpack; Orient orient; + ShoulderBag shoulderBag; LowerColor lowerColor; Glasses glasses; UpperColor upperColor; - Handbag handbag; Hat hat; + Handbag handbag; Gender gender; - UpperWear upperWear; Age age; + UpperWear upperWear; }; struct BoxesItem { diff --git a/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h b/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h index 7dcd7466a..9301172d9 100644 --- a/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h @@ -36,12 +36,12 @@ namespace AlibabaCloud { struct Qualities { - std::vector noiseList; std::vector scoreList; + std::vector noiseList; std::vector blurList; - std::vector maskList; - std::vector glassList; std::vector fnfList; + std::vector glassList; + std::vector maskList; std::vector poseList1; std::vector illuList; }; @@ -49,10 +49,10 @@ namespace AlibabaCloud std::vector faceRectangles; Qualities qualities; int denseFeatureLength; - std::vector masks; - std::vector poseList; - std::vector genderList; std::vector pupils; + std::vector genderList; + std::vector poseList; + std::vector masks; std::vector denseFeatures; std::vector faceProbabilityList; std::vector hatList; diff --git a/facebody/include/alibabacloud/facebody/model/RecognizePublicFaceResult.h b/facebody/include/alibabacloud/facebody/model/RecognizePublicFaceResult.h index 27aa803f4..6b9bb3ef1 100644 --- a/facebody/include/alibabacloud/facebody/model/RecognizePublicFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/RecognizePublicFaceResult.h @@ -47,8 +47,8 @@ namespace AlibabaCloud std::string name; }; float w; - float x; float h; + float x; float y; std::vector faces; }; diff --git a/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h b/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h index d7f545f42..d90af357b 100644 --- a/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h @@ -45,8 +45,8 @@ namespace AlibabaCloud }; struct FaceItemsItem { - std::string faceId; std::string entityId; + std::string faceId; float score; std::string dbName; std::string extraData; diff --git a/facebody/src/FacebodyClient.cc b/facebody/src/FacebodyClient.cc index 2728b1100..d8da368f2 100644 --- a/facebody/src/FacebodyClient.cc +++ b/facebody/src/FacebodyClient.cc @@ -195,6 +195,42 @@ FacebodyClient::AddFaceImageTemplateOutcomeCallable FacebodyClient::addFaceImage return task->get_future(); } +FacebodyClient::BeautifyBodyOutcome FacebodyClient::beautifyBody(const BeautifyBodyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BeautifyBodyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BeautifyBodyOutcome(BeautifyBodyResult(outcome.result())); + else + return BeautifyBodyOutcome(outcome.error()); +} + +void FacebodyClient::beautifyBodyAsync(const BeautifyBodyRequest& request, const BeautifyBodyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, beautifyBody(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +FacebodyClient::BeautifyBodyOutcomeCallable FacebodyClient::beautifyBodyCallable(const BeautifyBodyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->beautifyBody(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + FacebodyClient::BlurFaceOutcome FacebodyClient::blurFace(const BlurFaceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/facebody/src/model/BeautifyBodyRequest.cc b/facebody/src/model/BeautifyBodyRequest.cc new file mode 100644 index 000000000..79a504bf2 --- /dev/null +++ b/facebody/src/model/BeautifyBodyRequest.cc @@ -0,0 +1,150 @@ +/* + * 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::BeautifyBodyRequest; + +BeautifyBodyRequest::BeautifyBodyRequest() : + RpcServiceRequest("facebody", "2019-12-30", "BeautifyBody") +{ + setMethod(HttpRequest::Method::Post); +} + +BeautifyBodyRequest::~BeautifyBodyRequest() +{} + +Array BeautifyBodyRequest::getBodyBoxes()const +{ + return bodyBoxes_; +} + +void BeautifyBodyRequest::setBodyBoxes(const Array& bodyBoxes) +{ + bodyBoxes_ = bodyBoxes; + setBodyParameter("BodyBoxes", std::to_string(bodyBoxes)); +} + +float BeautifyBodyRequest::getLengthenDegree()const +{ + return lengthenDegree_; +} + +void BeautifyBodyRequest::setLengthenDegree(float lengthenDegree) +{ + lengthenDegree_ = lengthenDegree; + setBodyParameter("LengthenDegree", std::to_string(lengthenDegree)); +} + +float BeautifyBodyRequest::getMaleLiquifyDegree()const +{ + return maleLiquifyDegree_; +} + +void BeautifyBodyRequest::setMaleLiquifyDegree(float maleLiquifyDegree) +{ + maleLiquifyDegree_ = maleLiquifyDegree; + setBodyParameter("MaleLiquifyDegree", std::to_string(maleLiquifyDegree)); +} + +long BeautifyBodyRequest::getOriginalWidth()const +{ + return originalWidth_; +} + +void BeautifyBodyRequest::setOriginalWidth(long originalWidth) +{ + originalWidth_ = originalWidth; + setBodyParameter("OriginalWidth", std::to_string(originalWidth)); +} + +Array BeautifyBodyRequest::getFaceList()const +{ + return faceList_; +} + +void BeautifyBodyRequest::setFaceList(const Array& faceList) +{ + faceList_ = faceList; + setBodyParameter("FaceList", std::to_string(faceList)); +} + +Struct BeautifyBodyRequest::getAgeRange()const +{ + return ageRange_; +} + +void BeautifyBodyRequest::setAgeRange(const Struct& ageRange) +{ + ageRange_ = ageRange; + setBodyParameter("AgeRange", std::to_string(ageRange)); +} + +long BeautifyBodyRequest::getCustom()const +{ + return custom_; +} + +void BeautifyBodyRequest::setCustom(long custom) +{ + custom_ = custom; + setBodyParameter("Custom", std::to_string(custom)); +} + +long BeautifyBodyRequest::getOriginalHeight()const +{ + return originalHeight_; +} + +void BeautifyBodyRequest::setOriginalHeight(long originalHeight) +{ + originalHeight_ = originalHeight; + setBodyParameter("OriginalHeight", std::to_string(originalHeight)); +} + +std::string BeautifyBodyRequest::getImageURL()const +{ + return imageURL_; +} + +void BeautifyBodyRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + +float BeautifyBodyRequest::getFemaleLiquifyDegree()const +{ + return femaleLiquifyDegree_; +} + +void BeautifyBodyRequest::setFemaleLiquifyDegree(float femaleLiquifyDegree) +{ + femaleLiquifyDegree_ = femaleLiquifyDegree; + setBodyParameter("FemaleLiquifyDegree", std::to_string(femaleLiquifyDegree)); +} + +Array BeautifyBodyRequest::getPoseList()const +{ + return poseList_; +} + +void BeautifyBodyRequest::setPoseList(const Array& poseList) +{ + poseList_ = poseList; + setBodyParameter("PoseList", std::to_string(poseList)); +} + diff --git a/facebody/src/model/BeautifyBodyResult.cc b/facebody/src/model/BeautifyBodyResult.cc new file mode 100644 index 000000000..ed7b4e745 --- /dev/null +++ b/facebody/src/model/BeautifyBodyResult.cc @@ -0,0 +1,70 @@ +/* + * 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; + +BeautifyBodyResult::BeautifyBodyResult() : + ServiceResult() +{} + +BeautifyBodyResult::BeautifyBodyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BeautifyBodyResult::~BeautifyBodyResult() +{} + +void BeautifyBodyResult::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["XFlowURL"].isNull()) + data_.xFlowURL = dataNode["XFlowURL"].asString(); + if(!dataNode["YFlowURL"].isNull()) + data_.yFlowURL = dataNode["YFlowURL"].asString(); + if(!dataNode["Action"].isNull()) + data_.action = dataNode["Action"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string BeautifyBodyResult::getMessage()const +{ + return message_; +} + +BeautifyBodyResult::Data BeautifyBodyResult::getData()const +{ + return data_; +} + +std::string BeautifyBodyResult::getCode()const +{ + return code_; +} + diff --git a/facebody/src/model/CompareFaceResult.cc b/facebody/src/model/CompareFaceResult.cc index 6fb55c11f..9cb24f1eb 100644 --- a/facebody/src/model/CompareFaceResult.cc +++ b/facebody/src/model/CompareFaceResult.cc @@ -40,23 +40,23 @@ void CompareFaceResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); auto dataNode = value["Data"]; - if(!dataNode["MessageTips"].isNull()) - data_.messageTips = dataNode["MessageTips"].asString(); + if(!dataNode["Confidence"].isNull()) + data_.confidence = std::stof(dataNode["Confidence"].asString()); if(!dataNode["QualityScoreA"].isNull()) data_.qualityScoreA = std::stof(dataNode["QualityScoreA"].asString()); if(!dataNode["QualityScoreB"].isNull()) data_.qualityScoreB = std::stof(dataNode["QualityScoreB"].asString()); - if(!dataNode["Confidence"].isNull()) - data_.confidence = std::stof(dataNode["Confidence"].asString()); + if(!dataNode["MessageTips"].isNull()) + data_.messageTips = dataNode["MessageTips"].asString(); auto allThresholds = dataNode["Thresholds"]["Threshold"]; for (auto value : allThresholds) data_.thresholds.push_back(value.asString()); - auto allRectAList = dataNode["RectAList"]["RectA"]; - for (auto value : allRectAList) - data_.rectAList.push_back(value.asString()); auto allRectBList = dataNode["RectBList"]["RectB"]; for (auto value : allRectBList) data_.rectBList.push_back(value.asString()); + auto allRectAList = dataNode["RectAList"]["RectA"]; + for (auto value : allRectAList) + data_.rectAList.push_back(value.asString()); if(!value["Code"].isNull()) code_ = value["Code"].asString(); diff --git a/facebody/src/model/DetectFaceResult.cc b/facebody/src/model/DetectFaceResult.cc index d0d9d1022..ce8843448 100644 --- a/facebody/src/model/DetectFaceResult.cc +++ b/facebody/src/model/DetectFaceResult.cc @@ -40,50 +40,50 @@ void DetectFaceResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); auto dataNode = value["Data"]; - if(!dataNode["LandmarkCount"].isNull()) - data_.landmarkCount = std::stoi(dataNode["LandmarkCount"].asString()); if(!dataNode["FaceCount"].isNull()) data_.faceCount = std::stoi(dataNode["FaceCount"].asString()); + if(!dataNode["LandmarkCount"].isNull()) + data_.landmarkCount = std::stoi(dataNode["LandmarkCount"].asString()); auto qualitiesNode = dataNode["Qualities"]; - auto allNoiseList = qualitiesNode["NoiseList"]["Noise"]; - for (auto value : allNoiseList) - data_.qualities.noiseList.push_back(value.asString()); auto allScoreList = qualitiesNode["ScoreList"]["Score"]; for (auto value : allScoreList) data_.qualities.scoreList.push_back(value.asString()); auto allBlurList = qualitiesNode["BlurList"]["Blur"]; for (auto value : allBlurList) data_.qualities.blurList.push_back(value.asString()); - auto allMaskList = qualitiesNode["MaskList"]["Mask"]; - for (auto value : allMaskList) - data_.qualities.maskList.push_back(value.asString()); - auto allGlassList = qualitiesNode["GlassList"]["Glass"]; - for (auto value : allGlassList) - data_.qualities.glassList.push_back(value.asString()); auto allFnfList = qualitiesNode["FnfList"]["Fnf"]; for (auto value : allFnfList) data_.qualities.fnfList.push_back(value.asString()); - auto allPoseList1 = qualitiesNode["PoseList"]["Pose"]; - for (auto value : allPoseList1) - data_.qualities.poseList1.push_back(value.asString()); + auto allGlassList = qualitiesNode["GlassList"]["Glass"]; + for (auto value : allGlassList) + data_.qualities.glassList.push_back(value.asString()); auto allIlluList = qualitiesNode["IlluList"]["Illu"]; for (auto value : allIlluList) data_.qualities.illuList.push_back(value.asString()); + auto allMaskList = qualitiesNode["MaskList"]["Mask"]; + for (auto value : allMaskList) + data_.qualities.maskList.push_back(value.asString()); + auto allNoiseList = qualitiesNode["NoiseList"]["Noise"]; + for (auto value : allNoiseList) + data_.qualities.noiseList.push_back(value.asString()); + auto allPoseList1 = qualitiesNode["PoseList"]["Pose"]; + for (auto value : allPoseList1) + data_.qualities.poseList1.push_back(value.asString()); auto allFaceProbabilityList = dataNode["FaceProbabilityList"]["FaceProbability"]; for (auto value : allFaceProbabilityList) data_.faceProbabilityList.push_back(value.asString()); - auto allFaceRectangles = dataNode["FaceRectangles"]["FaceRectangle"]; - for (auto value : allFaceRectangles) - data_.faceRectangles.push_back(value.asString()); - auto allLandmarks = dataNode["Landmarks"]["Landmark"]; - for (auto value : allLandmarks) - data_.landmarks.push_back(value.asString()); - auto allPoseList = dataNode["PoseList"]["Pose"]; - for (auto value : allPoseList) - data_.poseList.push_back(value.asString()); auto allPupils = dataNode["Pupils"]["Pupil"]; for (auto value : allPupils) data_.pupils.push_back(value.asString()); + auto allFaceRectangles = dataNode["FaceRectangles"]["FaceRectangle"]; + for (auto value : allFaceRectangles) + data_.faceRectangles.push_back(value.asString()); + auto allPoseList = dataNode["PoseList"]["Pose"]; + for (auto value : allPoseList) + data_.poseList.push_back(value.asString()); + auto allLandmarks = dataNode["Landmarks"]["Landmark"]; + for (auto value : allLandmarks) + data_.landmarks.push_back(value.asString()); } diff --git a/facebody/src/model/DetectLivingFaceResult.cc b/facebody/src/model/DetectLivingFaceResult.cc index bbb681c64..d4f8330a9 100644 --- a/facebody/src/model/DetectLivingFaceResult.cc +++ b/facebody/src/model/DetectLivingFaceResult.cc @@ -44,28 +44,28 @@ void DetectLivingFaceResult::parse(const std::string &payload) for (auto dataNodeElementsElement : allElementsNode) { Data::Element elementObject; - if(!dataNodeElementsElement["TaskId"].isNull()) - elementObject.taskId = dataNodeElementsElement["TaskId"].asString(); if(!dataNodeElementsElement["ImageURL"].isNull()) elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString(); + if(!dataNodeElementsElement["TaskId"].isNull()) + elementObject.taskId = dataNodeElementsElement["TaskId"].asString(); auto allResultsNode = dataNodeElementsElement["Results"]["Result"]; for (auto dataNodeElementsElementResultsResult : allResultsNode) { Data::Element::Result resultsObject; if(!dataNodeElementsElementResultsResult["Suggestion"].isNull()) resultsObject.suggestion = dataNodeElementsElementResultsResult["Suggestion"].asString(); - if(!dataNodeElementsElementResultsResult["Rate"].isNull()) - resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString()); if(!dataNodeElementsElementResultsResult["Label"].isNull()) resultsObject.label = dataNodeElementsElementResultsResult["Label"].asString(); + if(!dataNodeElementsElementResultsResult["Rate"].isNull()) + resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString()); auto allFramesNode = dataNodeElementsElementResultsResult["Frames"]["Frame"]; for (auto dataNodeElementsElementResultsResultFramesFrame : allFramesNode) { Data::Element::Result::Frame framesObject; - if(!dataNodeElementsElementResultsResultFramesFrame["Rate"].isNull()) - framesObject.rate = std::stof(dataNodeElementsElementResultsResultFramesFrame["Rate"].asString()); if(!dataNodeElementsElementResultsResultFramesFrame["Url"].isNull()) framesObject.url = dataNodeElementsElementResultsResultFramesFrame["Url"].asString(); + if(!dataNodeElementsElementResultsResultFramesFrame["Rate"].isNull()) + framesObject.rate = std::stof(dataNodeElementsElementResultsResultFramesFrame["Rate"].asString()); resultsObject.frames.push_back(framesObject); } elementObject.results.push_back(resultsObject); diff --git a/facebody/src/model/GenRealPersonVerificationTokenRequest.cc b/facebody/src/model/GenRealPersonVerificationTokenRequest.cc index ad66856b7..35db11cb7 100644 --- a/facebody/src/model/GenRealPersonVerificationTokenRequest.cc +++ b/facebody/src/model/GenRealPersonVerificationTokenRequest.cc @@ -27,6 +27,17 @@ GenRealPersonVerificationTokenRequest::GenRealPersonVerificationTokenRequest() : GenRealPersonVerificationTokenRequest::~GenRealPersonVerificationTokenRequest() {} +std::string GenRealPersonVerificationTokenRequest::getMetaInfo()const +{ + return metaInfo_; +} + +void GenRealPersonVerificationTokenRequest::setMetaInfo(const std::string& metaInfo) +{ + metaInfo_ = metaInfo; + setBodyParameter("MetaInfo", metaInfo); +} + std::string GenRealPersonVerificationTokenRequest::getCertificateNumber()const { return certificateNumber_; @@ -49,14 +60,3 @@ void GenRealPersonVerificationTokenRequest::setCertificateName(const std::string setBodyParameter("CertificateName", certificateName); } -std::string GenRealPersonVerificationTokenRequest::getMetaInfo()const -{ - return metaInfo_; -} - -void GenRealPersonVerificationTokenRequest::setMetaInfo(const std::string& metaInfo) -{ - metaInfo_ = metaInfo; - setBodyParameter("MetaInfo", metaInfo); -} - diff --git a/facebody/src/model/GenRealPersonVerificationTokenResult.cc b/facebody/src/model/GenRealPersonVerificationTokenResult.cc index 2043cb0f2..f90ee3928 100644 --- a/facebody/src/model/GenRealPersonVerificationTokenResult.cc +++ b/facebody/src/model/GenRealPersonVerificationTokenResult.cc @@ -44,10 +44,10 @@ void GenRealPersonVerificationTokenResult::parse(const std::string &payload) data_.verificationToken = dataNode["VerificationToken"].asString(); if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/facebody/src/model/PedestrianDetectAttributeResult.cc b/facebody/src/model/PedestrianDetectAttributeResult.cc index 56b689abe..97b1b67e8 100644 --- a/facebody/src/model/PedestrianDetectAttributeResult.cc +++ b/facebody/src/model/PedestrianDetectAttributeResult.cc @@ -42,90 +42,90 @@ void PedestrianDetectAttributeResult::parse(const std::string &payload) auto dataNode = value["Data"]; if(!dataNode["PersonNumber"].isNull()) data_.personNumber = std::stoi(dataNode["PersonNumber"].asString()); - if(!dataNode["Height"].isNull()) - data_.height = std::stol(dataNode["Height"].asString()); if(!dataNode["Width"].isNull()) data_.width = std::stol(dataNode["Width"].asString()); + if(!dataNode["Height"].isNull()) + data_.height = std::stol(dataNode["Height"].asString()); auto allAttributesNode = dataNode["Attributes"]["AttributesItem"]; for (auto dataNodeAttributesAttributesItem : allAttributesNode) { Data::AttributesItem attributesItemObject; - auto backpackNode = value["Backpack"]; - if(!backpackNode["Score"].isNull()) - attributesItemObject.backpack.score = std::stof(backpackNode["Score"].asString()); - if(!backpackNode["Name"].isNull()) - attributesItemObject.backpack.name = backpackNode["Name"].asString(); - auto lowerWearNode = value["LowerWear"]; - if(!lowerWearNode["Score"].isNull()) - attributesItemObject.lowerWear.score = std::stof(lowerWearNode["Score"].asString()); - if(!lowerWearNode["Name"].isNull()) - attributesItemObject.lowerWear.name = lowerWearNode["Name"].asString(); - auto shoulderBagNode = value["ShoulderBag"]; - if(!shoulderBagNode["Score"].isNull()) - attributesItemObject.shoulderBag.score = std::stof(shoulderBagNode["Score"].asString()); - if(!shoulderBagNode["Name"].isNull()) - attributesItemObject.shoulderBag.name = shoulderBagNode["Name"].asString(); - auto orientNode = value["Orient"]; - if(!orientNode["Score"].isNull()) - attributesItemObject.orient.score = std::stof(orientNode["Score"].asString()); - if(!orientNode["Name"].isNull()) - attributesItemObject.orient.name = orientNode["Name"].asString(); - auto lowerColorNode = value["LowerColor"]; - if(!lowerColorNode["Score"].isNull()) - attributesItemObject.lowerColor.score = std::stof(lowerColorNode["Score"].asString()); - if(!lowerColorNode["Name"].isNull()) - attributesItemObject.lowerColor.name = lowerColorNode["Name"].asString(); - auto glassesNode = value["Glasses"]; - if(!glassesNode["Score"].isNull()) - attributesItemObject.glasses.score = std::stof(glassesNode["Score"].asString()); - if(!glassesNode["Name"].isNull()) - attributesItemObject.glasses.name = glassesNode["Name"].asString(); - auto upperColorNode = value["UpperColor"]; - if(!upperColorNode["Score"].isNull()) - attributesItemObject.upperColor.score = std::stof(upperColorNode["Score"].asString()); - if(!upperColorNode["Name"].isNull()) - attributesItemObject.upperColor.name = upperColorNode["Name"].asString(); - auto handbagNode = value["Handbag"]; - if(!handbagNode["Score"].isNull()) - attributesItemObject.handbag.score = std::stof(handbagNode["Score"].asString()); - if(!handbagNode["Name"].isNull()) - attributesItemObject.handbag.name = handbagNode["Name"].asString(); - auto hatNode = value["Hat"]; - if(!hatNode["Score"].isNull()) - attributesItemObject.hat.score = std::stof(hatNode["Score"].asString()); - if(!hatNode["Name"].isNull()) - attributesItemObject.hat.name = hatNode["Name"].asString(); auto genderNode = value["Gender"]; if(!genderNode["Score"].isNull()) attributesItemObject.gender.score = std::stof(genderNode["Score"].asString()); if(!genderNode["Name"].isNull()) attributesItemObject.gender.name = genderNode["Name"].asString(); - auto upperWearNode = value["UpperWear"]; - if(!upperWearNode["Score"].isNull()) - attributesItemObject.upperWear.score = std::stof(upperWearNode["Score"].asString()); - if(!upperWearNode["Name"].isNull()) - attributesItemObject.upperWear.name = upperWearNode["Name"].asString(); + auto orientNode = value["Orient"]; + if(!orientNode["Score"].isNull()) + attributesItemObject.orient.score = std::stof(orientNode["Score"].asString()); + if(!orientNode["Name"].isNull()) + attributesItemObject.orient.name = orientNode["Name"].asString(); auto ageNode = value["Age"]; if(!ageNode["Score"].isNull()) attributesItemObject.age.score = std::stof(ageNode["Score"].asString()); if(!ageNode["Name"].isNull()) attributesItemObject.age.name = ageNode["Name"].asString(); + auto upperWearNode = value["UpperWear"]; + if(!upperWearNode["Score"].isNull()) + attributesItemObject.upperWear.score = std::stof(upperWearNode["Score"].asString()); + if(!upperWearNode["Name"].isNull()) + attributesItemObject.upperWear.name = upperWearNode["Name"].asString(); + auto glassesNode = value["Glasses"]; + if(!glassesNode["Score"].isNull()) + attributesItemObject.glasses.score = std::stof(glassesNode["Score"].asString()); + if(!glassesNode["Name"].isNull()) + attributesItemObject.glasses.name = glassesNode["Name"].asString(); + auto lowerWearNode = value["LowerWear"]; + if(!lowerWearNode["Score"].isNull()) + attributesItemObject.lowerWear.score = std::stof(lowerWearNode["Score"].asString()); + if(!lowerWearNode["Name"].isNull()) + attributesItemObject.lowerWear.name = lowerWearNode["Name"].asString(); + auto lowerColorNode = value["LowerColor"]; + if(!lowerColorNode["Score"].isNull()) + attributesItemObject.lowerColor.score = std::stof(lowerColorNode["Score"].asString()); + if(!lowerColorNode["Name"].isNull()) + attributesItemObject.lowerColor.name = lowerColorNode["Name"].asString(); + auto hatNode = value["Hat"]; + if(!hatNode["Score"].isNull()) + attributesItemObject.hat.score = std::stof(hatNode["Score"].asString()); + if(!hatNode["Name"].isNull()) + attributesItemObject.hat.name = hatNode["Name"].asString(); + auto handbagNode = value["Handbag"]; + if(!handbagNode["Score"].isNull()) + attributesItemObject.handbag.score = std::stof(handbagNode["Score"].asString()); + if(!handbagNode["Name"].isNull()) + attributesItemObject.handbag.name = handbagNode["Name"].asString(); + auto backpackNode = value["Backpack"]; + if(!backpackNode["Score"].isNull()) + attributesItemObject.backpack.score = std::stof(backpackNode["Score"].asString()); + if(!backpackNode["Name"].isNull()) + attributesItemObject.backpack.name = backpackNode["Name"].asString(); + auto upperColorNode = value["UpperColor"]; + if(!upperColorNode["Score"].isNull()) + attributesItemObject.upperColor.score = std::stof(upperColorNode["Score"].asString()); + if(!upperColorNode["Name"].isNull()) + attributesItemObject.upperColor.name = upperColorNode["Name"].asString(); + auto shoulderBagNode = value["ShoulderBag"]; + if(!shoulderBagNode["Score"].isNull()) + attributesItemObject.shoulderBag.score = std::stof(shoulderBagNode["Score"].asString()); + if(!shoulderBagNode["Name"].isNull()) + attributesItemObject.shoulderBag.name = shoulderBagNode["Name"].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["BottomRightY"].isNull()) - boxesItemObject.bottomRightY = std::stof(dataNodeBoxesBoxesItem["BottomRightY"].asString()); if(!dataNodeBoxesBoxesItem["BottomRightX"].isNull()) boxesItemObject.bottomRightX = std::stof(dataNodeBoxesBoxesItem["BottomRightX"].asString()); if(!dataNodeBoxesBoxesItem["TopLeftY"].isNull()) boxesItemObject.topLeftY = std::stof(dataNodeBoxesBoxesItem["TopLeftY"].asString()); + if(!dataNodeBoxesBoxesItem["Score"].isNull()) + boxesItemObject.score = std::stof(dataNodeBoxesBoxesItem["Score"].asString()); if(!dataNodeBoxesBoxesItem["TopLeftX"].isNull()) boxesItemObject.topLeftX = std::stof(dataNodeBoxesBoxesItem["TopLeftX"].asString()); + if(!dataNodeBoxesBoxesItem["BottomRightY"].isNull()) + boxesItemObject.bottomRightY = std::stof(dataNodeBoxesBoxesItem["BottomRightY"].asString()); data_.boxes.push_back(boxesItemObject); } diff --git a/facebody/src/model/RecognizeFaceResult.cc b/facebody/src/model/RecognizeFaceResult.cc index 7c2afc8c5..3eb805380 100644 --- a/facebody/src/model/RecognizeFaceResult.cc +++ b/facebody/src/model/RecognizeFaceResult.cc @@ -40,76 +40,76 @@ void RecognizeFaceResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); auto dataNode = value["Data"]; + if(!dataNode["FaceCount"].isNull()) + data_.faceCount = std::stoi(dataNode["FaceCount"].asString()); if(!dataNode["LandmarkCount"].isNull()) data_.landmarkCount = std::stoi(dataNode["LandmarkCount"].asString()); if(!dataNode["DenseFeatureLength"].isNull()) data_.denseFeatureLength = std::stoi(dataNode["DenseFeatureLength"].asString()); - if(!dataNode["FaceCount"].isNull()) - data_.faceCount = std::stoi(dataNode["FaceCount"].asString()); auto qualitiesNode = dataNode["Qualities"]; - auto allNoiseList = qualitiesNode["NoiseList"]["Noise"]; - for (auto value : allNoiseList) - data_.qualities.noiseList.push_back(value.asString()); auto allScoreList = qualitiesNode["ScoreList"]["Score"]; for (auto value : allScoreList) data_.qualities.scoreList.push_back(value.asString()); auto allBlurList = qualitiesNode["BlurList"]["Blur"]; for (auto value : allBlurList) data_.qualities.blurList.push_back(value.asString()); - auto allMaskList = qualitiesNode["MaskList"]["Mask"]; - for (auto value : allMaskList) - data_.qualities.maskList.push_back(value.asString()); - auto allGlassList = qualitiesNode["GlassList"]["Glass"]; - for (auto value : allGlassList) - data_.qualities.glassList.push_back(value.asString()); auto allFnfList = qualitiesNode["FnfList"]["Fnf"]; for (auto value : allFnfList) data_.qualities.fnfList.push_back(value.asString()); - auto allPoseList1 = qualitiesNode["PoseList"]["Pose"]; - for (auto value : allPoseList1) - data_.qualities.poseList1.push_back(value.asString()); + auto allGlassList = qualitiesNode["GlassList"]["Glass"]; + for (auto value : allGlassList) + data_.qualities.glassList.push_back(value.asString()); auto allIlluList = qualitiesNode["IlluList"]["Illu"]; for (auto value : allIlluList) data_.qualities.illuList.push_back(value.asString()); + auto allMaskList = qualitiesNode["MaskList"]["Mask"]; + for (auto value : allMaskList) + data_.qualities.maskList.push_back(value.asString()); + auto allNoiseList = qualitiesNode["NoiseList"]["Noise"]; + for (auto value : allNoiseList) + data_.qualities.noiseList.push_back(value.asString()); + auto allPoseList1 = qualitiesNode["PoseList"]["Pose"]; + for (auto value : allPoseList1) + data_.qualities.poseList1.push_back(value.asString()); + auto allPupils = dataNode["Pupils"]["Pupil"]; + for (auto value : allPupils) + data_.pupils.push_back(value.asString()); + auto allGenderList = dataNode["GenderList"]["Gender"]; + for (auto value : allGenderList) + data_.genderList.push_back(value.asString()); + auto allExpressions = dataNode["Expressions"]["Expression"]; + for (auto value : allExpressions) + data_.expressions.push_back(value.asString()); auto allDenseFeatures = dataNode["DenseFeatures"]["DenseFeature"]; for (auto value : allDenseFeatures) data_.denseFeatures.push_back(value.asString()); - auto allFaceProbabilityList = dataNode["FaceProbabilityList"]["FaceProbability"]; - for (auto value : allFaceProbabilityList) - data_.faceProbabilityList.push_back(value.asString()); + auto allLandmarks = dataNode["Landmarks"]["Landmark"]; + for (auto value : allLandmarks) + data_.landmarks.push_back(value.asString()); auto allBeautyList = dataNode["BeautyList"]["Beauty"]; for (auto value : allBeautyList) data_.beautyList.push_back(value.asString()); auto allHatList = dataNode["HatList"]["Hat"]; for (auto value : allHatList) data_.hatList.push_back(value.asString()); - auto allAgeList = dataNode["AgeList"]["Age"]; - for (auto value : allAgeList) - data_.ageList.push_back(value.asString()); - auto allFaceRectangles = dataNode["FaceRectangles"]["FaceRectangle"]; - for (auto value : allFaceRectangles) - data_.faceRectangles.push_back(value.asString()); + auto allFaceProbabilityList = dataNode["FaceProbabilityList"]["FaceProbability"]; + for (auto value : allFaceProbabilityList) + data_.faceProbabilityList.push_back(value.asString()); auto allGlasses = dataNode["Glasses"]["Glass"]; for (auto value : allGlasses) data_.glasses.push_back(value.asString()); - auto allLandmarks = dataNode["Landmarks"]["Landmark"]; - for (auto value : allLandmarks) - data_.landmarks.push_back(value.asString()); - auto allExpressions = dataNode["Expressions"]["Expression"]; - for (auto value : allExpressions) - data_.expressions.push_back(value.asString()); - auto allMasks = dataNode["Masks"]["Mask"]; - for (auto value : allMasks) - data_.masks.push_back(value.asString()); + auto allFaceRectangles = dataNode["FaceRectangles"]["FaceRectangle"]; + for (auto value : allFaceRectangles) + data_.faceRectangles.push_back(value.asString()); auto allPoseList = dataNode["PoseList"]["Pose"]; for (auto value : allPoseList) data_.poseList.push_back(value.asString()); - auto allGenderList = dataNode["GenderList"]["Gender"]; - for (auto value : allGenderList) - data_.genderList.push_back(value.asString()); - auto allPupils = dataNode["Pupils"]["Pupil"]; - for (auto value : allPupils) - data_.pupils.push_back(value.asString()); + auto allAgeList = dataNode["AgeList"]["Age"]; + for (auto value : allAgeList) + data_.ageList.push_back(value.asString()); + auto allMasks = dataNode["Masks"]["Mask"]; + for (auto value : allMasks) + data_.masks.push_back(value.asString()); } diff --git a/facebody/src/model/RecognizePublicFaceResult.cc b/facebody/src/model/RecognizePublicFaceResult.cc index 3eff1db88..8fc91e51f 100644 --- a/facebody/src/model/RecognizePublicFaceResult.cc +++ b/facebody/src/model/RecognizePublicFaceResult.cc @@ -44,42 +44,42 @@ void RecognizePublicFaceResult::parse(const std::string &payload) for (auto dataNodeElementsElement : allElementsNode) { Data::Element elementObject; - if(!dataNodeElementsElement["TaskId"].isNull()) - elementObject.taskId = dataNodeElementsElement["TaskId"].asString(); if(!dataNodeElementsElement["ImageURL"].isNull()) elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString(); + if(!dataNodeElementsElement["TaskId"].isNull()) + elementObject.taskId = dataNodeElementsElement["TaskId"].asString(); auto allResultsNode = dataNodeElementsElement["Results"]["Result"]; for (auto dataNodeElementsElementResultsResult : allResultsNode) { Data::Element::Result resultsObject; if(!dataNodeElementsElementResultsResult["Suggestion"].isNull()) resultsObject.suggestion = dataNodeElementsElementResultsResult["Suggestion"].asString(); - if(!dataNodeElementsElementResultsResult["Rate"].isNull()) - resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString()); if(!dataNodeElementsElementResultsResult["Label"].isNull()) resultsObject.label = dataNodeElementsElementResultsResult["Label"].asString(); + if(!dataNodeElementsElementResultsResult["Rate"].isNull()) + resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString()); auto allSubResultsNode = dataNodeElementsElementResultsResult["SubResults"]["SubResult"]; for (auto dataNodeElementsElementResultsResultSubResultsSubResult : allSubResultsNode) { Data::Element::Result::SubResult subResultsObject; if(!dataNodeElementsElementResultsResultSubResultsSubResult["W"].isNull()) subResultsObject.w = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["W"].asString()); - if(!dataNodeElementsElementResultsResultSubResultsSubResult["X"].isNull()) - subResultsObject.x = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["X"].asString()); if(!dataNodeElementsElementResultsResultSubResultsSubResult["H"].isNull()) subResultsObject.h = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["H"].asString()); if(!dataNodeElementsElementResultsResultSubResultsSubResult["Y"].isNull()) subResultsObject.y = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["Y"].asString()); + if(!dataNodeElementsElementResultsResultSubResultsSubResult["X"].isNull()) + subResultsObject.x = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["X"].asString()); auto allFacesNode = dataNodeElementsElementResultsResultSubResultsSubResult["Faces"]["Face"]; for (auto dataNodeElementsElementResultsResultSubResultsSubResultFacesFace : allFacesNode) { Data::Element::Result::SubResult::Face facesObject; - if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Rate"].isNull()) - facesObject.rate = std::stof(dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Rate"].asString()); - if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Id"].isNull()) - facesObject.id = dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Id"].asString(); if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Name"].isNull()) facesObject.name = dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Name"].asString(); + if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Id"].isNull()) + facesObject.id = dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Id"].asString(); + if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Rate"].isNull()) + facesObject.rate = std::stof(dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Rate"].asString()); subResultsObject.faces.push_back(facesObject); } resultsObject.subResults.push_back(subResultsObject); diff --git a/facebody/src/model/SearchFaceResult.cc b/facebody/src/model/SearchFaceResult.cc index 42ca5dc13..fe274d9a3 100644 --- a/facebody/src/model/SearchFaceResult.cc +++ b/facebody/src/model/SearchFaceResult.cc @@ -48,27 +48,27 @@ void SearchFaceResult::parse(const std::string &payload) for (auto dataNodeMatchListMatchListItemFaceItemsFaceItemsItem : allFaceItemsNode) { Data::MatchListItem::FaceItemsItem faceItemsObject; - if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].isNull()) - faceItemsObject.faceId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].asString(); if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].isNull()) faceItemsObject.entityId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].asString(); + if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].isNull()) + faceItemsObject.faceId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].asString(); if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].isNull()) faceItemsObject.score = std::stof(dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].asString()); - if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].isNull()) - faceItemsObject.dbName = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].asString(); if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].isNull()) faceItemsObject.extraData = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].asString(); + if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].isNull()) + faceItemsObject.dbName = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].asString(); matchListItemObject.faceItems.push_back(faceItemsObject); } auto locationNode = value["Location"]; - if(!locationNode["X"].isNull()) - matchListItemObject.location.x = std::stoi(locationNode["X"].asString()); - if(!locationNode["Y"].isNull()) - matchListItemObject.location.y = std::stoi(locationNode["Y"].asString()); - if(!locationNode["Height"].isNull()) - matchListItemObject.location.height = std::stoi(locationNode["Height"].asString()); if(!locationNode["Width"].isNull()) matchListItemObject.location.width = std::stoi(locationNode["Width"].asString()); + if(!locationNode["Height"].isNull()) + matchListItemObject.location.height = std::stoi(locationNode["Height"].asString()); + if(!locationNode["Y"].isNull()) + matchListItemObject.location.y = std::stoi(locationNode["Y"].asString()); + if(!locationNode["X"].isNull()) + matchListItemObject.location.x = std::stoi(locationNode["X"].asString()); data_.matchList.push_back(matchListItemObject); }