MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / objectDetectionJson

Function objectDetectionJson

examples/Example_opencv.cpp:258–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258string objectDetectionJson(bool onlyProtoPath){
259
260 // Define path to save object detection data
261 string protobufDataPath = "example_object_detection.data";
262 // Define processing device
263 string processingDevice = "GPU";
264 // Set path to model configuration file
265 string modelConfiguration = "yolov3.cfg";
266 // Set path to model weights
267 string modelWeights = "yolov3.weights";
268 // Set path to class names file
269 string classesFile = "obj.names";
270
271 // Construct all the composition of the JSON string
272 string protobuf_data_path = jsonFormat("protobuf_data_path", protobufDataPath);
273 string processing_device = jsonFormat("processing_device", processingDevice);
274 string model_configuration = jsonFormat("model_configuration", modelConfiguration);
275 string model_weights = jsonFormat("model_weights", modelWeights);
276 string classes_file = jsonFormat("classes_file", classesFile);
277
278 // Return only the the protobuf path in JSON format
279 if(onlyProtoPath)
280 return "{" + protobuf_data_path + "}";
281 else
282 return "{" + protobuf_data_path + "," + processing_device + "," + model_configuration + ","
283 + model_weights + "," + classes_file + "}";
284}

Callers 1

mainFunction · 0.85

Calls 1

jsonFormatFunction · 0.85

Tested by

no test coverage detected