ObjectDetector
ObjectDetector copied to clipboard
Darknet support
Main tasks include:
- [x] Proof of concept implementation.
- [ ] Reuse JdeRobot labels instead of having duplicate metadata files.
- [ ] Remove hardcoded assumption of Coco categories.
- [ ] Error handling: dynamic library or model files cannot be found.
The current version works, but it assumes Coco labels and loads a separate metadata file with Coco categories taken from the Darknet distribution. I'll be updating this PR as I work on the improvement tasks above.
To test YOLOv3-tiny
, please follow these steps:
- Download and compile Darknet to obtain
libdarknet.so
. - Copy
yolov3-tiny.cfg
from the Darknet distribution intoNet/Darknet
. - Download
yolov3-tiny.weights
and place it intoNet/Darknet
. - Update your
DYLD_LIBRARY_PATH
to include the directory wherelibdarknet.so
resides. - Run the object detector as usual, using the
yml
configuration file supplied in this PR.
Other models are possible. The corresponding darknet weights and configuration files must be placed in the Net/Darknet
directory. They must have the same name (except for the extension), which must in turn match the Model name defined in the YAML configuration file.
Credits
- All data files have been taken from the Darknet distribution.
- The
darknet.py
file was also copied from the Darknet distribution, but it includes modifications to trigger detection from anumpy
image instead of a file.