Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Examples of Single Shot Multibox Detector [1]

Performance

PASCAL VOC2007 Test

Model Original ChainerCV (weight conversion) ChainerCV (train)
SSD300 77.5 % [2] 77.8 % 77.5 % / 77.6 % (4 GPUs)
SSD512 79.5 % [2] 79.7 % 80.1 % * / 80.5 % (4 GPUs)

Scores are mean Average Precision (mAP) with PASCAL VOC2007 metric.

*: We set batchsize to 24 because of memory limitation. The original paper used 32.

Demo

Detect objects in an given image. This demo downloads Pascal VOC pretrained model automatically if a pretrained model path is not given.

$ python demo.py [--model ssd300|ssd512] [--gpu <gpu>] [--pretrained-model <model_path>] <image>.jpg

Convert Caffe model

Convert *.caffemodel to *.npz. Some layers are renamed to fit ChainerCV. SSD300 and SSD512 are supported.

$ python caffe2npz <source>.caffemodel <target>.npz

Evaluation

The evaluation can be conducted using chainercv/examples/detection/eval_voc07.py.

Train

You can train the model with the following code. Note that this code requires cv2 module.

$ python train.py [--model ssd300|ssd512] [--batchsize <batchsize>] [--gpu <gpu>]

Note that this training process sometimes stucks due to cv2 issue. For the details and workaround, please see Chainer's Tips and FAQs.

If you want to use multiple GPUs, use train_multi.py. Note that this code requires chainermn module.

$ mpi4exec -n <#gpu> python train_multi.py [--model ssd300|ssd512] [--batchsize <batchsize>] [--test-batchsize <batchsize>]

You can download weights that were trained by ChainerCV.

References

  1. Wei Liu et al. "SSD: Single shot multibox detector" ECCV 2016.
  2. Cheng-Yang Fu et al. "DSSD : Deconvolutional Single Shot Detector" arXiv 2017.