From 7b81c413a1866edb1f0ffea234a2303017664a12 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 21 Oct 2021 07:31:07 +0000 Subject: [PATCH] Release AddQualityScore. --- CHANGELOG | 3 + VERSION | 2 +- .../facebody/model/AddFaceResult.h | 5 + .../facebody/model/BatchAddFacesResult.h | 1 + .../facebody/model/RecognizeFaceRequest.h | 27 +++++ .../facebody/model/RecognizeFaceResult.h | 4 + .../facebody/model/SearchFaceResult.h | 5 + facebody/src/FacebodyClient.cc | 6 +- facebody/src/model/AddFaceResult.cc | 16 +++ facebody/src/model/BatchAddFacesResult.cc | 2 + facebody/src/model/RecognizeFaceRequest.cc | 99 +++++++++++++++++++ facebody/src/model/RecognizeFaceResult.cc | 14 +++ facebody/src/model/SearchFaceResult.cc | 16 +++ 13 files changed, 196 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ed2eb82c6..e0f537232 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-10-21 Version: 1.36.904 +- Release AddQualityScore. + 2021-10-21 Version: 1.36.903 - Generated 2020-05-18 for `dataworks-public`. diff --git a/VERSION b/VERSION index 3fdd4d4fc..9a0ca4955 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.903 \ No newline at end of file +1.36.904 \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/AddFaceResult.h b/facebody/include/alibabacloud/facebody/model/AddFaceResult.h index f225d899c..b1d22e09d 100644 --- a/facebody/include/alibabacloud/facebody/model/AddFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/AddFaceResult.h @@ -35,18 +35,23 @@ namespace AlibabaCloud struct Data { std::string faceId; + float qualitieScore; }; AddFaceResult(); explicit AddFaceResult(const std::string &payload); ~AddFaceResult(); + 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_; }; } diff --git a/facebody/include/alibabacloud/facebody/model/BatchAddFacesResult.h b/facebody/include/alibabacloud/facebody/model/BatchAddFacesResult.h index 9e36b72fa..f8d190158 100644 --- a/facebody/include/alibabacloud/facebody/model/BatchAddFacesResult.h +++ b/facebody/include/alibabacloud/facebody/model/BatchAddFacesResult.h @@ -37,6 +37,7 @@ namespace AlibabaCloud struct InsertedFacesItem { std::string faceId; + float qualitieScore; std::string imageURL; }; struct FailedFacesItem diff --git a/facebody/include/alibabacloud/facebody/model/RecognizeFaceRequest.h b/facebody/include/alibabacloud/facebody/model/RecognizeFaceRequest.h index 05134ce30..2d12e2b66 100644 --- a/facebody/include/alibabacloud/facebody/model/RecognizeFaceRequest.h +++ b/facebody/include/alibabacloud/facebody/model/RecognizeFaceRequest.h @@ -35,14 +35,41 @@ namespace AlibabaCloud RecognizeFaceRequest(); ~RecognizeFaceRequest(); + bool getGender()const; + void setGender(bool gender); + bool getBeauty()const; + void setBeauty(bool beauty); + long getMaxFaceNumber()const; + void setMaxFaceNumber(long maxFaceNumber); + bool getHat()const; + void setHat(bool hat); + bool getMask()const; + void setMask(bool mask); int getImageType()const; void setImageType(int imageType); + bool getGlass()const; + void setGlass(bool glass); + bool getExpression()const; + void setExpression(bool expression); + bool getQuality()const; + void setQuality(bool quality); std::string getImageURL()const; void setImageURL(const std::string& imageURL); + bool getAge()const; + void setAge(bool age); private: + bool gender_; + bool beauty_; + long maxFaceNumber_; + bool hat_; + bool mask_; int imageType_; + bool glass_; + bool expression_; + bool quality_; std::string imageURL_; + bool age_; }; } diff --git a/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h b/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h index 9301172d9..bd21a2622 100644 --- a/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/RecognizeFaceResult.h @@ -68,12 +68,16 @@ namespace AlibabaCloud RecognizeFaceResult(); explicit RecognizeFaceResult(const std::string &payload); ~RecognizeFaceResult(); + 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_; }; } diff --git a/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h b/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h index 248d65bcb..de05c963a 100644 --- a/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h +++ b/facebody/include/alibabacloud/facebody/model/SearchFaceResult.h @@ -53,6 +53,7 @@ namespace AlibabaCloud std::string extraData; }; std::vector faceItems; + float qualitieScore; Location location; }; std::vector matchList; @@ -62,12 +63,16 @@ namespace AlibabaCloud SearchFaceResult(); explicit SearchFaceResult(const std::string &payload); ~SearchFaceResult(); + 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_; }; } diff --git a/facebody/src/FacebodyClient.cc b/facebody/src/FacebodyClient.cc index ab9a9cdeb..ca6cd325f 100644 --- a/facebody/src/FacebodyClient.cc +++ b/facebody/src/FacebodyClient.cc @@ -31,21 +31,21 @@ FacebodyClient::FacebodyClient(const Credentials &credentials, const ClientConfi RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "facebody"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } FacebodyClient::FacebodyClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "facebody"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } FacebodyClient::FacebodyClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "facebody"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } FacebodyClient::~FacebodyClient() diff --git a/facebody/src/model/AddFaceResult.cc b/facebody/src/model/AddFaceResult.cc index dda3ecb88..85d744453 100644 --- a/facebody/src/model/AddFaceResult.cc +++ b/facebody/src/model/AddFaceResult.cc @@ -42,11 +42,27 @@ void AddFaceResult::parse(const std::string &payload) auto dataNode = value["Data"]; if(!dataNode["FaceId"].isNull()) data_.faceId = dataNode["FaceId"].asString(); + if(!dataNode["QualitieScore"].isNull()) + data_.qualitieScore = std::stof(dataNode["QualitieScore"].asString()); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); } +std::string AddFaceResult::getMessage()const +{ + return message_; +} + AddFaceResult::Data AddFaceResult::getData()const { return data_; } +std::string AddFaceResult::getCode()const +{ + return code_; +} + diff --git a/facebody/src/model/BatchAddFacesResult.cc b/facebody/src/model/BatchAddFacesResult.cc index 997321751..61ecc34eb 100644 --- a/facebody/src/model/BatchAddFacesResult.cc +++ b/facebody/src/model/BatchAddFacesResult.cc @@ -48,6 +48,8 @@ void BatchAddFacesResult::parse(const std::string &payload) insertedFacesItemObject.imageURL = dataNodeInsertedFacesinsertedFacesItem["ImageURL"].asString(); if(!dataNodeInsertedFacesinsertedFacesItem["FaceId"].isNull()) insertedFacesItemObject.faceId = dataNodeInsertedFacesinsertedFacesItem["FaceId"].asString(); + if(!dataNodeInsertedFacesinsertedFacesItem["QualitieScore"].isNull()) + insertedFacesItemObject.qualitieScore = std::stof(dataNodeInsertedFacesinsertedFacesItem["QualitieScore"].asString()); data_.insertedFaces.push_back(insertedFacesItemObject); } auto allFailedFacesNode = dataNode["FailedFaces"]["failedFacesItem"]; diff --git a/facebody/src/model/RecognizeFaceRequest.cc b/facebody/src/model/RecognizeFaceRequest.cc index 55272b09b..8766552fb 100644 --- a/facebody/src/model/RecognizeFaceRequest.cc +++ b/facebody/src/model/RecognizeFaceRequest.cc @@ -27,6 +27,61 @@ RecognizeFaceRequest::RecognizeFaceRequest() : RecognizeFaceRequest::~RecognizeFaceRequest() {} +bool RecognizeFaceRequest::getGender()const +{ + return gender_; +} + +void RecognizeFaceRequest::setGender(bool gender) +{ + gender_ = gender; + setBodyParameter("Gender", gender ? "true" : "false"); +} + +bool RecognizeFaceRequest::getBeauty()const +{ + return beauty_; +} + +void RecognizeFaceRequest::setBeauty(bool beauty) +{ + beauty_ = beauty; + setBodyParameter("Beauty", beauty ? "true" : "false"); +} + +long RecognizeFaceRequest::getMaxFaceNumber()const +{ + return maxFaceNumber_; +} + +void RecognizeFaceRequest::setMaxFaceNumber(long maxFaceNumber) +{ + maxFaceNumber_ = maxFaceNumber; + setBodyParameter("MaxFaceNumber", std::to_string(maxFaceNumber)); +} + +bool RecognizeFaceRequest::getHat()const +{ + return hat_; +} + +void RecognizeFaceRequest::setHat(bool hat) +{ + hat_ = hat; + setBodyParameter("Hat", hat ? "true" : "false"); +} + +bool RecognizeFaceRequest::getMask()const +{ + return mask_; +} + +void RecognizeFaceRequest::setMask(bool mask) +{ + mask_ = mask; + setBodyParameter("Mask", mask ? "true" : "false"); +} + int RecognizeFaceRequest::getImageType()const { return imageType_; @@ -38,6 +93,39 @@ void RecognizeFaceRequest::setImageType(int imageType) setBodyParameter("ImageType", std::to_string(imageType)); } +bool RecognizeFaceRequest::getGlass()const +{ + return glass_; +} + +void RecognizeFaceRequest::setGlass(bool glass) +{ + glass_ = glass; + setBodyParameter("Glass", glass ? "true" : "false"); +} + +bool RecognizeFaceRequest::getExpression()const +{ + return expression_; +} + +void RecognizeFaceRequest::setExpression(bool expression) +{ + expression_ = expression; + setBodyParameter("Expression", expression ? "true" : "false"); +} + +bool RecognizeFaceRequest::getQuality()const +{ + return quality_; +} + +void RecognizeFaceRequest::setQuality(bool quality) +{ + quality_ = quality; + setBodyParameter("Quality", quality ? "true" : "false"); +} + std::string RecognizeFaceRequest::getImageURL()const { return imageURL_; @@ -49,3 +137,14 @@ void RecognizeFaceRequest::setImageURL(const std::string& imageURL) setBodyParameter("ImageURL", imageURL); } +bool RecognizeFaceRequest::getAge()const +{ + return age_; +} + +void RecognizeFaceRequest::setAge(bool age) +{ + age_ = age; + setBodyParameter("Age", age ? "true" : "false"); +} + diff --git a/facebody/src/model/RecognizeFaceResult.cc b/facebody/src/model/RecognizeFaceResult.cc index 3eb805380..c6a4aee51 100644 --- a/facebody/src/model/RecognizeFaceResult.cc +++ b/facebody/src/model/RecognizeFaceResult.cc @@ -110,11 +110,25 @@ void RecognizeFaceResult::parse(const std::string &payload) auto allMasks = dataNode["Masks"]["Mask"]; for (auto value : allMasks) data_.masks.push_back(value.asString()); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); } +std::string RecognizeFaceResult::getMessage()const +{ + return message_; +} + RecognizeFaceResult::Data RecognizeFaceResult::getData()const { return data_; } +std::string RecognizeFaceResult::getCode()const +{ + return code_; +} + diff --git a/facebody/src/model/SearchFaceResult.cc b/facebody/src/model/SearchFaceResult.cc index c46eb4ba7..ed81be508 100644 --- a/facebody/src/model/SearchFaceResult.cc +++ b/facebody/src/model/SearchFaceResult.cc @@ -44,6 +44,8 @@ void SearchFaceResult::parse(const std::string &payload) for (auto dataNodeMatchListMatchListItem : allMatchListNode) { Data::MatchListItem matchListItemObject; + if(!dataNodeMatchListMatchListItem["QualitieScore"].isNull()) + matchListItemObject.qualitieScore = std::stof(dataNodeMatchListMatchListItem["QualitieScore"].asString()); auto allFaceItemsNode = dataNodeMatchListMatchListItem["FaceItems"]["FaceItemsItem"]; for (auto dataNodeMatchListMatchListItemFaceItemsFaceItemsItem : allFaceItemsNode) { @@ -73,11 +75,25 @@ void SearchFaceResult::parse(const std::string &payload) matchListItemObject.location.x = std::stoi(locationNode["X"].asString()); data_.matchList.push_back(matchListItemObject); } + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); } +std::string SearchFaceResult::getMessage()const +{ + return message_; +} + SearchFaceResult::Data SearchFaceResult::getData()const { return data_; } +std::string SearchFaceResult::getCode()const +{ + return code_; +} +