forked from xingwangsfu/caffe-yolo
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update README and move it to RST format, add LICENSE file
- Loading branch information
Showing
3 changed files
with
133 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |