By Haodong Pan, Jue Jiang, Guangfeng Chen
This is the code for our accepted manuscript in Signal Processing: Image Communication. In brief, this is a SSD based approach for object detection across different scales.
If you use this code, please cite our paper.
Python3.6, PyTorch0.4.1, and NVIDIA GPUs
- Install PyTorch-0.4.1 depending on your environment refering to https://pytorch.org/.
- Clone this repository. This repository is mainly based on RFBNet, ssd.pytorch, Chainer-ssd and PytorchSSD, a huge thank to them.
- Compile the nms and coco tools:
./make.sh
Check your GPU architecture support in utils/build.py, line 131. Default is:
'nvcc': ['-arch=sm_61',
Then download the dataset by following the instructions below and install opencv.
conda install opencv
For convenience, we provide simple VOC and COCO dataset loader.
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2007.sh # <directory>
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2012.sh # <directory>
Install the MS COCO dataset at /path/to/coco from official website, default is ~/data/COCO. It should have this basic structure
$COCO/
$COCO/annotations/
$COCO/cache/
$COCO/cocoapi/
$COCO/images/
$COCO/test2017/
$COCO/train2017/
$COCO/val2017/
- Download the fc-reduced VGG-16 PyTorch base network weights at our BaiduYun Driver PW:1234
- The modified resnet-101 PyTorch base network weights file is available at our BaiduYun Driver PW:1234
- Place the weights files in 'TDFSSD/weights'
- To train TDFSSD with the following command:
python train_test.py -d VOC -s 300 -we 6
- Note:
- -d: datasets, VOC or COCO
- -s: image size, 300 or 512
- -we: warm epoch
- 'resnet_trian_test.py' is used for training with the resnet as backbone
- The detail options can be found in the 'train_test.py' and 'resnet_trian_test.py'
To evaluate a trained network with 'test.py' or 'eval.py'