Add GetImageQuality API.
This commit is contained in:
@@ -1635,6 +1635,42 @@ ImmClient::GetImageJobOutcomeCallable ImmClient::getImageJobCallable(const GetIm
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImmClient::GetImageQualityOutcome ImmClient::getImageQuality(const GetImageQualityRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetImageQualityOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetImageQualityOutcome(GetImageQualityResult(outcome.result()));
|
||||
else
|
||||
return GetImageQualityOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImmClient::getImageQualityAsync(const GetImageQualityRequest& request, const GetImageQualityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getImageQuality(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImmClient::GetImageQualityOutcomeCallable ImmClient::getImageQualityCallable(const GetImageQualityRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetImageQualityOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getImageQuality(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImmClient::GetMediaMetaOutcome ImmClient::getMediaMeta(const GetMediaMetaRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
62
imm/src/model/GetImageQualityRequest.cc
Normal file
62
imm/src/model/GetImageQualityRequest.cc
Normal 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/imm/model/GetImageQualityRequest.h>
|
||||
|
||||
using AlibabaCloud::Imm::Model::GetImageQualityRequest;
|
||||
|
||||
GetImageQualityRequest::GetImageQualityRequest() :
|
||||
RpcServiceRequest("imm", "2017-09-06", "GetImageQuality")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetImageQualityRequest::~GetImageQualityRequest()
|
||||
{}
|
||||
|
||||
std::string GetImageQualityRequest::getProject()const
|
||||
{
|
||||
return project_;
|
||||
}
|
||||
|
||||
void GetImageQualityRequest::setProject(const std::string& project)
|
||||
{
|
||||
project_ = project;
|
||||
setParameter("Project", project);
|
||||
}
|
||||
|
||||
std::string GetImageQualityRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void GetImageQualityRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
std::string GetImageQualityRequest::getImageUri()const
|
||||
{
|
||||
return imageUri_;
|
||||
}
|
||||
|
||||
void GetImageQualityRequest::setImageUri(const std::string& imageUri)
|
||||
{
|
||||
imageUri_ = imageUri;
|
||||
setParameter("ImageUri", imageUri);
|
||||
}
|
||||
|
||||
77
imm/src/model/GetImageQualityResult.cc
Normal file
77
imm/src/model/GetImageQualityResult.cc
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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/imm/model/GetImageQualityResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imm;
|
||||
using namespace AlibabaCloud::Imm::Model;
|
||||
|
||||
GetImageQualityResult::GetImageQualityResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetImageQualityResult::GetImageQualityResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetImageQualityResult::~GetImageQualityResult()
|
||||
{}
|
||||
|
||||
void GetImageQualityResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto imageQualityNode = value["ImageQuality"];
|
||||
if(!imageQualityNode["OverallScore"].isNull())
|
||||
imageQuality_.overallScore = std::stof(imageQualityNode["OverallScore"].asString());
|
||||
if(!imageQualityNode["ClarityScore"].isNull())
|
||||
imageQuality_.clarityScore = std::stof(imageQualityNode["ClarityScore"].asString());
|
||||
if(!imageQualityNode["Clarity"].isNull())
|
||||
imageQuality_.clarity = std::stof(imageQualityNode["Clarity"].asString());
|
||||
if(!imageQualityNode["ExposureScore"].isNull())
|
||||
imageQuality_.exposureScore = std::stof(imageQualityNode["ExposureScore"].asString());
|
||||
if(!imageQualityNode["Exposure"].isNull())
|
||||
imageQuality_.exposure = std::stof(imageQualityNode["Exposure"].asString());
|
||||
if(!imageQualityNode["ContrastScore"].isNull())
|
||||
imageQuality_.contrastScore = std::stof(imageQualityNode["ContrastScore"].asString());
|
||||
if(!imageQualityNode["Contrast"].isNull())
|
||||
imageQuality_.contrast = std::stof(imageQualityNode["Contrast"].asString());
|
||||
if(!imageQualityNode["ColorScore"].isNull())
|
||||
imageQuality_.colorScore = std::stof(imageQualityNode["ColorScore"].asString());
|
||||
if(!imageQualityNode["Color"].isNull())
|
||||
imageQuality_.color = std::stof(imageQualityNode["Color"].asString());
|
||||
if(!imageQualityNode["CompositionScore"].isNull())
|
||||
imageQuality_.compositionScore = std::stof(imageQualityNode["CompositionScore"].asString());
|
||||
if(!value["ImageUri"].isNull())
|
||||
imageUri_ = value["ImageUri"].asString();
|
||||
|
||||
}
|
||||
|
||||
GetImageQualityResult::ImageQuality GetImageQualityResult::getImageQuality()const
|
||||
{
|
||||
return imageQuality_;
|
||||
}
|
||||
|
||||
std::string GetImageQualityResult::getImageUri()const
|
||||
{
|
||||
return imageUri_;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ void GetVideoResult::parse(const std::string &payload)
|
||||
videoTagsObject.videoTagEnName = valueVideoTagsVideoTagsItem["VideoTagEnName"].asString();
|
||||
if(!valueVideoTagsVideoTagsItem["VideoTagConfidence"].isNull())
|
||||
videoTagsObject.videoTagConfidence = std::stof(valueVideoTagsVideoTagsItem["VideoTagConfidence"].asString());
|
||||
if(!valueVideoTagsVideoTagsItem["VideoTagLevel"].isNull())
|
||||
videoTagsObject.videoTagLevel = std::stoi(valueVideoTagsVideoTagsItem["VideoTagLevel"].asString());
|
||||
videoTags_.push_back(videoTagsObject);
|
||||
}
|
||||
auto allPersonsNode = value["Persons"]["PersonsItem"];
|
||||
@@ -133,6 +135,32 @@ void GetVideoResult::parse(const std::string &payload)
|
||||
remarksD_ = value["RemarksD"].asString();
|
||||
if(!value["ExternalId"].isNull())
|
||||
externalId_ = value["ExternalId"].asString();
|
||||
if(!value["VideoFacesStatus"].isNull())
|
||||
videoFacesStatus_ = value["VideoFacesStatus"].asString();
|
||||
if(!value["VideoFacesFailReason"].isNull())
|
||||
videoFacesFailReason_ = value["VideoFacesFailReason"].asString();
|
||||
if(!value["VideoFacesModifyTime"].isNull())
|
||||
videoFacesModifyTime_ = value["VideoFacesModifyTime"].asString();
|
||||
if(!value["VideoFrameTagsStatus"].isNull())
|
||||
videoFrameTagsStatus_ = value["VideoFrameTagsStatus"].asString();
|
||||
if(!value["VideoFrameTagsFailReason"].isNull())
|
||||
videoFrameTagsFailReason_ = value["VideoFrameTagsFailReason"].asString();
|
||||
if(!value["VideoFrameTagsModifyTime"].isNull())
|
||||
videoFrameTagsModifyTime_ = value["VideoFrameTagsModifyTime"].asString();
|
||||
if(!value["VideoSTTStatus"].isNull())
|
||||
videoSTTStatus_ = value["VideoSTTStatus"].asString();
|
||||
if(!value["VideoSTTFailReason"].isNull())
|
||||
videoSTTFailReason_ = value["VideoSTTFailReason"].asString();
|
||||
if(!value["VideoSTTModifyTime"].isNull())
|
||||
videoSTTModifyTime_ = value["VideoSTTModifyTime"].asString();
|
||||
if(!value["VideoOCRStatus"].isNull())
|
||||
videoOCRStatus_ = value["VideoOCRStatus"].asString();
|
||||
if(!value["VideoOCRFailReason"].isNull())
|
||||
videoOCRFailReason_ = value["VideoOCRFailReason"].asString();
|
||||
if(!value["VideoOCRModifyTime"].isNull())
|
||||
videoOCRModifyTime_ = value["VideoOCRModifyTime"].asString();
|
||||
if(!value["VideoInfo"].isNull())
|
||||
videoInfo_ = value["VideoInfo"].asString();
|
||||
|
||||
}
|
||||
|
||||
@@ -161,21 +189,46 @@ std::string GetVideoResult::getSourceUri()const
|
||||
return sourceUri_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoInfo()const
|
||||
{
|
||||
return videoInfo_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getRemarksA()const
|
||||
{
|
||||
return remarksA_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoFrameTagsModifyTime()const
|
||||
{
|
||||
return videoFrameTagsModifyTime_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getRemarksB()const
|
||||
{
|
||||
return remarksB_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoFacesFailReason()const
|
||||
{
|
||||
return videoFacesFailReason_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoFacesStatus()const
|
||||
{
|
||||
return videoFacesStatus_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getRemarksC()const
|
||||
{
|
||||
return remarksC_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoOCRModifyTime()const
|
||||
{
|
||||
return videoOCRModifyTime_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getRemarksD()const
|
||||
{
|
||||
return remarksD_;
|
||||
@@ -201,6 +254,16 @@ std::string GetVideoResult::getSourcePosition()const
|
||||
return sourcePosition_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoOCRFailReason()const
|
||||
{
|
||||
return videoOCRFailReason_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoFrameTagsStatus()const
|
||||
{
|
||||
return videoFrameTagsStatus_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoTagsFailReason()const
|
||||
{
|
||||
return videoTagsFailReason_;
|
||||
@@ -211,6 +274,11 @@ std::string GetVideoResult::getVideoTagsModifyTime()const
|
||||
return videoTagsModifyTime_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoOCRStatus()const
|
||||
{
|
||||
return videoOCRStatus_;
|
||||
}
|
||||
|
||||
int GetVideoResult::getVideoFrames()const
|
||||
{
|
||||
return videoFrames_;
|
||||
@@ -221,6 +289,11 @@ std::string GetVideoResult::getProcessModifyTime()const
|
||||
return processModifyTime_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoSTTModifyTime()const
|
||||
{
|
||||
return videoSTTModifyTime_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getProcessFailReason()const
|
||||
{
|
||||
return processFailReason_;
|
||||
@@ -236,6 +309,11 @@ std::string GetVideoResult::getExternalId()const
|
||||
return externalId_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoSTTFailReason()const
|
||||
{
|
||||
return videoSTTFailReason_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoUri()const
|
||||
{
|
||||
return videoUri_;
|
||||
@@ -246,6 +324,21 @@ std::string GetVideoResult::getVideoFormat()const
|
||||
return videoFormat_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoFrameTagsFailReason()const
|
||||
{
|
||||
return videoFrameTagsFailReason_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoSTTStatus()const
|
||||
{
|
||||
return videoSTTStatus_;
|
||||
}
|
||||
|
||||
std::string GetVideoResult::getVideoFacesModifyTime()const
|
||||
{
|
||||
return videoFacesModifyTime_;
|
||||
}
|
||||
|
||||
std::vector<GetVideoResult::VideoTagsItem> GetVideoResult::getVideoTags()const
|
||||
{
|
||||
return videoTags_;
|
||||
|
||||
@@ -82,6 +82,28 @@ void IndexVideoRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
std::string IndexVideoRequest::getNotifyEndpoint()const
|
||||
{
|
||||
return notifyEndpoint_;
|
||||
}
|
||||
|
||||
void IndexVideoRequest::setNotifyEndpoint(const std::string& notifyEndpoint)
|
||||
{
|
||||
notifyEndpoint_ = notifyEndpoint;
|
||||
setParameter("NotifyEndpoint", notifyEndpoint);
|
||||
}
|
||||
|
||||
std::string IndexVideoRequest::getNotifyTopicName()const
|
||||
{
|
||||
return notifyTopicName_;
|
||||
}
|
||||
|
||||
void IndexVideoRequest::setNotifyTopicName(const std::string& notifyTopicName)
|
||||
{
|
||||
notifyTopicName_ = notifyTopicName;
|
||||
setParameter("NotifyTopicName", notifyTopicName);
|
||||
}
|
||||
|
||||
std::string IndexVideoRequest::getRemarksB()const
|
||||
{
|
||||
return remarksB_;
|
||||
|
||||
@@ -69,6 +69,14 @@ void ListFaceGroupsResult::parse(const std::string &payload)
|
||||
faceGroupsObject.externalId = valueFaceGroupsFaceGroupsItem["ExternalId"].asString();
|
||||
if(!valueFaceGroupsFaceGroupsItem["ImageCount"].isNull())
|
||||
faceGroupsObject.imageCount = std::stoi(valueFaceGroupsFaceGroupsItem["ImageCount"].asString());
|
||||
if(!valueFaceGroupsFaceGroupsItem["Gender"].isNull())
|
||||
faceGroupsObject.gender = valueFaceGroupsFaceGroupsItem["Gender"].asString();
|
||||
if(!valueFaceGroupsFaceGroupsItem["MaxAge"].isNull())
|
||||
faceGroupsObject.maxAge = std::stof(valueFaceGroupsFaceGroupsItem["MaxAge"].asString());
|
||||
if(!valueFaceGroupsFaceGroupsItem["AverageAge"].isNull())
|
||||
faceGroupsObject.averageAge = std::stof(valueFaceGroupsFaceGroupsItem["AverageAge"].asString());
|
||||
if(!valueFaceGroupsFaceGroupsItem["MinAge"].isNull())
|
||||
faceGroupsObject.minAge = std::stof(valueFaceGroupsFaceGroupsItem["MinAge"].asString());
|
||||
auto groupCoverFaceNode = value["GroupCoverFace"];
|
||||
if(!groupCoverFaceNode["FaceId"].isNull())
|
||||
faceGroupsObject.groupCoverFace.faceId = groupCoverFaceNode["FaceId"].asString();
|
||||
|
||||
Reference in New Issue
Block a user