Implementation of Spatial-aware Graph Relation Network for Large-scale Object Detection
This code is modified based on ruotianluo Faster R-CNN code.
I implement code only for Faster R-CNN / Visual Genome Dataset / Resnet101 backbone.
- Download Annotation File link --> Unzip zip file to $your_data_path/vg
- Download Visual Genome Image Files zip1 zip2 --> Unzip 2 zip files to $your_data_path/vg/JPEGImages/*.jpg
- Download Imagenet pre-trained weight for resnet 101 link --> Copy file to $your_preweight_path/
- Download trained weight of Faster RCNN link --> Copy file to $your_weight_path/FRCNN/ and use it for training SGRN module
- torch > 1.4.0
- torchvision > 0.5.0
- torch-geometric
- Train Faster RCNN
python tools/trainval_net.py --cfg "experiments/cfgs/res101.yml" --tag "FRCNN" --net "res101" --weight $your_preweight_path/res101.pth --iters 2400000
- Train SGRN
python tools/trainval_net.py --cfg "experiments/cfgs/res101_gcn.yml" --tag "SGRN" --net "SGRN" --weight "your_weight_path/FRCNN/res101_faster_rcnn_iter_1200000.pth" --iters 1200000
- Test Faster RCNN
python tools/test_net.py --cfg "experiments/cfgs/res101.yml" --model "your_weight_path/FRCNN/res101_faster_rcnn_iter_1200000.pth" --net "res101"
-
Download trained weight of SGRN link --> Copy file to $your_weight_path/SGRN/
-
Test SGRN
python tools/test_net.py --cfg "experiments/cfgs/res101_gcn.yml" --model "your_weight_path/SGRN/res101_faster_rcnn_iter_1200000.pth" --net "SGRN"
- Faster RCNN Mean Average Precision : 11.2
- Faster RCNN with SGRN Mean Average Precision : 11.5