This repository is not maintained. Please use ChainerCV.
This is an implementation of FPN (Feature Pyramid Networks) using Chainer
mmAP on COCO 2014 minival
backbone | original (Detectron) | ours (inference only) | ours (train & inference) |
---|---|---|---|
ResNet50 | 36.7 % | 35.7 % | 37.1 % |
ResNet101 | 39.4 % | 38.2 % | 39.5 % |
- Python 3.6
- Chainer 4.0+
- CuPy 4.0+
- ChainerCV (we need to build from master branch)
- ChainerMN 1.3
- pycocotools
$ curl -LO https://github.com/Hakuyume/chainer-fpn/releases/download/assets/faster_rcnn_fpn_resnet50_coco.npz
$ python3 demo.py [--gpu <gpu>] --model resnet50 --pretrained-model faster_rcnn_fpn_resnet50_coco.npz <image>
$ mpiexec -n <#gpu> python3 train_coco.py --model resnet50
Our experiments were conducted with 8 GPUs.
$ python3 eval_coco.py [--gpu <gpu>] --model resnet50 --pretrained-model faster_rcnn_fpn_resnet50_coco.npz
or
$ python3 eval_coco.py [--gpu <gpu>] --model resnet50 --snapshot result/snapshot_iter_90000
- Download weights from Detectron's model zoo.
$ curl -L https://s3-us-west-2.amazonaws.com/detectron/35857345/12_2017_baselines/e2e_faster_rcnn_R-50-FPN_1x.yaml.01_36_30.cUF7QR7I/output/train/coco_2014_train%3Acoco_2014_valminusminival/generalized_rcnn/model_final.pkl -o e2e_faster_rcnn_R-50-FPN_1x.pkl
$ curl -L https://s3-us-west-2.amazonaws.com/detectron/35857890/12_2017_baselines/e2e_faster_rcnn_R-101-FPN_1x.yaml.01_38_50.sNxI7sX7/output/train/coco_2014_train%3Acoco_2014_valminusminival/generalized_rcnn/model_final.pkl -o e2e_faster_rcnn_R-101-FPN_1x.pkl
- Convert weights.
$ python3 detectron2npz.py e2e_faster_rcnn_R-50-FPN_1x.pkl faster_rcnn_fpn_resnet50_coco.npz
Note: Since the mean value in Detectron is different from that in ChainerCV,
--mean=detectron
option should be specified for converted weights.
$ python3 eval_coco.py [--gpu <gpu>] --model resnet50 --mean=detectron --pretrained-model faster_rcnn_fpn_resnet50_coco.npz
- Tsung-Yi Lin et al. "Feature Pyramid Networks for Object Detection" CVPR 2017
- Detectron
- Mask R-CNN by @wkentaro (for the implementation of RoIAlign)