Release BeautifyBody.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2021-08-19 Version: 1.36.853
|
||||
- Release BeautifyBody.
|
||||
|
||||
2021-08-13 Version: 1.36.852
|
||||
- Supported etlOperatorColumnReference for ModifyDtsJob.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<Error, Model::AddFaceImageTemplateResult> AddFaceImageTemplateOutcome;
|
||||
typedef std::future<AddFaceImageTemplateOutcome> AddFaceImageTemplateOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::AddFaceImageTemplateRequest&, const AddFaceImageTemplateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AddFaceImageTemplateAsyncHandler;
|
||||
typedef Outcome<Error, Model::BeautifyBodyResult> BeautifyBodyOutcome;
|
||||
typedef std::future<BeautifyBodyOutcome> BeautifyBodyOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::BeautifyBodyRequest&, const BeautifyBodyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BeautifyBodyAsyncHandler;
|
||||
typedef Outcome<Error, Model::BlurFaceResult> BlurFaceOutcome;
|
||||
typedef std::future<BlurFaceOutcome> BlurFaceOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::BlurFaceRequest&, const BlurFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
|
||||
BlurFaceOutcomeCallable blurFaceCallable(const Model::BlurFaceRequest& request) const;
|
||||
|
||||
@@ -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 <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/facebody/FacebodyExport.h>
|
||||
|
||||
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_
|
||||
@@ -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 <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 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_
|
||||
@@ -34,8 +34,8 @@ namespace AlibabaCloud
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string messageTips;
|
||||
float qualityScoreA;
|
||||
std::string messageTips;
|
||||
float qualityScoreB;
|
||||
std::vector<std::string> thresholds;
|
||||
float confidence;
|
||||
|
||||
@@ -36,12 +36,12 @@ namespace AlibabaCloud
|
||||
{
|
||||
struct Qualities
|
||||
{
|
||||
std::vector<std::string> noiseList;
|
||||
std::vector<std::string> scoreList;
|
||||
std::vector<std::string> noiseList;
|
||||
std::vector<std::string> blurList;
|
||||
std::vector<std::string> maskList;
|
||||
std::vector<std::string> glassList;
|
||||
std::vector<std::string> fnfList;
|
||||
std::vector<std::string> glassList;
|
||||
std::vector<std::string> maskList;
|
||||
std::vector<std::string> poseList1;
|
||||
std::vector<std::string> illuList;
|
||||
};
|
||||
@@ -51,8 +51,8 @@ namespace AlibabaCloud
|
||||
std::vector<std::string> landmarks;
|
||||
Qualities qualities;
|
||||
int faceCount;
|
||||
std::vector<std::string> poseList;
|
||||
std::vector<std::string> pupils;
|
||||
std::vector<std::string> poseList;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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_;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -36,12 +36,12 @@ namespace AlibabaCloud
|
||||
{
|
||||
struct Qualities
|
||||
{
|
||||
std::vector<std::string> noiseList;
|
||||
std::vector<std::string> scoreList;
|
||||
std::vector<std::string> noiseList;
|
||||
std::vector<std::string> blurList;
|
||||
std::vector<std::string> maskList;
|
||||
std::vector<std::string> glassList;
|
||||
std::vector<std::string> fnfList;
|
||||
std::vector<std::string> glassList;
|
||||
std::vector<std::string> maskList;
|
||||
std::vector<std::string> poseList1;
|
||||
std::vector<std::string> illuList;
|
||||
};
|
||||
@@ -49,10 +49,10 @@ namespace AlibabaCloud
|
||||
std::vector<std::string> faceRectangles;
|
||||
Qualities qualities;
|
||||
int denseFeatureLength;
|
||||
std::vector<std::string> masks;
|
||||
std::vector<std::string> poseList;
|
||||
std::vector<std::string> genderList;
|
||||
std::vector<std::string> pupils;
|
||||
std::vector<std::string> genderList;
|
||||
std::vector<std::string> poseList;
|
||||
std::vector<std::string> masks;
|
||||
std::vector<std::string> denseFeatures;
|
||||
std::vector<std::string> faceProbabilityList;
|
||||
std::vector<std::string> hatList;
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace AlibabaCloud
|
||||
std::string name;
|
||||
};
|
||||
float w;
|
||||
float x;
|
||||
float h;
|
||||
float x;
|
||||
float y;
|
||||
std::vector<SubResult::Face> faces;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<const AsyncCallerContext>& 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<std::packaged_task<BeautifyBodyOutcome()>>(
|
||||
[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();
|
||||
|
||||
150
facebody/src/model/BeautifyBodyRequest.cc
Normal file
150
facebody/src/model/BeautifyBodyRequest.cc
Normal file
@@ -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 <alibabacloud/facebody/model/BeautifyBodyRequest.h>
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
70
facebody/src/model/BeautifyBodyResult.cc
Normal file
70
facebody/src/model/BeautifyBodyResult.cc
Normal file
@@ -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 <alibabacloud/facebody/model/BeautifyBodyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user