A PyTorch implementation of Single Shot MultiBox Detector from the 2016 paper by Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang, and Alexander C. Berg. The official and original Caffe code can be found here.
-
安装或者升级最新版pytorch Install PyTorch python 3以上
-
安装可视化模块visdom(VOC数据集可用)
We now support Visdom for real-time loss visualization during training!
First install Python server and client $ pip install visdom Start the server (probably in a screen or tmux) $ python -m visdom.server Then (during training) navigate to http://localhost:8097/
# specify a directory for dataset to be downloaded into, else default is ~/data/
$ sh data/scripts/VOC2007.sh DWONLOAD_PATH
下载数据好后会自动删除压缩文件
# specify a directory for dataset to be downloaded into, else default is ~/data/
$ sh data/scripts/VOC2012.sh DWONLOAD_PATH
- 下载预训练网络参数
First download the fc-reduced VGG-16 PyTorch base network weights at: https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
By default, we assume you have downloaded the file in the ssd.pytorch/weights
dir:
$ mkdir weights
$ cd weights
$ wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
- 训练模型
To train SSD using the train script simply specify the parameters listed in train.py
as a flag or manually change them.
$ python train.py --voc_root DATASET_PATH
To evaluate a trained network:
$ python eval.py --voc_root DATASET_PATH
You can specify the parameters listed in the eval.py
file by flagging them or manually changing them.
- We are trying to provide PyTorch
state_dicts
(dict of weight tensors) of the latest SSD model definitions trained on different datasets. - Currently, we provide the following PyTorch models:
- SSD300 v2 trained on VOC0712 (newest PyTorch version)
- SSD300 v2 trained on VOC0712 (original Caffe version)
- Our goal is to reproduce this table from the original paper
- Make sure you have jupyter notebook installed.
- Two alternatives for installing jupyter notebook:
# make sure pip is upgraded
pip3 install --upgrade pip
# install jupyter notebook
pip install jupyter
# Run this inside ssd.pytorch
jupyter notebook
- Now navigate to
demo/demo.ipynb
at http://localhost:8888 (by default) and have at it!