Update SearchFace.

This commit is contained in:
sdk-team
2020-11-24 11:07:13 +00:00
parent 42b2b25562
commit df2d0d89e1
5 changed files with 26 additions and 6 deletions

View File

@@ -27,6 +27,17 @@ SearchFaceRequest::SearchFaceRequest() :
SearchFaceRequest::~SearchFaceRequest()
{}
std::string SearchFaceRequest::getDbNames()const
{
return dbNames_;
}
void SearchFaceRequest::setDbNames(const std::string& dbNames)
{
dbNames_ = dbNames;
setParameter("DbNames", dbNames);
}
std::string SearchFaceRequest::getDbName()const
{
return dbName_;

View File

@@ -50,12 +50,14 @@ void SearchFaceResult::parse(const std::string &payload)
Data::MatchListItem::FaceItemsItem faceItemsObject;
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].isNull())
faceItemsObject.faceId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].isNull())
faceItemsObject.score = std::stof(dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].asString());
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].isNull())
faceItemsObject.extraData = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].isNull())
faceItemsObject.entityId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].isNull())
faceItemsObject.score = std::stof(dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].asString());
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].isNull())
faceItemsObject.dbName = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["DbName"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].isNull())
faceItemsObject.extraData = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].asString();
matchListItemObject.faceItems.push_back(faceItemsObject);
}
auto locationNode = value["Location"];
@@ -63,10 +65,10 @@ void SearchFaceResult::parse(const std::string &payload)
matchListItemObject.location.x = std::stoi(locationNode["X"].asString());
if(!locationNode["Y"].isNull())
matchListItemObject.location.y = std::stoi(locationNode["Y"].asString());
if(!locationNode["Width"].isNull())
matchListItemObject.location.width = std::stoi(locationNode["Width"].asString());
if(!locationNode["Height"].isNull())
matchListItemObject.location.height = std::stoi(locationNode["Height"].asString());
if(!locationNode["Width"].isNull())
matchListItemObject.location.width = std::stoi(locationNode["Width"].asString());
data_.matchList.push_back(matchListItemObject);
}