Skip to content

Commit

Permalink
Add metric for Descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
luisremis committed Feb 20, 2019
1 parent 3fc9140 commit a5503e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/DescriptorsCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ int FindDescriptor::construct_protobuf(
constraints[VDMS_DESC_LABEL_PROP] = constraints["_label"];
constraints.removeMember("_label");
}

if (constraints.isMember("_id")) {
constraints[VDMS_DESC_ID_PROP] = constraints["_id"];
constraints.removeMember("_id");
Expand Down Expand Up @@ -581,12 +582,15 @@ int FindDescriptor::construct_protobuf(
Json::Value link_to_set;
link_to_set["ref"] = ref_set;

Json::Value res_desc = results;
res_desc["list"].append(VDMS_DESC_ID_PROP);

// Query for the Descriptors related to that set
// that match the user-defined constraints
query.QueryNode(
get_value<int>(cmd, "_ref", -1),
VDMS_DESC_TAG,
link_to_set, constraints, results, false);
link_to_set, constraints, res_desc, false);
}
// Case (3), Just want the descriptor by value, we only need the set
else {
Expand Down Expand Up @@ -643,7 +647,7 @@ int FindDescriptor::construct_protobuf(
}
}

// This are needed to construct the response.
// These are needed to construct the response.
if (!results.isMember("list")) {
results["list"].append(VDMS_DESC_LABEL_PROP);
results["list"].append(VDMS_DESC_ID_PROP);
Expand Down
12 changes: 12 additions & 0 deletions utils/src/api_schema/api_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@
"enum": ["png", "jpg"]
},

"metricFormatString": {
"type": "string",
"enum": ["L2", "IP"]
},

"engineFormatString": {
"type": "string",
"enum": ["FaissFlat", "FaissIVFFlat", "TileDBDense", "TileDBSparse"]
},

"vidCodecString": {
"type": "string",
"enum": ["xvid", "h264", "h263"]
Expand Down Expand Up @@ -534,6 +544,8 @@
"properties": {
"name": { "type": "string" },
"dimensions": { "$ref": "#/definitions/refInt" },
"metric": { "$ref": "#/definitions/metricFormatString" },
"engine": { "$ref": "#/definitions/engineFormatString" },
"link": { "$ref": "#/definitions/blockLink" },
"properties": { "type": "object" }
},
Expand Down

0 comments on commit a5503e8

Please sign in to comment.