https://github.com/zhreshold/mxnet-yolo
YOLO: You only look once real-time object detector
https://github.com/zhreshold/mxnet-yolo
object-detection yolo yolo2 you-only-look-once
Last synced: 1 day ago
JSON representation
YOLO: You only look once real-time object detector
- Host: GitHub
- URL: https://github.com/zhreshold/mxnet-yolo
- Owner: zhreshold
- License: mit
- Created: 2017-04-28T23:10:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-22T17:52:37.000Z (over 6 years ago)
- Last Synced: 2025-03-26T23:06:23.327Z (19 days ago)
- Topics: object-detection, yolo, yolo2, you-only-look-once
- Language: Python
- Size: 1.72 MB
- Stars: 237
- Watchers: 25
- Forks: 85
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-MXNet - [sym v1/v2 - YOLO) [[gluon]](https://github.com/MashiMaroLjc/YOLO) [[v3]](https://github.com/Fermes/yolov3-mxnet) (<a name="Vision"></a>2. Vision / 2.2 Object Detection)
- awesome-yolo-object-detection - zhreshold/mxnet-yolo - yolo?style=social"/> : YOLO: You only look once real-time object detector. (Other Versions of YOLO)
- awesome-yolo-object-detection - zhreshold/mxnet-yolo - yolo?style=social"/> : YOLO: You only look once real-time object detector. (Other Versions of YOLO)
README
# YOLO-v2: Real-Time Object Detection
Still under development. 71 mAP(darknet) and 74mAP(resnet50) on VOC2007 achieved so far.
This is a pre-released version.
### What's new
This repo is now deprecated, I am migrating to the latest [Gluon-CV](https://github.com/dmlc/gluon-cv) which is more user friendly and has a lot more algorithms in development.* Pretrained YOLOv3 models which achiveve 81%+ mAP on VOC and near 37% mAP on COCO: [Model Zoo](https://gluon-cv.mxnet.io/model_zoo/detection.html).
* Object Detection model [tutorials](https://gluon-cv.mxnet.io/build/examples_detection/index.html).
This repo will not receive active development, however, you can continue use it with the mxnet 1.1.0(probably 1.2.0).
### Disclaimer
This is a re-implementation of original yolo v2 which is based on [darknet](https://github.com/pjreddie/darknet).
The arXiv paper is available [here](https://arxiv.org/pdf/1612.08242.pdf).### Demo

### Getting started
- Build from source, this is required because this example is not merged, some
custom operators are not presented in official MXNet. [Instructions](http://mxnet.io/get_started/install.html)
- Install required packages: `cv2`, `matplotlib`### Try the demo
- Download the pretrained [model](https://github.com/zhreshold/mxnet-yolo/releases/download/0.1-alpha/yolo2_darknet19_416_pascalvoc0712_trainval.zip)(darknet as backbone), or this [model](https://github.com/zhreshold/mxnet-yolo/releases/download/v0.2.0/yolo2_resnet50_voc0712_trainval.tar.gz)(resnet50 as backbone) and extract to `model/` directory.
- Run
```
# cd /path/to/mxnet-yolo
python demo.py --cpu
# available options
python demo.py -h
```### Train the model
- Grab a pretrained model, e.g. [`darknet19`](https://github.com/zhreshold/mxnet-yolo/releases/download/0.1-alpha/darknet19_416_ILSVRC2012.zip)
- (optional) Grab a pretrained resnet50 model, [`resnet-50-0000.params`](http://data.dmlc.ml/models/imagenet/resnet/50-layers/resnet-50-0000.params),[`resnet-50-symbol.json`](http://data.dmlc.ml/models/imagenet/resnet/50-layers/resnet-50-symbol.json), this will produce slightly better mAP than `darknet` in my experiments.
- Download PASCAL VOC dataset.
```
cd /path/to/where_you_store_datasets/
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
# Extract the data.
tar -xvf VOCtrainval_11-May-2012.tar
tar -xvf VOCtrainval_06-Nov-2007.tar
tar -xvf VOCtest_06-Nov-2007.tar
ln -s /path/to/VOCdevkit /path/to/mxnet-yolo/data/VOCdevkit
```
- Create packed binary file for faster training
```
# cd /path/to/mxnet-ssd
bash tools/prepare_pascal.sh
# or if you are using windows
python tools/prepare_dataset.py --dataset pascal --year 2007,2012 --set trainval --target ./data/train.lst
python tools/prepare_dataset.py --dataset pascal --year 2007 --set test --target ./data/val.lst --shuffle False
```
- Start training
```
python train.py --gpus 0,1,2,3 --epoch 0
# choose different networks, such as resnet50_yolo
python train.py --gpus 0,1,2,3 --network resnet50_yolo --data-shape 416 --pretrained model/resnet-50 --epoch 0
# see advanced arguments for training
python train.py -h
```