Hysen Labs
Open-source project
ruoqianguo/FPN_Pytorch avatar
ruoqianguo

FPN_Pytorch

Base jwyang/fpn.pytorch, train FPN on Pascal VOC get 80.5 mAP

100 stars19 forksPythonMIT
01
DEEP OPEN-SOURCE ANALYSIS

FPN_Pytorch, a tuned feature pyramid network

A PyTorch feature pyramid network for object detection, forked from jwyang's repository with stride and anchor fixes that push Pascal VOC mAP higher.

02
DEEP OPEN-SOURCE ANALYSIS

A fork with a purpose

FPN_Pytorch is a PyTorch implementation of the Feature Pyramid Network for object detection, based on jwyang's fpn.pytorch. The README says the author changed a little code to get a more reasonable mean average precision when training on Pascal VOC 2007 and the combined 07 plus 12 datasets. It inherits the base repository's structure, so the original README still applies as reference.

03
DEEP OPEN-SOURCE ANALYSIS

The change that mattered

The main modification was changing the stride of ResNet layer4 from 2 to 1. The README explains that anchor position and count are calculated from stride in this code, so a wrong stride value pushes anchors outside the image. With the default feature strides, p5 and p6 end up with about three quarters of their anchors generated outside the image. Fixing the stride repositions the anchors, and a couple of smaller changes, like switching loge to log2 in the pyramid ROI features, round out the fork.

04
DEEP OPEN-SOURCE ANALYSIS

Benchmarking numbers

A benchmarking table records the training setup and results. One row shows a Res-101 model on a single GTX 1080 Ti with batch size 2, learning rate 1e-3, max epoch 12, about 0.22 hours per epoch, 6137MB per GPU, and an mAP of 75.7. A second row at batch size 1 reports 9011MB per GPU and an mAP of 80.5, the number the project description leads with.

05
DEEP OPEN-SOURCE ANALYSIS

Getting the data ready

Data preparation follows external guides. For VOC2007, the README points to the py-faster-rcnn instructions, and for VOC 07 plus 12, to the py-R-FCN instructions, which the author found more helpful. After downloading, you create softlinks in the data folder, with separate handling for the two dataset setups. The data prep is the prerequisite for the training the benchmark table describes.

06
DEEP OPEN-SOURCE ANALYSIS

Editorial conclusion

The README is honest about being a fork with a handful of changes, the biggest being the ResNet layer4 stride fix that repositions anchors. The benchmarking table shows the payoff, and the data prep notes are practical.

07
DEEP OPEN-SOURCE ANALYSIS

Official sources

08
Community notes

Community notes