Aveouter/Open_Sence_Graph_Generation

Python

1

276 commits

updated Oct 10, 2026

See the code

README

OpenSGG β€” Open Scene Graph Generation

Modular PyTorch Lightning framework for Scene Graph Generation. Unifies 17 SGG methods under a single training and evaluation harness.

Python PyTorch Lightning CUDA CI License


Overview

OpenSGG provides a unified training and evaluation framework for Scene Graph Generation models across three standard modes (SGDet, SGCLS, PredCLS), with Recall@K / mean Recall@K metrics and Head/Body/Tail predicate breakdowns.

  • πŸ”Œ 17 SGG methods β€” from classic two-stage baselines to modern end-to-end transformers
  • ⚑ PyTorch Lightning β€” clean training loop, DDP, checkpoint management, FP16 mixed precision
  • πŸ“Š Unified evaluation β€” standard R@K, mR@K, and Head/Body/Tail breakdowns
  • 🧩 Modular β€” drop in new models, losses, and datasets with minimal friction
  • πŸ€– CI/CD β€” GitHub Actions pipeline with smoke tests and LLM-based code review

Supported Methods

MethodVenueTypeCLI NameDescription
RelTRECCV 2022End-to-endRelTRRelation Transformer β€” triplet-query-based SGG with Hungarian matching
EGTRCVPR 2024End-to-endEGTRDeformable DETR backbone + lightweight relation head
FlowSGCVPR 2026End-to-endFlowSGFlow matching with CLIP ViT-B/16, slotwise VQ-VAE, and DiT-style graph transformer
USG-ParCVPR 2025End-to-endUSGUniversal Scene Graph Parser β€” learnable queries + RPC + transformer decoder
Neural MotifsCVPR 2018Two-stageMotifsLSTM-based global context for object and predicate prediction
VCTreeCVPR 2019Two-stageVCTreeDynamic tree-structured object context encoding
TDECVPR 2020Two-stageTDETotal Direct Effect causal debiasing (built on Motifs)
IMPCVPR 2017Two-stageIMPIterative Message Passing for graph refinement
TransformerCVPR 2020Two-stageTransformerTransformer-based context predictor for two-stage SGG
GPS-NetCVPR 2020Two-stageGPSNetGraph Property Sensing Network for relation proposal
PE-NetCVPR 2023Two-stagePENetPrototype-based Embedding Network with hierarchical alignment
REACTBMVC 2025Two-stageREACTPrototype-regularized efficient SGG with composition analysis
SHA-GCLCVPR 2022Two-stageSHAGCLHybrid attention with group collaborative learning
SQUATCVPR 2023Two-stageSQUATSelective quad attention for edge modeling
HSTRNetβ€”Two-stageHSTRNetHierarchical prototype relation learning with temporal encoding
CVCβ€”Two-stageCVCCompositionally Verified Concept relation head with adversarial debiasing

Planned Reproductions

WorkPublicationOfficial codeScopeOpenSGG status
RelateAnything: Real-Time Open-Vocabulary Relation Prediction From Any InputsarXiv 2026Maelic/RelateAnythingPredicts relations from images and supplied object regions with an inference-time predicate vocabularyCode port and inference parity verified; full reproduction not_reproduction_ready; issue #124

RelateAnything is registered for checkpoint-backed supplied-region prediction and gated A1/A3 evaluation. Its complete relation model is ported from the Apache source parent recorded in ADR 0013. Use the isolated runtime and CLI instructions. Official API comparison has passed with released weights; full benchmark reproduction remains not_reproduction_ready. Its separate region metrics must be audited before comparison with SGDet / SGCls / PredCls results.


Installation

git clone https://github.com/Aveouter/Open_Sence_Graph_Generation.git
cd OpenSGG

# Create conda environment
conda env create -f environment.yml
conda activate hsg

# Install PyTorch (adjust for your CUDA version)
# CUDA 11.8:
pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118
# CUDA 12.1:
# pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu121

If Tsinghua mirror channels in environment.yml are inaccessible, replace them with defaults and conda-forge, or remove the channels section to use your local .condarc.

Docker

For a containerized GPU setup, see Docker Environment.

docker build -t opensgg:dev .
docker run --rm -it --gpus all --ipc=host --shm-size=16g \
  -v "$PWD":/workspace/OpenSGG \
  -v "$PWD/data":/workspace/OpenSGG/data \
  -v "$PWD/outputs":/workspace/OpenSGG/outputs \
  opensgg:dev bash

For a Compose workflow, use docker compose run --rm opensgg bash for CPU checks or add -f compose.gpu.yaml for GPU runs.

DependencyVersion
Python≀ 3.10
PyTorchβ‰₯ 1.10
CUDAβ‰₯ 11.3 (GPU)
PyTorch Lightning2.x
Transformersβ‰₯ 4.18.0

Data Preparation

VisualGenome

  1. Download VisualGenome images (parts 1–2) from visualgenome.org
  2. Place images under data/VisualGenome/images/
  3. Provide COCO-format train.json, val.json, test.json, and rel.json under data/VisualGenome/
  4. Optional analysis assets such as clip_prototypes.pth and predicate_frequencies.json can live in the same directory

OpenImageV6 (Experimental)

Place COCO-format annotations and images under data/OpenImage/.


Quick Start

Training

python train.py --method EGTR --dataname VisualGenome --gpus 0 --batch_size 4

Replace EGTR with any supported CLI method name. Config files are auto-loaded from configs/<Dataset>/<Method>.py, and CLI arguments override config values.

Evaluation

python train.py --test --method EGTR --dataname VisualGenome \
  --ckpt_path outputs/pretrained/egtr/<run>/checkpoints/epoch=03-*.ckpt --gpus 0

Multi-GPU

# DDP with 4 GPUs
python train.py --method RelTR --dataname VisualGenome --gpus 0 1 2 3 --dist

# Single GPU (no DDP overhead)
python train.py --method RelTR --dataname VisualGenome --gpus 0

VisualGenome Paper Results

2025–2026 literature scope and code filter

Last checked: 2026-09-22. This survey covers static-image scene graph generation on Visual Genome (VG150) and Open Images (the OpenImageV6 dataset in this repository). It screens CVPR, ICCV, ECCV, ICLR, ICML, NeurIPS, AAAI, IJCAI and ACM MM main papers, and TPAMI, IJCV, TIP and TMM articles; JAS is included as a related journal. The date refers to the publication venue, not the first arXiv upload. This is a dated search snapshot, with unresolved sources listed explicitly, rather than a claim of complete coverage of 2026.

The methods below have public author GitHub repositories containing source code, not just a project page or a promise to release code. Source availability does not establish checkpoint availability, complete implementation of every paper variant, or OpenSGG reproduction. These methods are literature references; they are not additions to the CLI's Supported Methods.

MethodPublicationAuthor GitHubVG / Open Images evidence
HQSGCVPR 2025HQSGVG SGDet, Table 1; no OI table in the inspected paper
RA-SGGAAAI 2025torch-rasggVG three tasks, Table 1; no OI table in the inspected paper
RAHPAAAI 2025RAHPVG open-vocabulary Tables 1/3; OI V6 Table 2
NoDISICML 2025NoDISVG Table 1; OI V4/V6 Table 2
VL-IRMICCV 2025VL-IRMVG open-vocabulary Tables 1/2/4; OI V6 Table 3
ACCNeurIPS 2025ACCVG open-vocabulary Tables 1/2; filtered test set
MCLTIP 2025G-USGGVG/OI stated by authors; final journal tables not retrieved; numbers withheld
GCMTPAMI, online 2025 / issue 2026GCMVG/OI V6 code and instructions; final journal tables not retrieved; numbers withheld
APTICLR 2026APTVG Tables 2/3; OI V6 Tables 8/9; component code released, integration and OI protocol need audit
HSGGICML 2026HSGGVG150 in author code; primary PDF retrieval blocked; numbers withheld
BiRefJAS 2026BiRefVG/OI stated by journal; numerical full text not retrieved; numbers withheld

See the source and exclusion ledger for paper titles, implementation evidence, search coverage, missing results and excluded candidates, including README-only repositories and code mismatches.

All following values are paper-reported percentages, not local evaluation results. a / b means @50 / @100; NR means not reported in the cited table. Different detectors, supervision, splits and postprocessing prevent treating these tables as a common leaderboard. We retain each paper's precision.

Closed-vocabulary VG150: SGDet

Method / paper variantDetector or architectureR@50 / 100mR@50 / 100Original source
HQSGOne-stage, ResNet-10134.1 / 38.316.0 / 20.5Table 1
RA-SGGPE-Net, Faster R-CNN / ResNeXt-101-FPN26.0 / 30.314.4 / 17.1Table 1
VTransE + NoDISTwo-stage, Faster R-CNN27.96 / 31.9713.77 / 15.83Table 1
Motifs + NoDISTwo-stage, Faster R-CNN30.91 / 35.4213.58 / 16.35Table 1
Transformer + NoDISTwo-stage, Faster R-CNN25.26 / 28.7716.91 / 19.25Table 1
PE-Net + NoDISTwo-stage, Faster R-CNN23.16 / 26.9514.78 / 17.16Table 1
Motif + APTPaper's two-stage variant33.3 / 37.69.2 / 10.3Table 2
HQSG + APTPaper's one-stage variant36.5 / 39.918.2 / 21.7Table 2

APT rows are representative variants from its own table. Released prompt components do not establish that all these integrations can be run from the repository. See the APT caveats.

Closed-vocabulary VG150: PredCls and SGCls

Method / variantPredCls R@50 / 100PredCls mR@50 / 100SGCls R@50 / 100SGCls mR@50 / 100Source
RA-SGG62.2 / 64.136.2 / 39.138.2 / 39.120.9 / 22.5Table 1
VTransE + NoDIS57.83 / 59.7435.68 / 38.0438.84 / 39.9620.83 / 22.14Table 1
Motifs + NoDIS62.72 / 64.9833.83 / 36.4836.46 / 37.4822.68 / 24.35Table 1
Transformer + NoDIS49.96 / 53.2137.25 / 39.9734.42 / 35.6321.53 / 23.35Table 1
PE-Net + NoDIS50.13 / 53.8738.72 / 41.9330.65 / 32.1922.31 / 23.69Table 1
Motif + APT66.5 / 68.217.4 / 18.140.3 / 40.810.5 / 11.1Table 2
HQSG + APT58.7 / 61.235.1 / 37.337.7 / 38.321.9 / 22.7Table 2

