A PyTorch implementation of Pelee: A Real-Time Object Detection System on Mobile Devices The official and original Caffe code can be found here.
I train Pelee with pytorch and the result is better than the original paper result,the pretrained model can be downloaded in peleenet.pth.
Method | 07+12 | 07+12+coco |
---|---|---|
SSD300 | 77.2 | 81.2 |
SSD+MobileNet | 68 | 72.7 |
Original Pelee | 70.9 | 76.4 |
Ours Pelee | 71.76 | --- |
the supported version is pytorch-0.4.1 or pytorch-1.0
- tqdm
- opencv
- addict
- pytorch>=0.4
- Clone this repository.
git clone https://github.com/yxlijun/Pelee.Pytorch
- Compile the nms and coco tools:
sh make.sh
- Prepare dataset (e.g., VOC, COCO), refer to ssd.pytorch for detailed instructions.
you can train different set according to configs/*,First, you should download the pretrained model peleenet.pth,then,move the file to weights/
python train.py --dataset VOC\COCO --config ./configs/Pelee_VOC.py
if you train with multi gpu
CUDA_VISIBLE_DEVICES=0,1 python train.py --dataset VOC\COCO --config ./configs/Pelee_VOC.py --ngpu 2
you can evaluate your model in voc and coco
python test.py --dataset VOC\COCO --config ./configs/Pelee_VOC.py --trained_model ./weights/Pelee_VOC.pth
you can test your image, First, download the trained model Pelee_VOC.pth file. Then, move the file to weights/.
python demo.py --dataset VOC\COCO --config ./configs/Pelee_VOC.py --trained_model ./weights/Pelee_VOC.pth --show
You can see the image with drawed boxes as: