Update MergeImageFace.

This commit is contained in:
sdk-team
2023-10-10 07:09:46 +00:00
parent bb8790e63c
commit 84ae3ef04e
20 changed files with 16 additions and 964 deletions

View File

@@ -375,42 +375,6 @@ FacebodyClient::CompareFaceWithMaskOutcomeCallable FacebodyClient::compareFaceWi
return task->get_future();
}
FacebodyClient::CountCrowdOutcome FacebodyClient::countCrowd(const CountCrowdRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CountCrowdOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CountCrowdOutcome(CountCrowdResult(outcome.result()));
else
return CountCrowdOutcome(outcome.error());
}
void FacebodyClient::countCrowdAsync(const CountCrowdRequest& request, const CountCrowdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, countCrowd(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::CountCrowdOutcomeCallable FacebodyClient::countCrowdCallable(const CountCrowdRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CountCrowdOutcome()>>(
[this, request]()
{
return this->countCrowd(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::CreateFaceDbOutcome FacebodyClient::createFaceDb(const CreateFaceDbRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -735,42 +699,6 @@ FacebodyClient::DetectFaceOutcomeCallable FacebodyClient::detectFaceCallable(con
return task->get_future();
}
FacebodyClient::DetectIPCPedestrianOutcome FacebodyClient::detectIPCPedestrian(const DetectIPCPedestrianRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectIPCPedestrianOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectIPCPedestrianOutcome(DetectIPCPedestrianResult(outcome.result()));
else
return DetectIPCPedestrianOutcome(outcome.error());
}
void FacebodyClient::detectIPCPedestrianAsync(const DetectIPCPedestrianRequest& request, const DetectIPCPedestrianAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectIPCPedestrian(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::DetectIPCPedestrianOutcomeCallable FacebodyClient::detectIPCPedestrianCallable(const DetectIPCPedestrianRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectIPCPedestrianOutcome()>>(
[this, request]()
{
return this->detectIPCPedestrian(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::DetectInfraredLivingFaceOutcome FacebodyClient::detectInfraredLivingFace(const DetectInfraredLivingFaceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1959,42 +1887,6 @@ FacebodyClient::SearchFaceOutcomeCallable FacebodyClient::searchFaceCallable(con
return task->get_future();
}
FacebodyClient::SwapFacialFeaturesOutcome FacebodyClient::swapFacialFeatures(const SwapFacialFeaturesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SwapFacialFeaturesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SwapFacialFeaturesOutcome(SwapFacialFeaturesResult(outcome.result()));
else
return SwapFacialFeaturesOutcome(outcome.error());
}
void FacebodyClient::swapFacialFeaturesAsync(const SwapFacialFeaturesRequest& request, const SwapFacialFeaturesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, swapFacialFeatures(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::SwapFacialFeaturesOutcomeCallable FacebodyClient::swapFacialFeaturesCallable(const SwapFacialFeaturesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SwapFacialFeaturesOutcome()>>(
[this, request]()
{
return this->swapFacialFeatures(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::UpdateFaceEntityOutcome FacebodyClient::updateFaceEntity(const UpdateFaceEntityRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -42,6 +42,8 @@ void BlurFaceResult::parse(const std::string &payload)
auto dataNode = value["Data"];
if(!dataNode["ImageURL"].isNull())
data_.imageURL = dataNode["ImageURL"].asString();
if(!dataNode["MaskURL"].isNull())
data_.maskURL = dataNode["MaskURL"].asString();
}

View File

@@ -1,72 +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/CountCrowdRequest.h>
using AlibabaCloud::Facebody::Model::CountCrowdRequest;
CountCrowdRequest::CountCrowdRequest()
: RpcServiceRequest("facebody", "2019-12-30", "CountCrowd") {
setMethod(HttpRequest::Method::Post);
}
CountCrowdRequest::~CountCrowdRequest() {}
bool CountCrowdRequest::getFormatResultToJson() const {
return formatResultToJson_;
}
void CountCrowdRequest::setFormatResultToJson(bool formatResultToJson) {
formatResultToJson_ = formatResultToJson;
setParameter(std::string("FormatResultToJson"), formatResultToJson ? "true" : "false");
}
bool CountCrowdRequest::getIsShow() const {
return isShow_;
}
void CountCrowdRequest::setIsShow(bool isShow) {
isShow_ = isShow;
setBodyParameter(std::string("IsShow"), isShow ? "true" : "false");
}
std::string CountCrowdRequest::getOssFile() const {
return ossFile_;
}
void CountCrowdRequest::setOssFile(const std::string &ossFile) {
ossFile_ = ossFile;
setParameter(std::string("OssFile"), ossFile);
}
std::string CountCrowdRequest::getRequestProxyBy() const {
return requestProxyBy_;
}
void CountCrowdRequest::setRequestProxyBy(const std::string &requestProxyBy) {
requestProxyBy_ = requestProxyBy;
setParameter(std::string("RequestProxyBy"), requestProxyBy);
}
std::string CountCrowdRequest::getImageURL() const {
return imageURL_;
}
void CountCrowdRequest::setImageURL(const std::string &imageURL) {
imageURL_ = imageURL;
setBodyParameter(std::string("ImageURL"), imageURL);
}

View File

@@ -1,54 +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/CountCrowdResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
CountCrowdResult::CountCrowdResult() :
ServiceResult()
{}
CountCrowdResult::CountCrowdResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CountCrowdResult::~CountCrowdResult()
{}
void CountCrowdResult::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["PeopleNumber"].isNull())
data_.peopleNumber = std::stoi(dataNode["PeopleNumber"].asString());
if(!dataNode["HotMap"].isNull())
data_.hotMap = dataNode["HotMap"].asString();
}
CountCrowdResult::Data CountCrowdResult::getData()const
{
return data_;
}

View File

@@ -1,108 +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/DetectIPCPedestrianRequest.h>
using AlibabaCloud::Facebody::Model::DetectIPCPedestrianRequest;
DetectIPCPedestrianRequest::DetectIPCPedestrianRequest()
: RpcServiceRequest("facebody", "2019-12-30", "DetectIPCPedestrian") {
setMethod(HttpRequest::Method::Post);
}
DetectIPCPedestrianRequest::~DetectIPCPedestrianRequest() {}
bool DetectIPCPedestrianRequest::getFormatResultToJson() const {
return formatResultToJson_;
}
void DetectIPCPedestrianRequest::setFormatResultToJson(bool formatResultToJson) {
formatResultToJson_ = formatResultToJson;
setParameter(std::string("FormatResultToJson"), formatResultToJson ? "true" : "false");
}
bool DetectIPCPedestrianRequest::getContinueOnError() const {
return continueOnError_;
}
void DetectIPCPedestrianRequest::setContinueOnError(bool continueOnError) {
continueOnError_ = continueOnError;
setBodyParameter(std::string("ContinueOnError"), continueOnError ? "true" : "false");
}
std::string DetectIPCPedestrianRequest::getOssFile() const {
return ossFile_;
}
void DetectIPCPedestrianRequest::setOssFile(const std::string &ossFile) {
ossFile_ = ossFile;
setParameter(std::string("OssFile"), ossFile);
}
int DetectIPCPedestrianRequest::getHeight() const {
return height_;
}
void DetectIPCPedestrianRequest::setHeight(int height) {
height_ = height;
setBodyParameter(std::string("Height"), std::to_string(height));
}
std::string DetectIPCPedestrianRequest::getImageData() const {
return imageData_;
}
void DetectIPCPedestrianRequest::setImageData(const std::string &imageData) {
imageData_ = imageData;
setBodyParameter(std::string("ImageData"), imageData);
}
std::string DetectIPCPedestrianRequest::getRequestProxyBy() const {
return requestProxyBy_;
}
void DetectIPCPedestrianRequest::setRequestProxyBy(const std::string &requestProxyBy) {
requestProxyBy_ = requestProxyBy;
setParameter(std::string("RequestProxyBy"), requestProxyBy);
}
std::string DetectIPCPedestrianRequest::getDataId() const {
return dataId_;
}
void DetectIPCPedestrianRequest::setDataId(const std::string &dataId) {
dataId_ = dataId;
setBodyParameter(std::string("DataId"), dataId);
}
std::string DetectIPCPedestrianRequest::getImageURL() const {
return imageURL_;
}
void DetectIPCPedestrianRequest::setImageURL(const std::string &imageURL) {
imageURL_ = imageURL;
setBodyParameter(std::string("ImageURL"), imageURL);
}
int DetectIPCPedestrianRequest::getWidth() const {
return width_;
}
void DetectIPCPedestrianRequest::setWidth(int width) {
width_ = width;
setBodyParameter(std::string("Width"), std::to_string(width));
}

View File

@@ -1,73 +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/DetectIPCPedestrianResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
DetectIPCPedestrianResult::DetectIPCPedestrianResult() :
ServiceResult()
{}
DetectIPCPedestrianResult::DetectIPCPedestrianResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectIPCPedestrianResult::~DetectIPCPedestrianResult()
{}
void DetectIPCPedestrianResult::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;
if(!dataNodeImageInfoListImageInfoListItem["ErrorMessage"].isNull())
imageInfoListItemObject.errorMessage = dataNodeImageInfoListImageInfoListItem["ErrorMessage"].asString();
if(!dataNodeImageInfoListImageInfoListItem["ErrorCode"].isNull())
imageInfoListItemObject.errorCode = dataNodeImageInfoListImageInfoListItem["ErrorCode"].asString();
if(!dataNodeImageInfoListImageInfoListItem["DataId"].isNull())
imageInfoListItemObject.dataId = dataNodeImageInfoListImageInfoListItem["DataId"].asString();
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);
}
}
DetectIPCPedestrianResult::Data DetectIPCPedestrianResult::getData()const
{
return data_;
}

View File

@@ -57,6 +57,15 @@ void MergeImageFaceRequest::setUserId(const std::string &userId) {
setBodyParameter(std::string("UserId"), userId);
}
std::string MergeImageFaceRequest::getWatermarkType() const {
return watermarkType_;
}
void MergeImageFaceRequest::setWatermarkType(const std::string &watermarkType) {
watermarkType_ = watermarkType;
setBodyParameter(std::string("WatermarkType"), watermarkType);
}
std::string MergeImageFaceRequest::getOssFile() const {
return ossFile_;
}

View File

@@ -1,99 +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/SwapFacialFeaturesRequest.h>
using AlibabaCloud::Facebody::Model::SwapFacialFeaturesRequest;
SwapFacialFeaturesRequest::SwapFacialFeaturesRequest()
: RpcServiceRequest("facebody", "2019-12-30", "SwapFacialFeatures") {
setMethod(HttpRequest::Method::Post);
}
SwapFacialFeaturesRequest::~SwapFacialFeaturesRequest() {}
std::string SwapFacialFeaturesRequest::getTargetImageURL() const {
return targetImageURL_;
}
void SwapFacialFeaturesRequest::setTargetImageURL(const std::string &targetImageURL) {
targetImageURL_ = targetImageURL;
setBodyParameter(std::string("TargetImageURL"), targetImageURL);
}
bool SwapFacialFeaturesRequest::getFormatResultToJson() const {
return formatResultToJson_;
}
void SwapFacialFeaturesRequest::setFormatResultToJson(bool formatResultToJson) {
formatResultToJson_ = formatResultToJson;
setParameter(std::string("FormatResultToJson"), formatResultToJson ? "true" : "false");
}
std::string SwapFacialFeaturesRequest::getSourceImageData() const {
return sourceImageData_;
}
void SwapFacialFeaturesRequest::setSourceImageData(const std::string &sourceImageData) {
sourceImageData_ = sourceImageData;
setBodyParameter(std::string("SourceImageData"), sourceImageData);
}
std::string SwapFacialFeaturesRequest::getOssFile() const {
return ossFile_;
}
void SwapFacialFeaturesRequest::setOssFile(const std::string &ossFile) {
ossFile_ = ossFile;
setParameter(std::string("OssFile"), ossFile);
}
std::string SwapFacialFeaturesRequest::getSourceImageURL() const {
return sourceImageURL_;
}
void SwapFacialFeaturesRequest::setSourceImageURL(const std::string &sourceImageURL) {
sourceImageURL_ = sourceImageURL;
setBodyParameter(std::string("SourceImageURL"), sourceImageURL);
}
std::string SwapFacialFeaturesRequest::getTargetImageData() const {
return targetImageData_;
}
void SwapFacialFeaturesRequest::setTargetImageData(const std::string &targetImageData) {
targetImageData_ = targetImageData;
setBodyParameter(std::string("TargetImageData"), targetImageData);
}
std::string SwapFacialFeaturesRequest::getRequestProxyBy() const {
return requestProxyBy_;
}
void SwapFacialFeaturesRequest::setRequestProxyBy(const std::string &requestProxyBy) {
requestProxyBy_ = requestProxyBy;
setParameter(std::string("RequestProxyBy"), requestProxyBy);
}
std::string SwapFacialFeaturesRequest::getEditPart() const {
return editPart_;
}
void SwapFacialFeaturesRequest::setEditPart(const std::string &editPart) {
editPart_ = editPart;
setBodyParameter(std::string("EditPart"), editPart);
}

View File

@@ -1,52 +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/SwapFacialFeaturesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
SwapFacialFeaturesResult::SwapFacialFeaturesResult() :
ServiceResult()
{}
SwapFacialFeaturesResult::SwapFacialFeaturesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SwapFacialFeaturesResult::~SwapFacialFeaturesResult()
{}
void SwapFacialFeaturesResult::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["ImageURL"].isNull())
data_.imageURL = dataNode["ImageURL"].asString();
}
SwapFacialFeaturesResult::Data SwapFacialFeaturesResult::getData()const
{
return data_;
}