RA-SGG's author implementation uses relation NMS for PredCls/SGCls. Do not compare these tasks with SGDet, which must also predict the object boxes.

Open-vocabulary VG150: unseen relations (OvR)

Total evaluates base + novel predicates; Novel evaluates novel predicates. The split source and task are part of each result's identity. Equal novel percentages alone do not establish identical category lists or evaluation sets.

Method / variantTask; novel predicate splitTotal R@50 / 100Total mR@50 / 100Novel R@50 / 100Novel mR@50 / 100Source
SGTR† + RAHPPredCls; EPIC, 30%39.92 / 46.0316.88 / 22.1815.46 / 20.3711.82 / 15.46Table 1
PE-Net + RAHPPredCls; EPIC, 30%64.70 / 69.1124.50 / 28.2520.79 / 29.0015.70 / 23.73Table 1
OvSGTR + RAHPSGDet; OvSGTR, 30%21.50 / 25.744.51 / 5.3715.59 / 19.923.01 / 4.04Table 1
VL-IRM (Ours)SGDet; PGSG, 50%13.7 / 19.77.5 / 10.610.1 / 14.35.2 / 7.5Table 1
VL-IRM (Ours*)SGDet; OvSGTR, 30%14.3 / 20.48.7 / 12.79.0 / 12.6NRTable 1
OvSGTR + VL-IRM (Ours*)SGDet; OvSGTR, 30%; extra pretraining21.1 / 25.04.2 / 4.914.2 / 17.7NRTable 1
VL-IRMPredCls; PGSG, 50%27.8 / 37.511.1 / 14.511.9 / 18.35.9 / 8.2Table 2
ACC, Swin-TSGDet; 30%; ACC filtered test set23.22 / 27.40NR17.89 / 21.70NRTable 1
ACC, Swin-BSGDet; 30%; ACC filtered test set24.81 / 29.28NR20.04 / 24.66NRTable 1

RAHP's † denotes its adapted SGTR variant. ACC evaluates 14,700 VG test images after removing overlap with GroundingDINO pretraining data. Its results must not be compared directly with full-test-set rows. Use ACC's NeurIPS paper; the repository's older INOVA link is not the source of these numbers.

Open-vocabulary VG150: unseen objects and relations (OvD+R)

Method / variantTotal R@50 / 100Novel-object R@50 / 100Novel-relation R@50 / 100Source
VS3 + RAHP, Swin-T12.66 / 15.3913.01 / 14.823.75 / 5.12Table 3
OvSGTR + RAHP, Swin-T13.83 / 16.5212.45 / 15.3813.31 / 16.46Table 3
OvSGTR-T + VL-IRM14.87 / 18.27NR12.27 / 15.26Table 4
ACC, Swin-T, filtered test set17.43 / 21.2717.16 / 21.1015.90 / 19.46Table 2
ACC, Swin-B, filtered test set18.88 / 23.1918.84 / 23.2917.50 / 21.73Table 2

Historical SGDet reference (before 2025)

The table below summarizes paper-reported Visual Genome SGDet results, not OpenSGG reproduction results. Values are percentages under graph-constraint evaluation when reported by the cited paper table. Source: EGTR Table 1, with each row attributed to the corresponding original method paper. In that table, LA denotes the logit adjustment setting proposed by SSR-CNN.

MethodPaper / VenueDetector / backbone in paperAPR@20R@50R@100mR@20mR@50mR@100
IMPCVPR 2017Faster R-CNN / ResNeXt-101-FPN28.118.125.931.22.84.25.4
Neural MotifsCVPR 2018Faster R-CNN / ResNeXt-101-FPN28.125.132.136.94.15.56.8
VCTreeCVPR 2019Faster R-CNN / ResNeXt-101-FPN28.124.831.836.14.96.67.7
VCTree-TDECVPR 2020Faster R-CNN / ResNeXt-101-FPN28.114.019.423.26.99.311.1
GPS-NetCVPR 2020Faster R-CNN / ResNeXt-101-FPN--31.135.9-6.78.6
RelTRTPAMI 2023DETR-5026.421.227.5-6.810.8-
EGTRCVPR 2024Deformable DETR-5030.823.530.234.35.57.910.1
EGTR + logit adjustmentCVPR 2024Deformable DETR-5030.815.718.720.512.117.821.7

This historical table is retained for context; it is outside the 2025–2026 selection window.

Open Images Paper Results

Closed-vocabulary SGDet: weighted mAP protocol

The weighted score is 0.2 Γ— R@50 + 0.4 Γ— wmAP_rel + 0.4 Γ— wmAP_phr. Relation detection matches both object boxes; phrase detection matches their union box. OI V4 and V6 are different benchmarks and are kept in separate rows.

MethodDatasetR@50mR@50wmAP_relwmAP_phrWeighted scoreSource
Transformer + NoDISOI V474.8470.3438.2142.3547.19Table 2
Transformer + NoDISOI V674.1148.9338.8738.9545.95Table 2

Open-vocabulary OI V6: recall protocol

Both papers follow the PGSG split for OI; these are recall results, not weighted mAP scores. The RAHP adaptation and VL-IRM use different architectures and training, so the shared split is not an otherwise controlled comparison.

