Supported Api DetectIPCPedestrian.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2020-08-14 Version: 1.36.583
|
||||
- Supported Api DetectIPCPedestrian.
|
||||
|
||||
2020-08-14 Version: 1.36.582
|
||||
- Supported CheckCloudResourceAuthorized API.
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ set(facebody_public_header_model
|
||||
include/alibabacloud/facebody/model/AddFaceResult.h
|
||||
include/alibabacloud/facebody/model/AddFaceEntityRequest.h
|
||||
include/alibabacloud/facebody/model/AddFaceEntityResult.h
|
||||
include/alibabacloud/facebody/model/BlurFaceRequest.h
|
||||
include/alibabacloud/facebody/model/BlurFaceResult.h
|
||||
include/alibabacloud/facebody/model/BodyPostureRequest.h
|
||||
include/alibabacloud/facebody/model/BodyPostureResult.h
|
||||
include/alibabacloud/facebody/model/CompareFaceRequest.h
|
||||
@@ -43,6 +45,8 @@ set(facebody_public_header_model
|
||||
include/alibabacloud/facebody/model/DetectCelebrityResult.h
|
||||
include/alibabacloud/facebody/model/DetectFaceRequest.h
|
||||
include/alibabacloud/facebody/model/DetectFaceResult.h
|
||||
include/alibabacloud/facebody/model/DetectIPCPedestrianRequest.h
|
||||
include/alibabacloud/facebody/model/DetectIPCPedestrianResult.h
|
||||
include/alibabacloud/facebody/model/DetectLivingFaceRequest.h
|
||||
include/alibabacloud/facebody/model/DetectLivingFaceResult.h
|
||||
include/alibabacloud/facebody/model/DetectMaskRequest.h
|
||||
@@ -94,6 +98,8 @@ set(facebody_src
|
||||
src/model/AddFaceResult.cc
|
||||
src/model/AddFaceEntityRequest.cc
|
||||
src/model/AddFaceEntityResult.cc
|
||||
src/model/BlurFaceRequest.cc
|
||||
src/model/BlurFaceResult.cc
|
||||
src/model/BodyPostureRequest.cc
|
||||
src/model/BodyPostureResult.cc
|
||||
src/model/CompareFaceRequest.cc
|
||||
@@ -112,6 +118,8 @@ set(facebody_src
|
||||
src/model/DetectCelebrityResult.cc
|
||||
src/model/DetectFaceRequest.cc
|
||||
src/model/DetectFaceResult.cc
|
||||
src/model/DetectIPCPedestrianRequest.cc
|
||||
src/model/DetectIPCPedestrianResult.cc
|
||||
src/model/DetectLivingFaceRequest.cc
|
||||
src/model/DetectLivingFaceResult.cc
|
||||
src/model/DetectMaskRequest.cc
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "model/AddFaceResult.h"
|
||||
#include "model/AddFaceEntityRequest.h"
|
||||
#include "model/AddFaceEntityResult.h"
|
||||
#include "model/BlurFaceRequest.h"
|
||||
#include "model/BlurFaceResult.h"
|
||||
#include "model/BodyPostureRequest.h"
|
||||
#include "model/BodyPostureResult.h"
|
||||
#include "model/CompareFaceRequest.h"
|
||||
@@ -44,6 +46,8 @@
|
||||
#include "model/DetectCelebrityResult.h"
|
||||
#include "model/DetectFaceRequest.h"
|
||||
#include "model/DetectFaceResult.h"
|
||||
#include "model/DetectIPCPedestrianRequest.h"
|
||||
#include "model/DetectIPCPedestrianResult.h"
|
||||
#include "model/DetectLivingFaceRequest.h"
|
||||
#include "model/DetectLivingFaceResult.h"
|
||||
#include "model/DetectMaskRequest.h"
|
||||
@@ -103,6 +107,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::AddFaceEntityResult> AddFaceEntityOutcome;
|
||||
typedef std::future<AddFaceEntityOutcome> AddFaceEntityOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::AddFaceEntityRequest&, const AddFaceEntityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AddFaceEntityAsyncHandler;
|
||||
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;
|
||||
typedef Outcome<Error, Model::BodyPostureResult> BodyPostureOutcome;
|
||||
typedef std::future<BodyPostureOutcome> BodyPostureOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::BodyPostureRequest&, const BodyPostureOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BodyPostureAsyncHandler;
|
||||
@@ -130,6 +137,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::DetectFaceResult> DetectFaceOutcome;
|
||||
typedef std::future<DetectFaceOutcome> DetectFaceOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::DetectFaceRequest&, const DetectFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectFaceAsyncHandler;
|
||||
typedef Outcome<Error, Model::DetectIPCPedestrianResult> DetectIPCPedestrianOutcome;
|
||||
typedef std::future<DetectIPCPedestrianOutcome> DetectIPCPedestrianOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::DetectIPCPedestrianRequest&, const DetectIPCPedestrianOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectIPCPedestrianAsyncHandler;
|
||||
typedef Outcome<Error, Model::DetectLivingFaceResult> DetectLivingFaceOutcome;
|
||||
typedef std::future<DetectLivingFaceOutcome> DetectLivingFaceOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::DetectLivingFaceRequest&, const DetectLivingFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectLivingFaceAsyncHandler;
|
||||
@@ -207,6 +217,9 @@ namespace AlibabaCloud
|
||||
AddFaceEntityOutcome addFaceEntity(const Model::AddFaceEntityRequest &request)const;
|
||||
void addFaceEntityAsync(const Model::AddFaceEntityRequest& request, const AddFaceEntityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
AddFaceEntityOutcomeCallable addFaceEntityCallable(const Model::AddFaceEntityRequest& 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;
|
||||
BodyPostureOutcome bodyPosture(const Model::BodyPostureRequest &request)const;
|
||||
void bodyPostureAsync(const Model::BodyPostureRequest& request, const BodyPostureAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BodyPostureOutcomeCallable bodyPostureCallable(const Model::BodyPostureRequest& request) const;
|
||||
@@ -234,6 +247,9 @@ namespace AlibabaCloud
|
||||
DetectFaceOutcome detectFace(const Model::DetectFaceRequest &request)const;
|
||||
void detectFaceAsync(const Model::DetectFaceRequest& request, const DetectFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DetectFaceOutcomeCallable detectFaceCallable(const Model::DetectFaceRequest& request) const;
|
||||
DetectIPCPedestrianOutcome detectIPCPedestrian(const Model::DetectIPCPedestrianRequest &request)const;
|
||||
void detectIPCPedestrianAsync(const Model::DetectIPCPedestrianRequest& request, const DetectIPCPedestrianAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DetectIPCPedestrianOutcomeCallable detectIPCPedestrianCallable(const Model::DetectIPCPedestrianRequest& request) const;
|
||||
DetectLivingFaceOutcome detectLivingFace(const Model::DetectLivingFaceRequest &request)const;
|
||||
void detectLivingFaceAsync(const Model::DetectLivingFaceRequest& request, const DetectLivingFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DetectLivingFaceOutcomeCallable detectLivingFaceCallable(const Model::DetectLivingFaceRequest& request) const;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_BLURFACEREQUEST_H_
|
||||
#define ALIBABACLOUD_FACEBODY_MODEL_BLURFACEREQUEST_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 BlurFaceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
BlurFaceRequest();
|
||||
~BlurFaceRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_BLURFACEREQUEST_H_
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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_BLURFACERESULT_H_
|
||||
#define ALIBABACLOUD_FACEBODY_MODEL_BLURFACERESULT_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 BlurFaceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string imageURL;
|
||||
};
|
||||
|
||||
|
||||
BlurFaceResult();
|
||||
explicit BlurFaceResult(const std::string &payload);
|
||||
~BlurFaceResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_BLURFACERESULT_H_
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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_DETECTIPCPEDESTRIANREQUEST_H_
|
||||
#define ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANREQUEST_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 DetectIPCPedestrianRequest : public RpcServiceRequest
|
||||
{
|
||||
public:
|
||||
struct URLList
|
||||
{
|
||||
std::string dataId;
|
||||
std::string imageURL;
|
||||
};
|
||||
|
||||
public:
|
||||
DetectIPCPedestrianRequest();
|
||||
~DetectIPCPedestrianRequest();
|
||||
|
||||
std::string getImageData()const;
|
||||
void setImageData(const std::string& imageData);
|
||||
std::vector<URLList> getURLList()const;
|
||||
void setURLList(const std::vector<URLList>& uRLList);
|
||||
bool getContinueOnError()const;
|
||||
void setContinueOnError(bool continueOnError);
|
||||
int getWidth()const;
|
||||
void setWidth(int width);
|
||||
int getHeight()const;
|
||||
void setHeight(int height);
|
||||
|
||||
private:
|
||||
std::string imageData_;
|
||||
std::vector<URLList> uRLList_;
|
||||
bool continueOnError_;
|
||||
int width_;
|
||||
int height_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANREQUEST_H_
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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_DETECTIPCPEDESTRIANRESULT_H_
|
||||
#define ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANRESULT_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 DetectIPCPedestrianResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct ImageInfoListItem
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
float score;
|
||||
std::vector<std::string> boxes;
|
||||
};
|
||||
std::string dataId;
|
||||
std::string errorCode;
|
||||
std::vector<ImageInfoListItem::Element> elements;
|
||||
std::string errorMessage;
|
||||
};
|
||||
std::vector<ImageInfoListItem> imageInfoList;
|
||||
};
|
||||
|
||||
|
||||
DetectIPCPedestrianResult();
|
||||
explicit DetectIPCPedestrianResult(const std::string &payload);
|
||||
~DetectIPCPedestrianResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_DETECTIPCPEDESTRIANRESULT_H_
|
||||
@@ -31,21 +31,21 @@ FacebodyClient::FacebodyClient(const Credentials &credentials, const ClientConfi
|
||||
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");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
FacebodyClient::FacebodyClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & 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");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
FacebodyClient::FacebodyClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & 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");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
FacebodyClient::~FacebodyClient()
|
||||
@@ -123,6 +123,42 @@ FacebodyClient::AddFaceEntityOutcomeCallable FacebodyClient::addFaceEntityCallab
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::BlurFaceOutcome FacebodyClient::blurFace(const BlurFaceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return BlurFaceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return BlurFaceOutcome(BlurFaceResult(outcome.result()));
|
||||
else
|
||||
return BlurFaceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void FacebodyClient::blurFaceAsync(const BlurFaceRequest& request, const BlurFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, blurFace(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
FacebodyClient::BlurFaceOutcomeCallable FacebodyClient::blurFaceCallable(const BlurFaceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<BlurFaceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->blurFace(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::BodyPostureOutcome FacebodyClient::bodyPosture(const BodyPostureRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -447,6 +483,42 @@ 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::DetectLivingFaceOutcome FacebodyClient::detectLivingFace(const DetectLivingFaceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
40
facebody/src/model/BlurFaceRequest.cc
Normal file
40
facebody/src/model/BlurFaceRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/BlurFaceRequest.h>
|
||||
|
||||
using AlibabaCloud::Facebody::Model::BlurFaceRequest;
|
||||
|
||||
BlurFaceRequest::BlurFaceRequest() :
|
||||
RpcServiceRequest("facebody", "2019-12-30", "BlurFace")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
BlurFaceRequest::~BlurFaceRequest()
|
||||
{}
|
||||
|
||||
std::string BlurFaceRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void BlurFaceRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
52
facebody/src/model/BlurFaceResult.cc
Normal file
52
facebody/src/model/BlurFaceResult.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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/BlurFaceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Facebody;
|
||||
using namespace AlibabaCloud::Facebody::Model;
|
||||
|
||||
BlurFaceResult::BlurFaceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
BlurFaceResult::BlurFaceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
BlurFaceResult::~BlurFaceResult()
|
||||
{}
|
||||
|
||||
void BlurFaceResult::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();
|
||||
|
||||
}
|
||||
|
||||
BlurFaceResult::Data BlurFaceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
89
facebody/src/model/DetectIPCPedestrianRequest.cc
Normal file
89
facebody/src/model/DetectIPCPedestrianRequest.cc
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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()
|
||||
{}
|
||||
|
||||
std::string DetectIPCPedestrianRequest::getImageData()const
|
||||
{
|
||||
return imageData_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianRequest::setImageData(const std::string& imageData)
|
||||
{
|
||||
imageData_ = imageData;
|
||||
setBodyParameter("ImageData", imageData);
|
||||
}
|
||||
|
||||
std::vector<DetectIPCPedestrianRequest::URLList> DetectIPCPedestrianRequest::getURLList()const
|
||||
{
|
||||
return uRLList_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianRequest::setURLList(const std::vector<URLList>& uRLList)
|
||||
{
|
||||
uRLList_ = uRLList;
|
||||
for(int dep1 = 0; dep1!= uRLList.size(); dep1++) {
|
||||
auto uRLListObj = uRLList.at(dep1);
|
||||
std::string uRLListObjStr = "URLList." + std::to_string(dep1 + 1);
|
||||
setParameter(uRLListObjStr + ".DataId", uRLListObj.dataId);
|
||||
setParameter(uRLListObjStr + ".ImageURL", uRLListObj.imageURL);
|
||||
}
|
||||
}
|
||||
|
||||
bool DetectIPCPedestrianRequest::getContinueOnError()const
|
||||
{
|
||||
return continueOnError_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianRequest::setContinueOnError(bool continueOnError)
|
||||
{
|
||||
continueOnError_ = continueOnError;
|
||||
setBodyParameter("ContinueOnError", continueOnError ? "true" : "false");
|
||||
}
|
||||
|
||||
int DetectIPCPedestrianRequest::getWidth()const
|
||||
{
|
||||
return width_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianRequest::setWidth(int width)
|
||||
{
|
||||
width_ = width;
|
||||
setBodyParameter("Width", std::to_string(width));
|
||||
}
|
||||
|
||||
int DetectIPCPedestrianRequest::getHeight()const
|
||||
{
|
||||
return height_;
|
||||
}
|
||||
|
||||
void DetectIPCPedestrianRequest::setHeight(int height)
|
||||
{
|
||||
height_ = height;
|
||||
setBodyParameter("Height", std::to_string(height));
|
||||
}
|
||||
|
||||
73
facebody/src/model/DetectIPCPedestrianResult.cc
Normal file
73
facebody/src/model/DetectIPCPedestrianResult.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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["ErrorCode"].isNull())
|
||||
imageInfoListItemObject.errorCode = dataNodeImageInfoListImageInfoListItem["ErrorCode"].asString();
|
||||
if(!dataNodeImageInfoListImageInfoListItem["ErrorMessage"].isNull())
|
||||
imageInfoListItemObject.errorMessage = dataNodeImageInfoListImageInfoListItem["ErrorMessage"].asString();
|
||||
if(!dataNodeImageInfoListImageInfoListItem["DataId"].isNull())
|
||||
imageInfoListItemObject.dataId = dataNodeImageInfoListImageInfoListItem["DataId"].asString();
|
||||
auto allElementsNode = allImageInfoListNode["Elements"]["Element"];
|
||||
for (auto allImageInfoListNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::ImageInfoListItem::Element elementsObject;
|
||||
if(!allImageInfoListNodeElementsElement["Score"].isNull())
|
||||
elementsObject.score = std::stof(allImageInfoListNodeElementsElement["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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user