class BoxInfo
{
private:
- std::string name;
+ std::vector<std::string> names;
DimInfo dimInfo;
inference_box_type_e type; // 0:L-T-R-B, 1: Cx-Cy-W-H
std::vector<int> order; // Order based on box type
public:
BoxInfo()
- : name()
+ : names()
, dimInfo()
, type(INFERENCE_BOX_TYPE_ORIGIN_LEFTTOP)
, order()
~BoxInfo() = default;
- std::string GetName()
- {
- return name;
- }
+ std::string GetName();
+
DimInfo GetDimInfo()
{
return dimInfo;
*/
#include <BoxInfo.h>
+#include <mv_private.h>
using namespace mediavision::inference::box;
+std::string BoxInfo::GetName()
+{
+ // OutputMetadata needs empty sting
+ if (names.empty())
+ return "";
+
+ return names[0];
+}
+
int BoxInfo::ParseBox(JsonObject *root)
{
LOGI("ENTER");
JsonObject *pObject = json_object_get_object_member(root, "box");
- name = json_object_get_string_member(pObject, "name");
- LOGI("layer: %s", name.c_str());
+ JsonArray *array = json_object_get_array_member(pObject, "name");
+ MEDIA_VISION_NULL_ARG_CHECK(array);
+
+ unsigned int elements1 = json_array_get_length(array);
+ MEDIA_VISION_CHECK_CONDITION(elements1 > 0,
+ MEDIA_VISION_ERROR_INVALID_PARAMETER,
+ "No name on meta file");
+
+ for (unsigned int elem1 = 0; elem1 < elements1; ++elem1) {
+ names.push_back(json_array_get_string_element(array, elem1));
+ }
- JsonArray *array = json_object_get_array_member(pObject, "index");
+ array = json_object_get_array_member(pObject, "index");
unsigned int elements2 = json_array_get_length(array);
LOGI("range dim: size[%u]", elements2);