Method / variantTaskTotal R@50 / 100Total mR@50 / 100Novel R@50 / 100Novel mR@50 / 100Source
SGTR† + RAHP, ResNet-101SGDet62.42 / 64.8630.79 / 34.4649.61 / 56.2829.43 / 34.16Table 2
VL-IRM, GLIPSGDet46.3 / 59.419.8 / 24.614.6 / 18.74.5 / 10.1Table 3

APT's OI V6 appendix: separate protocol pending clarification

Protocol mismatch: APT Β§4.1 specifies 288 entity classes, 30 relations and 5,322 test images; Appendix B specifies 301 objects, 31 predicates and 6,322 test images. Its Table 8 reports recall rather than weighted mAP. Preserve the published values below as a separate literature record until this discrepancy and the released integrations are clarified.

Paper variantTaskR@50 / 100mR@50 / 100Source
Motif + APTPredCls67.0 / 68.617.6 / 18.5Table 8
Motif + APTSGCls40.5 / 41.010.6 / 11.3Table 8
Motif + APTSGDet33.7 / 38.09.3 / 10.5Table 8
SGTR + APTSGDet33.7 / 37.013.1 / 15.0Table 8

MCL, GCM and BiRef have public code and OI-related author evidence, but verified final-paper numbers are still missing from this survey. Missing data is not a zero score. No results here are labeled as an OpenSGG baseline reproduction.


Configuration

Configs use a two-layer system: CLI arguments override per-method config files.

ParameterDescriptionDefault
methodModel methodHSTRNet
datanameDataset (VisualGenome / OpenImageV6)VisualGenome
batch_sizeTraining batch size4
dataset_sizeTrain subset size (smoke tests)None
epochMax training epochs200
no_progress_barDisable train/validation/test progress barsFalse
lr / lr_backboneLearning rate (model / backbone)1e-4 / 1e-5
backboneCNN backboneresnet50
hidden_dimTransformer hidden dim256
enc_layers / dec_layersEncoder / decoder layers6
num_entities / num_tripletsQuery counts (RelTR)100 / 200
entity_nums / rel_numsClasses + background151 / 51

Evaluation Metrics

FormatExampleDescription
sgdet_R@Ksgdet_R@50SGDet Recall@K
sgdet_mR@Ksgdet_mR@50SGDet mean Recall@K
sgcls_R@Ksgcls_R@20SGCLS Recall@K
sgcls_mR@Ksgcls_mR@20SGCLS mean Recall@K
predcls_R@Kpredcls_R@50PredCLS Recall@K
predcls_mR@Kpredcls_mR@20PredCLS mean Recall@K

Modes: SGDet (boxes + labels + predicates from raw images) Β· SGCLS (boxes given, predict labels + predicates) Β· PredCLS (boxes + labels given, predict predicates)


Reports And Guides

  • 2025–2026 SGG Literature Audit β€” primary sources, public-code screening, VG/Open Images protocol caveats, and unresolved candidates.
  • Published Method Checkpoint Evaluations β€” concise PR-ready summary of traced checkpoint-backed OpenSGG evaluation results for published paper methods.
  • Adding A New Model β€” step-by-step contributor guide for integrating a new method into the main training and evaluation pipeline.
  • Reproduction Workflow Usage β€” evidence-first workflow for deciding whether a baseline is reproduced, audited, smoke-tested, or deferred.
  • Baseline Reproduction Workflow β€” current reproduction standard, deferred audit matrix, and evidence gates.
  • Contributing β€” PR expectations, validation commands, and repository hygiene rules.
  • Security Policy β€” private reporting path for dependency, checkpoint-loading, credential, and CI-token issues.

Community Resources


CI/CD Pipeline

GitHub Actions runs on every PR and push to main:

  • Validation β€” AST registration checks plus the unit test suite
  • Smoke tests β€” forward pass + loss convergence on all 17 methods with synthetic data
  • LLM code review β€” automated review via Claude/DeepSeek API on changed files

Trigger paths include code, configs, tools, tests, reproduction guardrails, reproduction reports, AGENTS.md, CONTRIBUTING.md, CONTEXT.md, and workflow files.

The test suite includes tools/reproduction/check_repository_boundary.py, which keeps research-only work out of this repository. See AGENTS.md for the rule.

PRs that touch reproduction claims must preserve the status language in AGENTS.md and reproduction/README.md; random-init, tiny-slice, all-zero, or partial-checkpoint outputs are not baseline reproduction evidence.


How to Add a New Method

See Adding A New Model for the complete model, method wrapper, config, registry, CLI, metric, and smoke-test checklist.


License

MIT License β€” see LICENSE.


Citation

To be added.

Please also cite the original papers for any methods you use: RelTR (ECCV 2022), EGTR (CVPR 2024), FlowSG (CVPR 2026), USG-Par (CVPR 2025), Neural Motifs (CVPR 2018), VCTree (CVPR 2019), TDE (CVPR 2020), IMP (CVPR 2017), Transformer (CVPR 2020), GPS-Net (CVPR 2020), PE-Net (CVPR 2023), REACT (BMVC 2025), SHA-GCL (CVPR 2022), SQUAT (CVPR 2023).


Built by the CIGIT HPC Lab team and open-source contributors.

