Forked from PyTorch-SSD, which is 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.
# First install Python server and client
pip install visdom
# Start the server (probably in a screen or tmux)
python -m visdom.server
To make things easy, we provide bash scripts to handle the dataset downloads and setup for you. We also provide simple dataset loaders that inherit torch.utils.data.Dataset
, making them fully compatible with the torchvision.datasets
API.
Microsoft COCO: Common Objects in Context
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/COCO2014.sh
PASCAL VOC: Visual Object Classes
# 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>
ssd.pytorch/weights
dir:mkdir weights
cd weights
wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
train.py
as a flag or manually change them.python train.py
train.py
for options)To evaluate a trained network:
python eval.py
You can specify the parameters listed in the eval.py
file by flagging them or manually changing them.
SSD:
SSD + repulsion loss:
Method | mAP | mAP on Crowd |
---|---|---|
SSD | 77.52% | 48.24% |
SSD+RepGT | 77.43% | 50.12% |
state_dicts
(dict of weight tensors) of the latest SSD model definitions trained on different datasets.
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
demo/demo.ipynb
at http://localhost:8888 (by default) and have at it!cv2.waitkey
for optimal fps) or on an NVIDIA GPUdemo/live.py
pip install imutils
python -m demo.live
opens the webcam and begins detecting!We have accumulated the following to-do list, which we hope to complete in the near future