Home

Awesome

Pytorch SSD Series

Pytorch 4.1 is suppoted on branch 0.4 now.

Support Arc:

VOC2007 Test

SystemmAPFPS (Titan X Maxwell)
Faster R-CNN (VGG16)73.27
YOLOv2 (Darknet-19)78.640
R-FCN (ResNet-101)80.59
SSD300* (VGG16)77.246
SSD512* (VGG16)79.819
RFBNet300 (VGG16)80.583
RFBNet512 (VGG16)82.238
SSD300 (VGG)77.8150 (1080Ti)
FSSD300 (VGG)78.8120 (1080Ti)

COCO

Systemtest-dev mAPTime (Titan X Maxwell)
Faster R-CNN++ (ResNet-101)34.93.36s
YOLOv2 (Darknet-19)21.625ms
SSD300* (VGG16)25.122ms
SSD512* (VGG16)28.853ms
RetinaNet500 (ResNet-101-FPN)34.490ms
RFBNet300 (VGG16)29.915ms*
RFBNet512 (VGG16)33.830ms*
RFBNet512-E (VGG16)34.433ms*
SSD512 (HarDNet68)31.7TBD (12.9ms**)
SSD512 (HarDNet85)35.1TBD (15.9ms**)
RFBNet512 (HarDNet68)33.9TBD (16.7ms**)
RFBNet512 (HarDNet85)36.8TBD (19.3ms**)

Note: * The speed here is tested on the newest pytorch and cudnn version (0.2.0 and cudnnV6), which is obviously faster than the speed reported in the paper (using pytorch-0.1.12 and cudnnV5).

Note: ** HarDNet results are measured on Titan V with pytorch 1.0.1 for detection only (NMS is NOT included, which is 13~18ms in general cases). For reference, the measurement of SSD-vgg on the same environment is 15.7ms (also detection only).

MobileNet

SystemCOCO minival mAP#parameters
SSD MobileNet19.36.8M
RFB MobileNet20.7*7.4M

*: slightly better than the original ones in the paper (20.5).

Contents

  1. Installation
  2. Datasets
  3. Training
  4. Evaluation
  5. Models

Installation

./make.sh

Note*: Check you GPU architecture support in utils/build.py, line 131. Default is:

'nvcc': ['-arch=sm_52',
pip install git+https://github.com/szagoruyko/pyinn.git@master
conda install opencv

Note: For training, we currently support VOC and COCO.

Datasets

To make things easy, we provide simple VOC and COCO dataset loader that inherits torch.utils.data.Dataset making it fully compatible with the torchvision.datasets API.

VOC Dataset

Download VOC2007 trainval & test
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2007.sh # <directory>
Download VOC2012 trainval
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2012.sh # <directory>

COCO Dataset

Install the MS COCO dataset at /path/to/coco from official website, default is ~/data/COCO. Following the instructions to prepare minival2014 and valminusminival2014 annotations. All label files (.json) should be under the COCO/annotations/ folder. It should have this basic structure

$COCO/
$COCO/cache/
$COCO/annotations/
$COCO/images/
$COCO/images/test2015/
$COCO/images/train2014/
$COCO/images/val2014/

UPDATE: The current COCO dataset has released new train2017 and val2017 sets which are just new splits of the same image sets.

Training

mkdir weights
cd weights
wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
python train_test.py -d VOC -v RFB_vgg -s 300 

Evaluation

The test frequency can be found in the train_test.py By default, it will directly output the mAP results on VOC2007 test or COCO minival2014. For VOC2012 test and COCO test-dev results, you can manually change the datasets in the test_RFB.py file, then save the detection results and submitted to the server.

Models

Update (Sep 29, 2019)