A Python wrapper on Darknet. Compatible with latest YOLO V3.
Image source: http://absfreepic.com/free-photos/download/crowded-cars-on-street-4032x2272_48736.html
- Python 3.5
- Numpy, cython and pkgconfig
pip3 install numpy cython pkgconfig
- Optionally, OpenCV 3.x with Python bindings. (Tested on OpenCV 3.4.0)
- You can use this script to automate Open CV 3.4 installation (Tested on Ubuntu 16.04).
- It is possible to compile YOLO3-4-Py without OpenCV. (Performance of this approach is less.)
NOTE: OpenCV 3.4.1 has a bug which causes Darknet to fail. Therefore this wrapper would not work with OpenCV 3.4.1.
More details are available at https://github.com/pjreddie/darknet/issues/502
NOTE: It is possible to build yolo3-4-py without OpenCV by setting the environment variable OPENCV=0.
- Navigate to docker directory.
- Copy sample images into the
input
directory. Or else run input/download_sample_images.sh - Run
sh run.sh
- Observe the outputs generated in
output
directory.
- Download darknet and compile with OpenCV enabled.
- Open Makefile of darknet and set OPENCV=1. Then run make.
- Set environment variable DARKNET_HOME to download location of darknet.
- Add DARKNET_HOME to LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DARKNET_HOME
- Run
python3 setup.py build_ext --inplace
- Download "yolov3" model file and config files using
sh download_models.sh
. - Run
python3 webcam_test.py
orpython3 test.py