Update TaggingImage.
This commit is contained in:
@@ -35,6 +35,8 @@ namespace AlibabaCloud
|
||||
TaggingImageRequest();
|
||||
~TaggingImageRequest();
|
||||
|
||||
std::string getMode()const;
|
||||
void setMode(const std::string& mode);
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
bool getAsync()const;
|
||||
@@ -43,6 +45,7 @@ namespace AlibabaCloud
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string mode_;
|
||||
int imageType_;
|
||||
bool async_;
|
||||
std::string imageURL_;
|
||||
|
||||
@@ -44,18 +44,18 @@ void RecognizeFoodResult::parse(const std::string &payload)
|
||||
for (auto dataNodeTopFivesTopFivesItem : allTopFivesNode)
|
||||
{
|
||||
Data::TopFivesItem topFivesItemObject;
|
||||
if(!dataNodeTopFivesTopFivesItem["Calorie"].isNull())
|
||||
topFivesItemObject.calorie = dataNodeTopFivesTopFivesItem["Calorie"].asString();
|
||||
if(!dataNodeTopFivesTopFivesItem["Score"].isNull())
|
||||
topFivesItemObject.score = std::stof(dataNodeTopFivesTopFivesItem["Score"].asString());
|
||||
if(!dataNodeTopFivesTopFivesItem["Category"].isNull())
|
||||
topFivesItemObject.category = dataNodeTopFivesTopFivesItem["Category"].asString();
|
||||
if(!dataNodeTopFivesTopFivesItem["Score"].isNull())
|
||||
topFivesItemObject.score = std::stof(dataNodeTopFivesTopFivesItem["Score"].asString());
|
||||
if(!dataNodeTopFivesTopFivesItem["Calorie"].isNull())
|
||||
topFivesItemObject.calorie = dataNodeTopFivesTopFivesItem["Calorie"].asString();
|
||||
data_.topFives.push_back(topFivesItemObject);
|
||||
}
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ void RecognizeSceneResult::parse(const std::string &payload)
|
||||
for (auto dataNodeTagsTag : allTagsNode)
|
||||
{
|
||||
Data::Tag tagObject;
|
||||
if(!dataNodeTagsTag["Confidence"].isNull())
|
||||
tagObject.confidence = std::stof(dataNodeTagsTag["Confidence"].asString());
|
||||
if(!dataNodeTagsTag["Value"].isNull())
|
||||
tagObject.value = dataNodeTagsTag["Value"].asString();
|
||||
if(!dataNodeTagsTag["Confidence"].isNull())
|
||||
tagObject.confidence = std::stof(dataNodeTagsTag["Confidence"].asString());
|
||||
data_.tags.push_back(tagObject);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,17 @@ TaggingImageRequest::TaggingImageRequest() :
|
||||
TaggingImageRequest::~TaggingImageRequest()
|
||||
{}
|
||||
|
||||
std::string TaggingImageRequest::getMode()const
|
||||
{
|
||||
return mode_;
|
||||
}
|
||||
|
||||
void TaggingImageRequest::setMode(const std::string& mode)
|
||||
{
|
||||
mode_ = mode;
|
||||
setBodyParameter("Mode", mode);
|
||||
}
|
||||
|
||||
int TaggingImageRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
|
||||
@@ -44,10 +44,10 @@ void TaggingImageResult::parse(const std::string &payload)
|
||||
for (auto dataNodeTagsTag : allTagsNode)
|
||||
{
|
||||
Data::Tag tagObject;
|
||||
if(!dataNodeTagsTag["Confidence"].isNull())
|
||||
tagObject.confidence = std::stof(dataNodeTagsTag["Confidence"].asString());
|
||||
if(!dataNodeTagsTag["Value"].isNull())
|
||||
tagObject.value = dataNodeTagsTag["Value"].asString();
|
||||
if(!dataNodeTagsTag["Confidence"].isNull())
|
||||
tagObject.confidence = std::stof(dataNodeTagsTag["Confidence"].asString());
|
||||
data_.tags.push_back(tagObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user