Aveouter/Open_Sence_Graph_Generation

Python

1

276 commits

updated Oct 10, 2026

See the code

README

OpenSGG β€” Open Scene Graph Generation

Modular PyTorch Lightning framework for Scene Graph Generation. Unifies 17 SGG methods under a single training and evaluation harness.

Python PyTorch Lightning CUDA CI License


Overview

OpenSGG provides a unified training and evaluation framework for Scene Graph Generation models across three standard modes (SGDet, SGCLS, PredCLS), with Recall@K / mean Recall@K metrics and Head/Body/Tail predicate breakdowns.

  • πŸ”Œ 17 SGG methods β€” from classic two-stage baselines to modern end-to-end transformers
  • ⚑ PyTorch Lightning β€” clean training loop, DDP, checkpoint management, FP16 mixed precision
  • πŸ“Š Unified evaluation β€” standard R@K, mR@K, and Head/Body/Tail breakdowns
  • 🧩 Modular β€” drop in new models, losses, and datasets with minimal friction
  • πŸ€– CI/CD β€” GitHub Actions pipeline with smoke tests and LLM-based code review

Supported Methods

MethodVenueTypeCLI NameDescription
RelTRECCV 2022End-to-endRelTRRelation Transformer β€” triplet-query-based SGG with Hungarian matching
EGTRCVPR 2024End-to-endEGTRDeformable DETR backbone + lightweight relation head
FlowSGCVPR 2026End-to-endFlowSGFlow matching with CLIP ViT-B/16, slotwise VQ-VAE, and DiT-style graph transformer
USG-ParCVPR 2025End-to-endUSGUniversal Scene Graph Parser β€” learnable queries + RPC + transformer decoder
Neural MotifsCVPR 2018Two-stageMotifsLSTM-based global context for object and predicate prediction
VCTreeCVPR 2019Two-stageVCTreeDynamic tree-structured object context encoding
TDECVPR 2020Two-stageTDETotal Direct Effect causal debiasing (built on Motifs)
IMPCVPR 2017Two-stageIMPIterative Message Passing for graph refinement
TransformerCVPR 2020Two-stageTransformerTransformer-based context predictor for two-stage SGG
GPS-NetCVPR 2020Two-stageGPSNetGraph Property Sensing Network for relation proposal
PE-NetCVPR 2023Two-stagePENetPrototype-based Embedding Network with hierarchical alignment
REACTBMVC 2025Two-stageREACTPrototype-regularized efficient SGG with composition analysis
SHA-GCLCVPR 2022Two-stageSHAGCLHybrid attention with group collaborative learning
SQUATCVPR 2023Two-stageSQUATSelective quad attention for edge modeling
HSTRNetβ€”Two-stageHSTRNetHierarchical prototype relation learning with temporal encoding
CVCβ€”Two-stageCVCCompositionally Verified Concept relation head with adversarial debiasing

Planned Reproductions

WorkPublicationOfficial codeScopeOpenSGG status
RelateAnything: Real-Time Open-Vocabulary Relation Prediction From Any InputsarXiv 2026Maelic/RelateAnythingPredicts relations from images and supplied object regions with an inference-time predicate vocabularyCode port and inference parity verified; full reproduction not_reproduction_ready; issue #124

RelateAnything is registered for checkpoint-backed supplied-region prediction and gated A1/A3 evaluation. Its complete relation model is ported from the Apache source parent recorded in ADR 0013. Use the isolated runtime and CLI instructions. Official API comparison has passed with released weights; full benchmark reproduction remains not_reproduction_ready. Its separate region metrics must be audited before comparison with SGDet / SGCls / PredCls results.


Installation

git clone https://github.com/Aveouter/Open_Sence_Graph_Generation.git
cd OpenSGG

# Create conda environment
conda env create -f environment.yml
conda activate hsg

# Install PyTorch (adjust for your CUDA version)
# CUDA 11.8:
pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118
# CUDA 12.1:
# pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu121

If Tsinghua mirror channels in environment.yml are inaccessible, replace them with defaults and conda-forge, or remove the channels section to use your local .condarc.

Docker

For a containerized GPU setup, see Docker Environment.

docker build -t opensgg:dev .
docker run --rm -it --gpus all --ipc=host --shm-size=16g \
  -v "$PWD":/workspace/OpenSGG \
  -v "$PWD/data":/workspace/OpenSGG/data \
  -v "$PWD/outputs":/workspace/OpenSGG/outputs \
  opensgg:dev bash

For a Compose workflow, use docker compose run --rm opensgg bash for CPU checks or add -f compose.gpu.yaml for GPU runs.

DependencyVersion
Python≀ 3.10
PyTorchβ‰₯ 1.10
CUDAβ‰₯ 11.3 (GPU)
PyTorch Lightning2.x
Transformersβ‰₯ 4.18.0

Data Preparation

VisualGenome

  1. Download VisualGenome images (parts 1–2) from visualgenome.org
  2. Place images under data/VisualGenome/images/
  3. Provide COCO-format train.json, val.json, test.json, and rel.json under data/VisualGenome/
  4. Optional analysis assets such as clip_prototypes.pth and predicate_frequencies.json can live in the same directory

OpenImageV6 (Experimental)

Place COCO-format annotations and images under data/OpenImage/.


