Skip to content

youngwanLEE/VoVNet-RefineDet

Repository files navigation

RefineDet with VoVNet(CVPRW'19) Backbone Networks for Real-time Object Detection

License

This repository contains RefineDet with VoVNet Backbone Networks in the following paper An Energy and GPU-Computation Efficient Backbone Network for Real-Time Object Detection (CVPRW'19, oral)

Highlights

  • Memory & Energy efficient
  • Better performance, especially for small objects
  • Faster speed

OSA

coco_results

VOC_results

Installation

  1. Get the code. We will call the cloned directory as $RefineDet_ROOT.
git clone https://github.com/youngwanLEE/VoVNet-RefineDet.git
  1. Build the code. Please follow Caffe instruction to install all necessary packages and build it.
cd $RefineDet_ROOT
# Modify Makefile.config according to your Caffe installation.
# Make sure to include $RefineDet_ROOT/python to your PYTHONPATH.
cp Makefile.config.example Makefile.config
make all -j && make py

Preparation

  1. Download VoVNet39-ImageNet. By default, we assume the model is stored in $RefineDet_ROOT/models/ImageNet/VoVNet/.

  2. Follow the data/VOC0712/README.md to download VOC2007 and VOC2012 dataset and create the LMDB file for the VOC2007 training and testing.

  3. Follow the data/VOC0712Plus/README.md to download VOC2007 and VOC2012 dataset and create the LMDB file for the VOC2012 training and testing.

  4. Follow the data/coco/README.md to download MS COCO dataset and create the LMDB file for the COCO training and testing.

Training

  1. Train your model on PASCAL VOC.
# It will create model definition files and save snapshot models in:
#   - $RefineDet_ROOT/models/VoVNet/VOC0712{Plus}/refinedet_vovnet39_{size}x{size}/
# and job file, log file, and the python script in:
#   - $RefineDet_ROOT/jobs/VoVNet/VOC0712{Plus}/refinedet_vovnet39_{size}x{size}/
python examples/refinedet/VoVNet39_VOC2007_320.py
python examples/refinedet/VoVNet39_VOC2007_512.py
  1. Train your model on COCO.
# It will create model definition files and save snapshot models in:
#   - $RefineDet_ROOT/models/VoVNet/coco/refinedet_vovnet39_{size}x{size}/
# and job file, log file, and the python script in:
#   - $RefineDet_ROOT/jobs/VoVNet/coco/refinedet_vovnet39_{size}x{size}/
python examples/refinedet/VoVNet39_COCO_320.py
python examples/refinedet/VoVNet39_COCO_512.py

Evaluation

  1. Build the Cython modules.
cd $RefineDet_ROOT/test/lib
make -j
  1. Change the ‘self._devkit_path’ in test/lib/datasets/pascal_voc.py to yours.

  2. Change the ‘self._data_path’ in test/lib/datasets/coco.py to yours.

  3. Check out test/refinedet_demo.py on how to detect objects using the RefineDet model and how to plot detection results.

# For GPU users
python test/refinedet_demo.py
# For CPU users
python test/refinedet_demo.py --gpu_id -1
  1. Evaluate the trained models via test/refinedet_test.py.
# You can modify the parameters in refinedet_test.py for different types of evaluation:
#  - single_scale: True is single scale testing, False is multi_scale_testing.
#  - test_set: 'voc_2007_test', 'voc_2012_test', 'coco_2014_minival', 'coco_2015_test-dev'.
#  - voc_path: where the trained voc caffemodel.
#  - coco_path: where the trained voc caffemodel.
# For 'voc_2007_test' and 'coco_2014_minival', it will directly output the mAP results.
# For 'voc_2012_test' and 'coco_2015_test-dev', it will save the detections and you should submitted it to the evaluation server to get the mAP results.
python test/refinedet_test.py

Models

  1. PASCAL VOC models :

  2. COCO models:

Citing VoVNet

Please cite our paper in your publications if it helps your research:

@inproceedings{lee2019energy,
  title = {An Energy and GPU-Computation Efficient Backbone Network for Real-Time Object Detection},
  author = {Lee, Youngwan and Hwang, Joong-won and Lee, Sangrok and Bae, Yuseok and Park, Jongyoul},
  booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops},
  year = {2019}
}