1
votes

Is there a C/C++ API, pre-trained with Imagenet dataset, for Detection ?

I have tried Yolo, with ./darknet -i 0 detector demo cfg/imagenet1k.data extraction.cfg extraction.weights

But it gives me the error Last layer must produce detections

And for Tensorflow, looks like there is only python API https://github.com/tensorflow/models/tree/master/research/object_detection

1

1 Answers

1
votes

When you develop a model in TensorFlow, it can be output as a protobuf file (usually with a pb extension, for more details on protobuf in TensorFlow check out this page). This protobuf file can then be used in different applications written in languages that TensorFlow has bindings to. A simple tutorial on how to accomplish this for a C++ application can be found here.

Regarding Yolo, you can generate a protobuf file from the Yolo script like this:

flow --model cfg/yolo.cfg --load bin/yolo.weights --savepb

(Further details on other parameters that can be passed to Yolo can be found on the Github readme page).

The output protobuf file can then be loaded into your C++ application to perform object detection.