Quick Start

Training

python train.py --method EGTR --dataname VisualGenome --gpus 0 --batch_size 4

Replace EGTR with any supported CLI method name. Config files are auto-loaded from configs/<Dataset>/<Method>.py, and CLI arguments override config values.

Evaluation

python train.py --test --method EGTR --dataname VisualGenome \
  --ckpt_path outputs/pretrained/egtr/<run>/checkpoints/epoch=03-*.ckpt --gpus 0

Multi-GPU

# DDP with 4 GPUs
python train.py --method RelTR --dataname VisualGenome --gpus 0 1 2 3 --dist

# Single GPU (no DDP overhead)
python train.py --method RelTR --dataname VisualGenome --gpus 0

VisualGenome Paper Results

2025–2026 literature scope and code filter

Last checked: 2026-09-22. This survey covers static-image scene graph generation on Visual Genome (VG150) and Open Images (the OpenImageV6 dataset in this repository). It screens CVPR, ICCV, ECCV, ICLR, ICML, NeurIPS, AAAI, IJCAI and ACM MM main papers, and TPAMI, IJCV, TIP and TMM articles; JAS is included as a related journal. The date refers to the publication venue, not the first arXiv upload. This is a dated search snapshot, with unresolved sources listed explicitly, rather than a claim of complete coverage of 2026.

The methods below have public author GitHub repositories containing source code, not just a project page or a promise to release code. Source availability does not establish checkpoint availability, complete implementation of every paper variant, or OpenSGG reproduction. These methods are literature references; they are not additions to the CLI's Supported Methods.

MethodPublicationAuthor GitHubVG / Open Images evidence
HQSGCVPR 2025HQSGVG SGDet, Table 1; no OI table in the inspected paper
RA-SGGAAAI 2025torch-rasggVG three tasks, Table 1; no OI table in the inspected paper
RAHPAAAI 2025RAHPVG open-vocabulary Tables 1/3; OI V6 Table 2
NoDISICML 2025NoDISVG Table 1; OI V4/V6 Table 2
VL-IRMICCV 2025VL-IRMVG open-vocabulary Tables 1/2/4; OI V6 Table 3
ACCNeurIPS 2025ACCVG open-vocabulary Tables 1/2; filtered test set
MCLTIP 2025G-USGGVG/OI stated by authors; final journal tables not retrieved; numbers withheld
GCMTPAMI, online 2025 / issue 2026GCMVG/OI V6 code and instructions; final journal tables not retrieved; numbers withheld
APTICLR 2026APTVG Tables 2/3; OI V6 Tables 8/9; component code released, integration and OI protocol need audit
HSGGICML 2026HSGGVG150 in author code; primary PDF retrieval blocked; numbers withheld
BiRefJAS 2026BiRefVG/OI stated by journal; numerical full text not retrieved; numbers withheld

See the source and exclusion ledger for paper titles, implementation evidence, search coverage, missing results and excluded candidates, including README-only repositories and code mismatches.

All following values are paper-reported percentages, not local evaluation results. a / b means @50 / @100; NR means not reported in the cited table. Different detectors, supervision, splits and postprocessing prevent treating these tables as a common leaderboard. We retain each paper's precision.

Closed-vocabulary VG150: SGDet

Method / paper variantDetector or architectureR@50 / 100mR@50 / 100Original source
HQSGOne-stage, ResNet-10134.1 / 38.316.0 / 20.5Table 1
RA-SGGPE-Net, Faster R-CNN / ResNeXt-101-FPN26.0 / 30.314.4 / 17.1Table 1
VTransE + NoDISTwo-stage, Faster R-CNN27.96 / 31.9713.77 / 15.83Table 1
Motifs + NoDISTwo-stage, Faster R-CNN30.91 / 35.4213.58 / 16.35Table 1
Transformer + NoDISTwo-stage, Faster R-CNN25.26 / 28.7716.91 / 19.25Table 1
PE-Net + NoDISTwo-stage, Faster R-CNN23.16 / 26.9514.78 / 17.16Table 1
Motif + APTPaper's two-stage variant33.3 / 37.69.2 / 10.3Table 2
HQSG + APTPaper's one-stage variant36.5 / 39.918.2 / 21.7Table 2

APT rows are representative variants from its own table. Released prompt components do not establish that all these integrations can be run from the repository. See the APT caveats.

Closed-vocabulary VG150: PredCls and SGCls

Method / variantPredCls R@50 / 100PredCls mR@50 / 100SGCls R@50 / 100SGCls mR@50 / 100Source
RA-SGG62.2 / 64.136.2 / 39.138.2 / 39.120.9 / 22.5Table 1
VTransE + NoDIS57.83 / 59.7435.68 / 38.0438.84 / 39.9620.83 / 22.14Table 1
Motifs + NoDIS62.72 / 64.9833.83 / 36.4836.46 / 37.4822.68 / 24.35Table 1
Transformer + NoDIS49.96 / 53.2137.25 / 39.9734.42 / 35.6321.53 / 23.35Table 1
PE-Net + NoDIS50.13 / 53.8738.72 / 41.9330.65 / 32.1922.31 / 23.69Table 1
Motif + APT66.5 / 68.217.4 / 18.140.3 / 40.810.5 / 11.1Table 2
HQSG + APT58.7 / 61.235.1 / 37.337.7 / 38.321.9 / 22.7Table 2

RA-SGG's author implementation uses relation NMS for PredCls/SGCls. Do not compare these tasks with SGDet, which must also predict the object boxes.

Open-vocabulary VG150: unseen relations (OvR)

Total evaluates base + novel predicates; Novel evaluates novel predicates. The split source and task are part of each result's identity. Equal novel percentages alone do not establish identical category lists or evaluation sets.

Method / variantTask; novel predicate splitTotal R@50 / 100Total mR@50 / 100Novel R@50 / 100Novel mR@50 / 100Source
SGTR† + RAHPPredCls; EPIC, 30%39.92 / 46.0316.88 / 22.1815.46 / 20.3711.82 / 15.46Table 1
PE-Net + RAHPPredCls; EPIC, 30%64.70 / 69.1124.50 / 28.2520.79 / 29.0015.70 / 23.73Table 1
OvSGTR + RAHPSGDet; OvSGTR, 30%21.50 / 25.744.51 / 5.3715.59 / 19.923.01 / 4.04Table 1
VL-IRM (Ours)SGDet; PGSG, 50%13.7 / 19.77.5 / 10.610.1 / 14.35.2 / 7.5Table 1
VL-IRM (Ours*)SGDet; OvSGTR, 30%14.3 / 20.48.7 / 12.79.0 / 12.6NRTable 1
OvSGTR + VL-IRM (Ours*)SGDet; OvSGTR, 30%; extra pretraining21.1 / 25.04.2 / 4.914.2 / 17.7NRTable 1
VL-IRMPredCls; PGSG, 50%27.8 / 37.511.1 / 14.511.9 / 18.35.9 / 8.2Table 2
ACC, Swin-TSGDet; 30%; ACC filtered test set23.22 / 27.40NR17.89 / 21.70NRTable 1
ACC, Swin-BSGDet; 30%; ACC filtered test set24.81 / 29.28NR20.04 / 24.66NRTable 1

RAHP's † denotes its adapted SGTR variant. ACC evaluates 14,700 VG test images after removing overlap with GroundingDINO pretraining data. Its results must not be compared directly with full-test-set rows. Use ACC's NeurIPS paper; the repository's older INOVA link is not the source of these numbers.

Open-vocabulary VG150: unseen objects and relations (OvD+R)

Method / variantTotal R@50 / 100Novel-object R@50 / 100Novel-relation R@50 / 100Source
VS3 + RAHP, Swin-T12.66 / 15.3913.01 / 14.823.75 / 5.12Table 3
OvSGTR + RAHP, Swin-T13.83 / 16.5212.45 / 15.3813.31 / 16.46Table 3
OvSGTR-T + VL-IRM14.87 / 18.27NR12.27 / 15.26Table 4
ACC, Swin-T, filtered test set17.43 / 21.2717.16 / 21.1015.90 / 19.46Table 2
ACC, Swin-B, filtered test set18.88 / 23.1918.84 / 23.2917.50 / 21.73Table 2

Historical SGDet reference (before 2025)

The table below summarizes paper-reported Visual Genome SGDet results, not OpenSGG reproduction results. Values are percentages under graph-constraint evaluation when reported by the cited paper table. Source: EGTR Table 1, with each row attributed to the corresponding original method paper. In that table, LA denotes the logit adjustment setting proposed by SSR-CNN.

MethodPaper / VenueDetector / backbone in paperAPR@20R@50R@100mR@20mR@50mR@100
IMPCVPR 2017Faster R-CNN / ResNeXt-101-FPN28.118.125.931.22.84.25.4
Neural MotifsCVPR 2018Faster R-CNN / ResNeXt-101-FPN28.125.132.136.94.15.56.8
VCTreeCVPR 2019Faster R-CNN / ResNeXt-101-FPN28.124.831.836.14.96.67.7
VCTree-TDECVPR 2020Faster R-CNN / ResNeXt-101-FPN28.114.019.423.26.99.311.1
GPS-NetCVPR 2020Faster R-CNN / ResNeXt-101-FPN--31.135.9-6.78.6
RelTRTPAMI 2023DETR-5026.421.227.5-6.810.8-
EGTRCVPR 2024Deformable DETR-5030.823.530.234.35.57.910.1
EGTR + logit adjustmentCVPR 2024Deformable DETR-5030.815.718.720.512.117.821.7

This historical table is retained for context; it is outside the 2025–2026 selection window.

Open Images Paper Results

Closed-vocabulary SGDet: weighted mAP protocol

The weighted score is 0.2 Γ— R@50 + 0.4 Γ— wmAP_rel + 0.4 Γ— wmAP_phr. Relation detection matches both object boxes; phrase detection matches their union box. OI V4 and V6 are different benchmarks and are kept in separate rows.

MethodDatasetR@50mR@50wmAP_relwmAP_phrWeighted scoreSource
Transformer + NoDISOI V474.8470.3438.2142.3547.19Table 2
Transformer + NoDISOI V674.1148.9338.8738.9545.95Table 2

Open-vocabulary OI V6: recall protocol

Both papers follow the PGSG split for OI; these are recall results, not weighted mAP scores. The RAHP adaptation and VL-IRM use different architectures and training, so the shared split is not an otherwise controlled comparison.

Method / variantTaskTotal R@50 / 100Total mR@50 / 100Novel R@50 / 100Novel mR@50 / 100Source
SGTR† + RAHP, ResNet-101SGDet62.42 / 64.8630.79 / 34.4649.61 / 56.2829.43 / 34.16Table 2
VL-IRM, GLIPSGDet46.3 / 59.419.8 / 24.614.6 / 18.74.5 / 10.1Table 3

APT's OI V6 appendix: separate protocol pending clarification

Protocol mismatch: APT Β§4.1 specifies 288 entity classes, 30 relations and 5,322 test images; Appendix B specifies 301 objects, 31 predicates and 6,322 test images. Its Table 8 reports recall rather than weighted mAP. Preserve the published values below as a separate literature record until this discrepancy and the released integrations are clarified.

Paper variantTaskR@50 / 100mR@50 / 100Source
Motif + APTPredCls67.0 / 68.617.6 / 18.5Table 8
Motif + APTSGCls40.5 / 41.010.6 / 11.3Table 8
Motif + APTSGDet33.7 / 38.09.3 / 10.5Table 8
SGTR + APTSGDet33.7 / 37.013.1 / 15.0Table 8

MCL, GCM and BiRef have public code and OI-related author evidence, but verified final-paper numbers are still missing from this survey. Missing data is not a zero score. No results here are labeled as an OpenSGG baseline reproduction.


Configuration

Configs use a two-layer system: CLI arguments override per-method config files.

ParameterDescriptionDefault
methodModel methodHSTRNet
datanameDataset (VisualGenome / OpenImageV6)VisualGenome
batch_sizeTraining batch size4
dataset_sizeTrain subset size (smoke tests)None
epochMax training epochs200
no_progress_barDisable train/validation/test progress barsFalse
lr / lr_backboneLearning rate (model / backbone)1e-4 / 1e-5
backboneCNN backboneresnet50
hidden_dimTransformer hidden dim256
enc_layers / dec_layersEncoder / decoder layers6
num_entities / num_tripletsQuery counts (RelTR)100 / 200
entity_nums / rel_numsClasses + background151 / 51

Evaluation Metrics

FormatExampleDescription
sgdet_R@Ksgdet_R@50SGDet Recall@K
sgdet_mR@Ksgdet_mR@50SGDet mean Recall@K
sgcls_R@Ksgcls_R@20SGCLS Recall@K
sgcls_mR@Ksgcls_mR@20SGCLS mean Recall@K
predcls_R@Kpredcls_R@50PredCLS Recall@K
predcls_mR@Kpredcls_mR@20PredCLS mean Recall@K

Modes: SGDet (boxes + labels + predicates from raw images) Β· SGCLS (boxes given, predict labels + predicates) Β· PredCLS (boxes + labels given, predict predicates)


Reports And Guides

  • 2025–2026 SGG Literature Audit β€” primary sources, public-code screening, VG/Open Images protocol caveats, and unresolved candidates.
  • Published Method Checkpoint Evaluations β€” concise PR-ready summary of traced checkpoint-backed OpenSGG evaluation results for published paper methods.
  • Adding A New Model β€” step-by-step contributor guide for integrating a new method into the main training and evaluation pipeline.
  • Reproduction Workflow Usage β€” evidence-first workflow for deciding whether a baseline is reproduced, audited, smoke-tested, or deferred.
  • Baseline Reproduction Workflow β€” current reproduction standard, deferred audit matrix, and evidence gates.
  • Contributing β€” PR expectations, validation commands, and repository hygiene rules.
  • Security Policy β€” private reporting path for dependency, checkpoint-loading, credential, and CI-token issues.

Community Resources


CI/CD Pipeline

GitHub Actions runs on every PR and push to main:

  • Validation β€” AST registration checks plus the unit test suite
  • Smoke tests β€” forward pass + loss convergence on all 17 methods with synthetic data
  • LLM code review β€” automated review via Claude/DeepSeek API on changed files

Trigger paths include code, configs, tools, tests, reproduction guardrails, reproduction reports, AGENTS.md, CONTRIBUTING.md, CONTEXT.md, and workflow files.

The test suite includes tools/reproduction/check_repository_boundary.py, which keeps research-only work out of this repository. See AGENTS.md for the rule.

PRs that touch reproduction claims must preserve the status language in AGENTS.md and reproduction/README.md; random-init, tiny-slice, all-zero, or partial-checkpoint outputs are not baseline reproduction evidence.


How to Add a New Method

See Adding A New Model for the complete model, method wrapper, config, registry, CLI, metric, and smoke-test checklist.


License

MIT License β€” see LICENSE.


Citation

To be added.

Please also cite the original papers for any methods you use: RelTR (ECCV 2022), EGTR (CVPR 2024), FlowSG (CVPR 2026), USG-Par (CVPR 2025), Neural Motifs (CVPR 2018), VCTree (CVPR 2019), TDE (CVPR 2020), IMP (CVPR 2017), Transformer (CVPR 2020), GPS-Net (CVPR 2020), PE-Net (CVPR 2023), REACT (BMVC 2025), SHA-GCL (CVPR 2022), SQUAT (CVPR 2023).


Built by the CIGIT HPC Lab team and open-source contributors.