This repository provides the official PyTorch implementation for paper: Parallel Feature Pyramid Network for Object Detection by Seung-Wook Kim.
Note: PFPNet is originally implemented on Caffe. Following Caffe version, we re-implemented Pytorch version.
-
Install PyTorch by selecting your environment on the website and running the appropriate command. Note: We experiment on Pytorch 1.4
-
Clone this repository.
-
Then download the dataset by following the instructions below.
-
We now support Tensorboard for real-time loss visualization and validation during training!
Currently, we only provide PFPNet of Pascal VOC version.
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>
- 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
PFPNet.pytorch/weights
dir:
mkdir weights
cd weights
wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
- Use the following script below to train network .
python main.py --mode 'train' --dataset 'VOC' --save_folder 'weights/' --basenet './weights/vgg16_reducedfc.pth'
- Note:
- For training, an NVIDIA GPU is strongly recommended for speed.
- For instructions on Tensorboard usage/installation, see the Installation section.
- You can pick-up training from a checkpoint by specifying the path as one of the training parameters (again, see
main.py
for options)
Note: COCO version and PFPNet512 are unavailable.
To evaluate a trained network:
python main.py --mode 'test' --dataset 'VOC' --save_folder 'weights/' --test_model 'weights/PFPNetR320.pkl'
You can specify the parameters listed in the main.py
file by flagging them or manually changing them.
VOC2007
mAP
PFP320 | Paper version (Implemented by Caffe) | Pytorch version |
---|---|---|
mAP | 80.7 | 80.7 |
FPS | 33 | 41 |
PFPNetR320: https://drive.google.com/file/d/1xEcdMGgmPNyopeNHEhTWQAbjFhl1LHAY/view?usp=sharing
- Original Implementation (CAFFE)
- A list of other great SSD ports that were sources of inspiration: