This repo is a CUDA 12-compatible unbiased SGG benchmark.
Xianjing Han1, Xingning Dong1, Xuemeng Song1*, Tian Gan1, Yibing Zhan2, Yan Yan3, Liqiang Nie1*
1 Shandong University
2 JD Explore Academy
3 Illinois Institute of Technology
* Corresponding author
- [04/2026] Benchmark and code upgraded for compatibility with recent CUDA 12 versions
- [06/2022] Initial release
- Overview
- Install the Requirements
- Prepare the Dataset
- Training on Scene Graph Generation
- Evaluation on Scene Graph Generation
- Citations
This paper proposes a Divide-and-Conquer Predictor (DCNet) for scene graph generation that splits predicate prediction into a general pattern classification stage and multiple specific predicate classifiers, aiming to better distinguish visually similar relations.
There are three standard protocols: (1) Predicate Classification (PredCls): taking ground truth bounding boxes and labels as inputs, (2) Scene Graph Classification (SGCls) : using ground truth bounding boxes without labels, (3) Scene Graph Detection (SGDet): detecting SGs from scratch. We use two switches MODEL.ROI_RELATION_HEAD.USE_GT_BOX and MODEL.ROI_RELATION_HEAD.USE_GT_OBJECT_LABEL to select the protocols.
For Predicate Classification (PredCls) on our DCNet:
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --master_port 10025 --nproc_per_node=2 tools/relation_train_net.py --config-file "configs/e2e_relation_X_101_32_8_FPN_1x.yaml" MODEL.ROI_RELATION_HEAD.USE_GT_BOX True MODEL.ROI_RELATION_HEAD.USE_GT_OBJECT_LABEL True MODEL.ROI_RELATION_HEAD.PREDICTOR HierMotifsE2E SOLVER.IMS_PER_BATCH 12 TEST.IMS_PER_BATCH 2 DTYPE "float16" SOLVER.MAX_ITER 50000 SOLVER.VAL_PERIOD 2000 SOLVER.CHECKPOINT_PERIOD 2000 GLOVE_DIR /data/xianjing/others/vg MODEL.PRETRAINED_DETECTOR_CKPT /data/xianjing/others/vg/pretrained_faster_rcnn/model_final.pth OUTPUT_DIR /home/xianjing/sgg/checkpoints/DCNet-preclsFor Scene Graph Classification (SGCls) on our DCNet:
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --master_port 10025 --nproc_per_node=2 tools/relation_train_net.py --config-file "configs/e2e_relation_X_101_32_8_FPN_1x.yaml" MODEL.ROI_RELATION_HEAD.USE_GT_BOX True MODEL.ROI_RELATION_HEAD.USE_GT_OBJECT_LABEL False MODEL.ROI_RELATION_HEAD.PREDICTOR HierMotifsE2E SOLVER.IMS_PER_BATCH 12 TEST.IMS_PER_BATCH 2 DTYPE "float16" SOLVER.MAX_ITER 50000 SOLVER.VAL_PERIOD 2000 SOLVER.CHECKPOINT_PERIOD 2000 GLOVE_DIR /data/xianjing/others/vg MODEL.PRETRAINED_DETECTOR_CKPT /data/xianjing/others/vg/pretrained_faster_rcnn/model_final.pth OUTPUT_DIR /home/xianjing/sgg/checkpoints/DCNet-sgclsFor Scene Graph Detection (SGDet) on our DCNet:
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --master_port 10025 --nproc_per_node=2 tools/relation_train_net.py --config-file "configs/e2e_relation_X_101_32_8_FPN_1x.yaml" MODEL.ROI_RELATION_HEAD.USE_GT_BOX False MODEL.ROI_RELATION_HEAD.USE_GT_OBJECT_LABEL False MODEL.ROI_RELATION_HEAD.PREDICTOR HierMotifsE2E SOLVER.IMS_PER_BATCH 12 TEST.IMS_PER_BATCH 2 DTYPE "float16" SOLVER.MAX_ITER 50000 SOLVER.VAL_PERIOD 2000 SOLVER.CHECKPOINT_PERIOD 2000 GLOVE_DIR /data/xianjing/others/vg MODEL.PRETRAINED_DETECTOR_CKPT /data/xianjing/others/vg/pretrained_faster_rcnn/model_final.pth OUTPUT_DIR /home/xianjing/sgg/checkpoints/DCNet-sgdetThe cloud links of checkpoints: Google Drive.
The code is implemented based on Scene-Graph-Benchmark.pytorch.
@article{han2022divide,
title={Divide-and-conquer predictor for unbiased scene graph generation},
author={Han, Xianjing and Dong, Xingning and Song, Xuemeng and Gan, Tian and Zhan, Yibing and Yan, Yan and Nie, Liqiang},
journal={IEEE Transactions on Circuits and Systems for Video Technology},
volume={32},
number={12},
pages={8611--8622},
year={2022},
publisher={IEEE}
}