Update PedestrianDetectAttribute.
This commit is contained in:
@@ -28,21 +28,21 @@ namespace
|
||||
}
|
||||
|
||||
FacebodyClient::FacebodyClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "facebody");
|
||||
}
|
||||
|
||||
FacebodyClient::FacebodyClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "facebody");
|
||||
}
|
||||
|
||||
FacebodyClient::FacebodyClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "facebody");
|
||||
@@ -843,42 +843,6 @@ FacebodyClient::DetectIPCPedestrianOutcomeCallable FacebodyClient::detectIPCPede
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::DetectIPCPedestrianOptimizedOutcome FacebodyClient::detectIPCPedestrianOptimized(const DetectIPCPedestrianOptimizedRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectIPCPedestrianOptimizedOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectIPCPedestrianOptimizedOutcome(DetectIPCPedestrianOptimizedResult(outcome.result()));
|
||||
else
|
||||
return DetectIPCPedestrianOptimizedOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void FacebodyClient::detectIPCPedestrianOptimizedAsync(const DetectIPCPedestrianOptimizedRequest& request, const DetectIPCPedestrianOptimizedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectIPCPedestrianOptimized(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
FacebodyClient::DetectIPCPedestrianOptimizedOutcomeCallable FacebodyClient::detectIPCPedestrianOptimizedCallable(const DetectIPCPedestrianOptimizedRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectIPCPedestrianOptimizedOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectIPCPedestrianOptimized(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::DetectLivingFaceOutcome FacebodyClient::detectLivingFace(const DetectLivingFaceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1095,42 +1059,6 @@ FacebodyClient::EnhanceFaceOutcomeCallable FacebodyClient::enhanceFaceCallable(c
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::ExecuteServerSideVerificationOutcome FacebodyClient::executeServerSideVerification(const ExecuteServerSideVerificationRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ExecuteServerSideVerificationOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ExecuteServerSideVerificationOutcome(ExecuteServerSideVerificationResult(outcome.result()));
|
||||
else
|
||||
return ExecuteServerSideVerificationOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void FacebodyClient::executeServerSideVerificationAsync(const ExecuteServerSideVerificationRequest& request, const ExecuteServerSideVerificationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, executeServerSideVerification(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
FacebodyClient::ExecuteServerSideVerificationOutcomeCallable FacebodyClient::executeServerSideVerificationCallable(const ExecuteServerSideVerificationRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ExecuteServerSideVerificationOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->executeServerSideVerification(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::ExtractPedestrianFeatureAttrOutcome FacebodyClient::extractPedestrianFeatureAttr(const ExtractPedestrianFeatureAttrRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/facebody/model/DetectIPCPedestrianOptimizedRequest.h>
|
||||
|
||||
using AlibabaCloud::Facebody::Model::DetectIPCPedestrianOptimizedRequest;
|
||||
|
||||
DetectIPCPedestrianOptimizedRequest::DetectIPCPedestrianOptimizedRequest() :
|
||||
RoaServiceRequest("facebody", "2020-09-10")
|
||||
{
|
||||
setResourcePath("/viapi/k8s/facebody/detect-ipc-pedestrian-optimized");
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectIPCPedestrianOptimizedRequest::~DetectIPCPedestrianOptimizedRequest()
|
||||
{}
|
||||
|
||||
std::string DetectIPCPedestrianOptimizedRequest::getImageData()const
|
||||
{
|
||||
return imageData_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianOptimizedRequest::setImageData(const std::string& imageData)
|
||||
{
|
||||
imageData_ = imageData;
|
||||
setBodyParameter("ImageData", imageData);
|
||||
}
|
||||
|
||||
long DetectIPCPedestrianOptimizedRequest::getWidth()const
|
||||
{
|
||||
return width_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianOptimizedRequest::setWidth(long width)
|
||||
{
|
||||
width_ = width;
|
||||
setBodyParameter("Width", std::to_string(width));
|
||||
}
|
||||
|
||||
long DetectIPCPedestrianOptimizedRequest::getHeight()const
|
||||
{
|
||||
return height_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianOptimizedRequest::setHeight(long height)
|
||||
{
|
||||
height_ = height;
|
||||
setBodyParameter("Height", std::to_string(height));
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/facebody/model/DetectIPCPedestrianOptimizedResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Facebody;
|
||||
using namespace AlibabaCloud::Facebody::Model;
|
||||
|
||||
DetectIPCPedestrianOptimizedResult::DetectIPCPedestrianOptimizedResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectIPCPedestrianOptimizedResult::DetectIPCPedestrianOptimizedResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectIPCPedestrianOptimizedResult::~DetectIPCPedestrianOptimizedResult()
|
||||
{}
|
||||
|
||||
void DetectIPCPedestrianOptimizedResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allImageInfoListNode = dataNode["ImageInfoList"]["imageInfoListItem"];
|
||||
for (auto dataNodeImageInfoListimageInfoListItem : allImageInfoListNode)
|
||||
{
|
||||
Data::ImageInfoListItem imageInfoListItemObject;
|
||||
auto allElementsNode = dataNodeImageInfoListimageInfoListItem["Elements"]["Element"];
|
||||
for (auto dataNodeImageInfoListimageInfoListItemElementsElement : allElementsNode)
|
||||
{
|
||||
Data::ImageInfoListItem::Element elementsObject;
|
||||
if(!dataNodeImageInfoListimageInfoListItemElementsElement["Score"].isNull())
|
||||
elementsObject.score = std::stof(dataNodeImageInfoListimageInfoListItemElementsElement["Score"].asString());
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
elementsObject.boxes.push_back(value.asString());
|
||||
imageInfoListItemObject.elements.push_back(elementsObject);
|
||||
}
|
||||
data_.imageInfoList.push_back(imageInfoListItemObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectIPCPedestrianOptimizedResult::Data DetectIPCPedestrianOptimizedResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/facebody/model/ExecuteServerSideVerificationRequest.h>
|
||||
|
||||
using AlibabaCloud::Facebody::Model::ExecuteServerSideVerificationRequest;
|
||||
|
||||
ExecuteServerSideVerificationRequest::ExecuteServerSideVerificationRequest() :
|
||||
RoaServiceRequest("facebody", "2020-09-10")
|
||||
{
|
||||
setResourcePath("/viapi/thirdparty/realperson/execServerSideVerification");
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ExecuteServerSideVerificationRequest::~ExecuteServerSideVerificationRequest()
|
||||
{}
|
||||
|
||||
std::string ExecuteServerSideVerificationRequest::getFacialPictureData()const
|
||||
{
|
||||
return facialPictureData_;
|
||||
}
|
||||
|
||||
void ExecuteServerSideVerificationRequest::setFacialPictureData(const std::string& facialPictureData)
|
||||
{
|
||||
facialPictureData_ = facialPictureData;
|
||||
setBodyParameter("FacialPictureData", facialPictureData);
|
||||
}
|
||||
|
||||
std::string ExecuteServerSideVerificationRequest::getSceneType()const
|
||||
{
|
||||
return sceneType_;
|
||||
}
|
||||
|
||||
void ExecuteServerSideVerificationRequest::setSceneType(const std::string& sceneType)
|
||||
{
|
||||
sceneType_ = sceneType;
|
||||
setBodyParameter("SceneType", sceneType);
|
||||
}
|
||||
|
||||
std::string ExecuteServerSideVerificationRequest::getCertificateNumber()const
|
||||
{
|
||||
return certificateNumber_;
|
||||
}
|
||||
|
||||
void ExecuteServerSideVerificationRequest::setCertificateNumber(const std::string& certificateNumber)
|
||||
{
|
||||
certificateNumber_ = certificateNumber;
|
||||
setBodyParameter("CertificateNumber", certificateNumber);
|
||||
}
|
||||
|
||||
std::string ExecuteServerSideVerificationRequest::getCertificateName()const
|
||||
{
|
||||
return certificateName_;
|
||||
}
|
||||
|
||||
void ExecuteServerSideVerificationRequest::setCertificateName(const std::string& certificateName)
|
||||
{
|
||||
certificateName_ = certificateName;
|
||||
setBodyParameter("CertificateName", certificateName);
|
||||
}
|
||||
|
||||
std::string ExecuteServerSideVerificationRequest::getFacialPictureUrl()const
|
||||
{
|
||||
return facialPictureUrl_;
|
||||
}
|
||||
|
||||
void ExecuteServerSideVerificationRequest::setFacialPictureUrl(const std::string& facialPictureUrl)
|
||||
{
|
||||
facialPictureUrl_ = facialPictureUrl;
|
||||
setBodyParameter("FacialPictureUrl", facialPictureUrl);
|
||||
}
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/facebody/model/ExecuteServerSideVerificationResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Facebody;
|
||||
using namespace AlibabaCloud::Facebody::Model;
|
||||
|
||||
ExecuteServerSideVerificationResult::ExecuteServerSideVerificationResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ExecuteServerSideVerificationResult::ExecuteServerSideVerificationResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ExecuteServerSideVerificationResult::~ExecuteServerSideVerificationResult()
|
||||
{}
|
||||
|
||||
void ExecuteServerSideVerificationResult::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["VerificationToken"].isNull())
|
||||
data_.verificationToken = dataNode["VerificationToken"].asString();
|
||||
if(!dataNode["Pass"].isNull())
|
||||
data_.pass = dataNode["Pass"].asString() == "true";
|
||||
if(!dataNode["Reason"].isNull())
|
||||
data_.reason = dataNode["Reason"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ExecuteServerSideVerificationResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ExecuteServerSideVerificationResult::Data ExecuteServerSideVerificationResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string ExecuteServerSideVerificationResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@ 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());
|
||||
auto allAttributesNode = dataNode["Attributes"]["AttributesItem"];
|
||||
for (auto dataNodeAttributesAttributesItem : allAttributesNode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user