Skip to content

Commit

Permalink
update README and move it to RST format, add LICENSE file
Browse files Browse the repository at this point in the history
  • Loading branch information
Banus committed Nov 26, 2016
1 parent 3a53156 commit 97165e3
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 72 deletions.
12 changes: 12 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
YOLO LICENSE
Version 2, July 29 2016

THIS SOFTWARE LICENSE IS PROVIDED "ALL CAPS" SO THAT YOU KNOW IT IS SUPER
SERIOUS AND YOU DON'T MESS AROUND WITH COPYRIGHT LAW BECAUSE YOU WILL GET IN
TROUBLE HERE ARE SOME OTHER BUZZWORDS COMMONLY IN THESE THINGS WARRANTIES
LIABILITY CONTRACT TORT LIABLE CLAIMS RESTRICTION MERCHANTABILITY. NOW HERE'S
THE REAL LICENSE:

0. Darknet is public domain.
1. Do whatever you want with it.
2. Stop emailing me about it!
72 changes: 0 additions & 72 deletions README.md

This file was deleted.

121 changes: 121 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
|Python27|

.. |Python27| image:: https://img.shields.io/badge/python-2.7-blue.svg
:target: https://www.python.org/

==========
Caffe-YOLO
==========

Introduction
============

This is a set of tools to convert models from
`Darknet <http://pjreddie.com/darknet/yolov1/>`_ to
`Caffe <https://github.com/BVLC/caffe>`_, and in
particular to convert the YOLO networks for object detection. For more details,
see the paper:

*"You Only Look Once: Unified, Real-Time Object Detection"*
[`Redmon2015 <https://arxiv.org/abs/1506.02640>`_]


Usage
=====

The repository includes a tool to convert the Darknet configuration file ``.cfg``
to the ``.prototxt`` definition in Caffe, a tool to convert the weight
file ``.weights`` to ``.caffemodel`` in Caffe and a detection demo to test the
converted networks.

Convert the configuration file with:

.. code:: bash
python create_yolo_prototxt.py tiny-yolo.cfg yolo_tiny
By default, only the *deploy* prototxt is generate. If the ``--train`` option is
passed, the *train_val* version of the prototxt file is generated; however, the
file lacks the information about input annotations, training loss and it's meant
as a form of partial automation of a manually defined training.

The YOLO weights are available on the `Darknet v1 <http://pjreddie.com/darknet/yolov1/>`_
website. See the instructions there on how to download them. To convert the
weights to Caffe, use:

.. code:: bash
python create_yolo_caffemodel.py yolo_tiny_deploy.prototxt tiny-yolo.weights \
yolo_tiny.caffemodel
If the number of weights is not compatible with the given prototxt, an error is
returned.

Test the results on one of the images in the repository with:

.. code:: bash
python yolo_detect.py yolo_tiny_deploy.prototxt yolo_tiny.caffemodel images/dog.jpg
To test the *CoCo* networks pass the ``--coco`` option in order to use the correct
set of class labels.


Limitations
^^^^^^^^^^^

The process only supports a limited number of layers and options. The *detection*
layer in YOLO is not implemented and parsing of the network output is left to
the caller application.

The most recent ``yolo`` and ``yolo-coco`` models in Darknet v1 use the *Local
Convolution* layer (convolutions without weight sharing) which is not supported
by the official Caffe repository. There is partial support to the version in
`caffe-mt <https://github.com/knsong/caffe-mt>`_ by passing ``--loclayer`` to
``create_yolo_prototxt.py`` but the implementation is still buggy.

The *softmax* layer (for ``Darknet`` v2) and shortcut connections introduced in
the Darknet v2 YOLO models are also not supported.


Model files
===========

Three converted models are available in the `prototxt` directory:

* **YOLO tiny**: converted from `tiny-yolo.cfg`,
`caffemodel <https://drive.google.com/file/d/0Bx7QZuu7oVBbLVktdDJEQ3FZTEk/view?usp=sharing>`__.

* **YOLO small**: converted from `yolo-small.cfg`,
`caffemodel <https://drive.google.com/file/d/0Bx7QZuu7oVBbVVJaVzh2WV9CR28/view?usp=sharing>`__.

* **YOLO CoCo tiny**: converted from `tiny-coco.cfg`,
`caffemodel <https://drive.google.com/file/d/0Bx7QZuu7oVBbcWRpVG9NNl9EanM/view?usp=sharing>`__.


Legacy models
^^^^^^^^^^^^^

The models originally converted by *xingwangsfu* (https://github.com/xingwangsfu/caffe-yolo)
are available in the directory ``prototxt/legacy``. The converted weights can
be downloaded here:

* **YOLO**: https://drive.google.com/file/d/0Bzy9LxvTYIgKMXdqS29HWGNLdGM/view?usp=sharing

* **YOLO small**: https://drive.google.com/file/d/0Bzy9LxvTYIgKa3ZHbnZPLUo0eWs/view?usp=sharing

* **YOLO tiny**: https://drive.google.com/file/d/0Bzy9LxvTYIgKNFEzOEdaZ3U0Nms/view?usp=sharing


Requirements
============

* `Caffe <http://caffe.berkeleyvision.org>`_ with ``pycaffe`` support

* OpenCV 2 with python interfaces (``python-opencv`` in Ubuntu)


License
=======

The code is released under the YOLO license.

0 comments on commit 97165e3

Please sign in to comment.