You only look once, but you reimplement YOLO over and over again.
YAD2K is a 90% Keras/10% Tensorflow implementation of YOLO_v2.
Original paper: YOLO9000: Better, Faster, Stronger by Joseph Redmond and Ali Farhadi.
- Keras
- Tensorflow r0.12
- Numpy
- Pillow (for rendering test results)
- Python 3.5
With conda use conda env create -f environment.yml
to replicate the development environment. This environment is likely to be overcomplete.
- Download Darknet model weights from the official YOLO website.
- Convert the Darknet YOLO_v2 model to a Keras model.
- Test the converted model on the small test set in
images/
.
wget http://pjreddie.com/media/files/yolo.weights
./yad2k.py cfg/yolo.cfg yolo.weights model_data/yolo.h5
./test_yolo.py model_data/yolo.h5 # output in images/out/
See ./yad2k.py --help
and ./test_yolo.py --help
for more options.
The YAD2K converter currently only supports YOLO_v2 style models, this include the following configurations: darknet19_448
, tiny-yolo-voc
, yolo-voc
, and yolo
.
yad2k.py -p
will produce a plot of the generated Keras model. For example see yolo.png.
YAD2K assumes the Keras backend is Tensorflow. In particular for YOLO_v2 models with a passthrough layer, YAD2K uses tf.space_to_depth
to implement the passthrough layer. The evaluation script also directly uses Tensorflow tensors and uses tf.non_max_suppression
for the final output.
voc_conversion_scripts
contains two scripts for converting the Pascal VOC image dataset with XML annotations to either HDF5 or TFRecords format for easier training with Keras or Tensorflow.
yad2k/models
contains reference implementations of Darknet-19 and YOLO_v2.
- Error deserializing Lambda wrapping space_to_depth. Apply this PR to Keras.
- Add YOLO_v2 loss function.
- Script to train YOLO_v2 reference model.
- Support for additional Darknet layer types.
- Tuck away the Tensorflow dependencies with Keras wrappers where possible.
YAD2K stands on the shoulders of giants.
- 🔥 Darknet 🔥
- Darknet.Keras - The original D2K for YOLO_v1.
- Darkflow - Darknet directly to Tensorflow.
- caffe-yolo - YOLO_v1 to Caffe.