{
namespace inference
{
-int OutputMetadata::ParseScore(JsonObject *root, LayerInfo& layer)
+int OutputMetadata::ParseScore(JsonObject *root, LayerInfo &layer)
{
if (!json_object_has_member(root, "score")) {
LOGI("No score outputmetadata");
return ret;
}
-int OutputMetadata::ParseBox(JsonObject *root, LayerInfo& layer)
+int OutputMetadata::ParseBox(JsonObject *root, LayerInfo &layer)
{
if (!json_object_has_member(root, "box")) {
LOGI("No box outputmetadata");
return ret;
}
-int OutputMetadata::ParseLandmark(JsonObject *root, LayerInfo& layer)
+int OutputMetadata::ParseLandmark(JsonObject *root, LayerInfo &layer)
{
LOGI("ENTER");
return MEDIA_VISION_ERROR_NONE;
}
-int OutputMetadata::ParseOffset(JsonObject *root, LayerInfo& layer)
+int OutputMetadata::ParseOffset(JsonObject *root, LayerInfo &layer)
{
LOGI("ENTER");
return MEDIA_VISION_ERROR_NONE;
}
-int OutputMetadata::GetPostProcess(JsonObject *root, LayerInfo& layer)
+int OutputMetadata::GetPostProcess(JsonObject *root, LayerInfo &layer)
{
LOGI("ENTER");
LOGE("Fail to GetBoxDecodeInfo[%d]", ret);
return ret;
}
-
- if (box.GetDecodingType() == INFERENCE_BOX_DECODING_TYPE_SSD_ANCHOR) {
- ret = box.GetDecodeInfo().GenerateAnchor();
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to GenerateAnchor[%d]", ret);
- return ret;
- }
+ }
+ if (box.GetDecodingType() == INFERENCE_BOX_DECODING_TYPE_SSD_ANCHOR) {
+ ret = box.GetDecodeInfo().GenerateAnchor();
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Fail to GenerateAnchor[%d]", ret);
+ return ret;
}
}
-
}
if (json_object_has_member(object, "label")) {
for (auto idx = 0; idx < json_array_get_length(outputList); ++idx) {
JsonNode *output_node = json_array_get_element(outputList, idx);
- std::string token(json_to_string(output_node, 1));
+ std::string token(json_to_string(output_node, 1));
int pos = token.find(":");
std::string tensor_name = token.substr(0, pos);
- const std::vector<char> delimiters = {'{', ' ', ':', '\n', '\"'};
+ const std::vector<char> delimiters = { '{', ' ', ':', '\n', '\"' };
- for (auto& delimiter : delimiters)
+ for (auto &delimiter : delimiters)
tensor_name.erase(std::remove(tensor_name.begin(), tensor_name.end(), delimiter), tensor_name.end());
if (tensor_name.compare((std::string("tensor") + std::to_string(idx + 1))) != 0) {
// TODO. add tensor information here.
- LayerInfo layer = { name_value, };
+ LayerInfo layer = {
+ name_value,
+ };
if (json_object_has_member(tensor_object, "postprocess")) {
int ret = GetPostProcess(tensor_object, layer);
}
_tensor_info.insert(std::make_pair(name_value, layer));
-
}
parsed = true;