Release RecognizeHandGesture.

This commit is contained in:
sdk-team
2021-03-04 10:08:57 +00:00
parent fa0a602cf6
commit 14ab21ae79
10 changed files with 309 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2021-03-04 Version: patch
- Release RecognizeHandGesture.
2021-03-04 Version: patch
- Update Ocr.

File diff suppressed because one or more lines are too long

View File

@@ -123,6 +123,8 @@ set(facebody_public_header_model
include/alibabacloud/facebody/model/RecognizeExpressionResult.h
include/alibabacloud/facebody/model/RecognizeFaceRequest.h
include/alibabacloud/facebody/model/RecognizeFaceResult.h
include/alibabacloud/facebody/model/RecognizeHandGestureRequest.h
include/alibabacloud/facebody/model/RecognizeHandGestureResult.h
include/alibabacloud/facebody/model/RecognizePublicFaceRequest.h
include/alibabacloud/facebody/model/RecognizePublicFaceResult.h
include/alibabacloud/facebody/model/SearchBodyTraceRequest.h
@@ -240,6 +242,8 @@ set(facebody_src
src/model/RecognizeExpressionResult.cc
src/model/RecognizeFaceRequest.cc
src/model/RecognizeFaceResult.cc
src/model/RecognizeHandGestureRequest.cc
src/model/RecognizeHandGestureResult.cc
src/model/RecognizePublicFaceRequest.cc
src/model/RecognizePublicFaceResult.cc
src/model/SearchBodyTraceRequest.cc

View File

@@ -124,6 +124,8 @@
#include "model/RecognizeExpressionResult.h"
#include "model/RecognizeFaceRequest.h"
#include "model/RecognizeFaceResult.h"
#include "model/RecognizeHandGestureRequest.h"
#include "model/RecognizeHandGestureResult.h"
#include "model/RecognizePublicFaceRequest.h"
#include "model/RecognizePublicFaceResult.h"
#include "model/SearchBodyTraceRequest.h"
@@ -298,6 +300,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::RecognizeFaceResult> RecognizeFaceOutcome;
typedef std::future<RecognizeFaceOutcome> RecognizeFaceOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::RecognizeFaceRequest&, const RecognizeFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeFaceAsyncHandler;
typedef Outcome<Error, Model::RecognizeHandGestureResult> RecognizeHandGestureOutcome;
typedef std::future<RecognizeHandGestureOutcome> RecognizeHandGestureOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::RecognizeHandGestureRequest&, const RecognizeHandGestureOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeHandGestureAsyncHandler;
typedef Outcome<Error, Model::RecognizePublicFaceResult> RecognizePublicFaceOutcome;
typedef std::future<RecognizePublicFaceOutcome> RecognizePublicFaceOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::RecognizePublicFaceRequest&, const RecognizePublicFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizePublicFaceAsyncHandler;
@@ -474,6 +479,9 @@ namespace AlibabaCloud
RecognizeFaceOutcome recognizeFace(const Model::RecognizeFaceRequest &request)const;
void recognizeFaceAsync(const Model::RecognizeFaceRequest& request, const RecognizeFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeFaceOutcomeCallable recognizeFaceCallable(const Model::RecognizeFaceRequest& request) const;
RecognizeHandGestureOutcome recognizeHandGesture(const Model::RecognizeHandGestureRequest &request)const;
void recognizeHandGestureAsync(const Model::RecognizeHandGestureRequest& request, const RecognizeHandGestureAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeHandGestureOutcomeCallable recognizeHandGestureCallable(const Model::RecognizeHandGestureRequest& request) const;
RecognizePublicFaceOutcome recognizePublicFace(const Model::RecognizePublicFaceRequest &request)const;
void recognizePublicFaceAsync(const Model::RecognizePublicFaceRequest& request, const RecognizePublicFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizePublicFaceOutcomeCallable recognizePublicFaceCallable(const Model::RecognizePublicFaceRequest& request) const;

View File

@@ -0,0 +1,54 @@
/*
* 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_RECOGNIZEHANDGESTUREREQUEST_H_
#define ALIBABACLOUD_FACEBODY_MODEL_RECOGNIZEHANDGESTUREREQUEST_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 RecognizeHandGestureRequest : public RpcServiceRequest
{
public:
RecognizeHandGestureRequest();
~RecognizeHandGestureRequest();
std::string getGestureType()const;
void setGestureType(const std::string& gestureType);
std::string getAppId()const;
void setAppId(const std::string& appId);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string gestureType_;
std::string appId_;
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_FACEBODY_MODEL_RECOGNIZEHANDGESTUREREQUEST_H_

View File

@@ -0,0 +1,64 @@
/*
* 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_RECOGNIZEHANDGESTURERESULT_H_
#define ALIBABACLOUD_FACEBODY_MODEL_RECOGNIZEHANDGESTURERESULT_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 RecognizeHandGestureResult : public ServiceResult
{
public:
struct Data
{
float score;
std::string type;
long x;
long y;
long height;
long width;
};
RecognizeHandGestureResult();
explicit RecognizeHandGestureResult(const std::string &payload);
~RecognizeHandGestureResult();
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_RECOGNIZEHANDGESTURERESULT_H_

View File

@@ -1887,6 +1887,42 @@ FacebodyClient::RecognizeFaceOutcomeCallable FacebodyClient::recognizeFaceCallab
return task->get_future();
}
FacebodyClient::RecognizeHandGestureOutcome FacebodyClient::recognizeHandGesture(const RecognizeHandGestureRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RecognizeHandGestureOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RecognizeHandGestureOutcome(RecognizeHandGestureResult(outcome.result()));
else
return RecognizeHandGestureOutcome(outcome.error());
}
void FacebodyClient::recognizeHandGestureAsync(const RecognizeHandGestureRequest& request, const RecognizeHandGestureAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, recognizeHandGesture(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::RecognizeHandGestureOutcomeCallable FacebodyClient::recognizeHandGestureCallable(const RecognizeHandGestureRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RecognizeHandGestureOutcome()>>(
[this, request]()
{
return this->recognizeHandGesture(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::RecognizePublicFaceOutcome FacebodyClient::recognizePublicFace(const RecognizePublicFaceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,62 @@
/*
* 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/RecognizeHandGestureRequest.h>
using AlibabaCloud::Facebody::Model::RecognizeHandGestureRequest;
RecognizeHandGestureRequest::RecognizeHandGestureRequest() :
RpcServiceRequest("facebody", "2019-12-30", "RecognizeHandGesture")
{
setMethod(HttpRequest::Method::Post);
}
RecognizeHandGestureRequest::~RecognizeHandGestureRequest()
{}
std::string RecognizeHandGestureRequest::getGestureType()const
{
return gestureType_;
}
void RecognizeHandGestureRequest::setGestureType(const std::string& gestureType)
{
gestureType_ = gestureType;
setBodyParameter("GestureType", gestureType);
}
std::string RecognizeHandGestureRequest::getAppId()const
{
return appId_;
}
void RecognizeHandGestureRequest::setAppId(const std::string& appId)
{
appId_ = appId;
setBodyParameter("AppId", appId);
}
std::string RecognizeHandGestureRequest::getImageURL()const
{
return imageURL_;
}
void RecognizeHandGestureRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View File

@@ -0,0 +1,76 @@
/*
* 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/RecognizeHandGestureResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
RecognizeHandGestureResult::RecognizeHandGestureResult() :
ServiceResult()
{}
RecognizeHandGestureResult::RecognizeHandGestureResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RecognizeHandGestureResult::~RecognizeHandGestureResult()
{}
void RecognizeHandGestureResult::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["Score"].isNull())
data_.score = std::stof(dataNode["Score"].asString());
if(!dataNode["Type"].isNull())
data_.type = dataNode["Type"].asString();
if(!dataNode["X"].isNull())
data_.x = std::stol(dataNode["X"].asString());
if(!dataNode["Y"].isNull())
data_.y = std::stol(dataNode["Y"].asString());
if(!dataNode["Height"].isNull())
data_.height = std::stol(dataNode["Height"].asString());
if(!dataNode["Width"].isNull())
data_.width = std::stol(dataNode["Width"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
}
std::string RecognizeHandGestureResult::getMessage()const
{
return message_;
}
RecognizeHandGestureResult::Data RecognizeHandGestureResult::getData()const
{
return data_;
}
std::string RecognizeHandGestureResult::getCode()const
{
return code_;
}

View File

@@ -1 +1 @@
<?xml version='1.0' encoding='UTF-8'?><Version product="facebody" apiStyle="RPC" name="2019-12-30" isolationType="outer"><ErrorMapping exceptionExpress=""><ErrorCodes /></ErrorMapping><Apis><Api name="QueryFaceImageTemplate" /><Api name="AddFaceImageTemplate" /><Api name="DeleteFaceImageTemplate" /><Api name="MergeImageFace" /><Api name="GenerateHumanSketchStyle" /><Api name="GenRealPersonVerificationToken" /><Api name="GetRealPersonVerificationResult" /><Api name="ListBodyPerson" /><Api name="ListBodyDbs" /><Api name="GetBodyPerson" /><Api name="SearchBodyTrace" /><Api name="DeleteBodyPerson" /><Api name="AddBodyTrace" /><Api name="CreateBodyPerson" /><Api name="CreateBodyDb" /><Api name="DeleteBodyDb" /><Api name="DetectPedestrianIntrusion" /><Api name="CountCrowd" /><Api name="GenerateHumanAnimeStyle" /><Api name="PedestrianDetectAttribute" /><Api name="DetectChefCap" /><Api name="ExtractPedestrianFeatureAttr" /><Api name="DetectIPCPedestrian" /><Api name="BlurFace" /><Api name="ExtractPedestrianFeatureAttribute" /><Api name="DetectCelebrity" /><Api name="VerifyFaceMask" /><Api name="RecognizeAction" /><Api name="DetectVideoLivingFace" /><Api name="SwapFacialFeatures" /><Api name="ListFaceLabels" /><Api name="AddFaceEntity" /><Api name="DeleteFaceEntity" /><Api name="ListFaceEntities" /><Api name="GetFaceEntity" /><Api name="UpdateFaceEntity" /><Api name="FaceMakeup" /><Api name="HandPosture" /><Api name="BodyPosture" /><Api name="DetectPedestrian" /><Api name="FaceBeauty" /><Api name="FaceFilter" /><Api name="EnhanceFace" /><Api name="FaceTidyup" /><Api name="SearchFace" /><Api name="ListFaceDbs" /><Api name="CreateFaceDb" /><Api name="DeleteFace" /><Api name="DeleteFaceDb" /><Api name="AddFace" /><Api name="ExtractFaceFeature" /><Api name="RecognizeExpression" /><Api name="RecognizePublicFace" /><Api name="DetectLivingFace" /><Api name="DetectBodyCount" /><Api name="DetectMask" /><Api name="RecognizeFace" /><Api name="CompareFace" /><Api name="DetectFace" /></Apis></Version>
<?xml version='1.0' encoding='UTF-8'?><Version product="facebody" apiStyle="RPC" name="2019-12-30" isolationType="outer"><ErrorMapping exceptionExpress=""><ErrorCodes /></ErrorMapping><Apis><Api name="RecognizeHandGesture" /><Api name="QueryFaceImageTemplate" /><Api name="AddFaceImageTemplate" /><Api name="DeleteFaceImageTemplate" /><Api name="MergeImageFace" /><Api name="GenerateHumanSketchStyle" /><Api name="GenRealPersonVerificationToken" /><Api name="GetRealPersonVerificationResult" /><Api name="ListBodyPerson" /><Api name="ListBodyDbs" /><Api name="GetBodyPerson" /><Api name="SearchBodyTrace" /><Api name="DeleteBodyPerson" /><Api name="AddBodyTrace" /><Api name="CreateBodyPerson" /><Api name="CreateBodyDb" /><Api name="DeleteBodyDb" /><Api name="DetectPedestrianIntrusion" /><Api name="CountCrowd" /><Api name="GenerateHumanAnimeStyle" /><Api name="PedestrianDetectAttribute" /><Api name="DetectChefCap" /><Api name="ExtractPedestrianFeatureAttr" /><Api name="DetectIPCPedestrian" /><Api name="BlurFace" /><Api name="ExtractPedestrianFeatureAttribute" /><Api name="DetectCelebrity" /><Api name="VerifyFaceMask" /><Api name="RecognizeAction" /><Api name="DetectVideoLivingFace" /><Api name="SwapFacialFeatures" /><Api name="ListFaceLabels" /><Api name="AddFaceEntity" /><Api name="DeleteFaceEntity" /><Api name="ListFaceEntities" /><Api name="GetFaceEntity" /><Api name="UpdateFaceEntity" /><Api name="FaceMakeup" /><Api name="HandPosture" /><Api name="BodyPosture" /><Api name="DetectPedestrian" /><Api name="FaceBeauty" /><Api name="FaceFilter" /><Api name="EnhanceFace" /><Api name="FaceTidyup" /><Api name="SearchFace" /><Api name="ListFaceDbs" /><Api name="CreateFaceDb" /><Api name="DeleteFace" /><Api name="DeleteFaceDb" /><Api name="AddFace" /><Api name="ExtractFaceFeature" /><Api name="RecognizeExpression" /><Api name="RecognizePublicFace" /><Api name="DetectLivingFace" /><Api name="DetectBodyCount" /><Api name="DetectMask" /><Api name="RecognizeFace" /><Api name="CompareFace" /><Api name="DetectFace" /></Apis></Version>