maelic commited on
Commit
3ca12d1
·
verified ·
1 Parent(s): c113de9

Update model card

Browse files
Files changed (1) hide show
  1. README.md +271 -0
README.md ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - scene-graph-generation
7
+ - object-detection
8
+ - visual-relationship-detection
9
+ - pytorch
10
+ - yolo
11
+ pipeline_tag: object-detection
12
+ library_name: sgg-benchmark
13
+ model-index:
14
+ - name: REACT++ yolo12n
15
+ results:
16
+ - task:
17
+ type: object-detection
18
+ name: Scene Graph Detection
19
+ dataset:
20
+ name: PSG
21
+ type: psg
22
+ metrics: []
23
+ - name: REACT++ yolo12s
24
+ results:
25
+ - task:
26
+ type: object-detection
27
+ name: Scene Graph Detection
28
+ dataset:
29
+ name: PSG
30
+ type: psg
31
+ metrics:
32
+ - type: mR@20
33
+ value: 2.91
34
+ name: mR@20
35
+ - type: R@20
36
+ value: 6.71
37
+ name: R@20
38
+ - type: zsR@20
39
+ value: 1.82
40
+ name: zsR@20
41
+ - type: mR@50
42
+ value: 3.93
43
+ name: mR@50
44
+ - type: R@50
45
+ value: 9.28
46
+ name: R@50
47
+ - type: zsR@50
48
+ value: 2.66
49
+ name: zsR@50
50
+ - type: mR@100
51
+ value: 4.62
52
+ name: mR@100
53
+ - type: R@100
54
+ value: 11.21
55
+ name: R@100
56
+ - type: zsR@100
57
+ value: 3.22
58
+ name: zsR@100
59
+ - type: mean_recall
60
+ value: 24.71
61
+ name: mean_recall
62
+ - name: REACT++ yolo12m
63
+ results:
64
+ - task:
65
+ type: object-detection
66
+ name: Scene Graph Detection
67
+ dataset:
68
+ name: PSG
69
+ type: psg
70
+ metrics:
71
+ - type: mR@20
72
+ value: 22.73
73
+ name: mR@20
74
+ - type: R@20
75
+ value: 31.11
76
+ name: R@20
77
+ - type: zsR@20
78
+ value: 1.81
79
+ name: zsR@20
80
+ - type: mR@50
81
+ value: 25.75
82
+ name: mR@50
83
+ - type: R@50
84
+ value: 36.29
85
+ name: R@50
86
+ - type: zsR@50
87
+ value: 2.8
88
+ name: zsR@50
89
+ - type: mR@100
90
+ value: 27.55
91
+ name: mR@100
92
+ - type: R@100
93
+ value: 39.44
94
+ name: R@100
95
+ - type: zsR@100
96
+ value: 3.77
97
+ name: zsR@100
98
+ - type: mean_recall
99
+ value: 26.32
100
+ name: mean_recall
101
+ - name: REACT++ yolo12l
102
+ results:
103
+ - task:
104
+ type: object-detection
105
+ name: Scene Graph Detection
106
+ dataset:
107
+ name: PSG
108
+ type: psg
109
+ metrics:
110
+ - type: mR@20
111
+ value: 23.34
112
+ name: mR@20
113
+ - type: R@20
114
+ value: 29.72
115
+ name: R@20
116
+ - type: zsR@20
117
+ value: 1.74
118
+ name: zsR@20
119
+ - type: mR@50
120
+ value: 25.82
121
+ name: mR@50
122
+ - type: R@50
123
+ value: 35.12
124
+ name: R@50
125
+ - type: zsR@50
126
+ value: 2.77
127
+ name: zsR@50
128
+ - type: mR@100
129
+ value: 27.47
130
+ name: mR@100
131
+ - type: R@100
132
+ value: 37.99
133
+ name: R@100
134
+ - type: zsR@100
135
+ value: 3.53
136
+ name: zsR@100
137
+ - type: mean_recall
138
+ value: 33.16
139
+ name: mean_recall
140
+ - name: REACT++ yolov8m
141
+ results:
142
+ - task:
143
+ type: object-detection
144
+ name: Scene Graph Detection
145
+ dataset:
146
+ name: PSG
147
+ type: psg
148
+ metrics:
149
+ - type: mR@20
150
+ value: 2.82
151
+ name: mR@20
152
+ - type: R@20
153
+ value: 10.02
154
+ name: R@20
155
+ - type: zsR@20
156
+ value: 1.97
157
+ name: zsR@20
158
+ - type: mR@50
159
+ value: 4.57
160
+ name: mR@50
161
+ - type: R@50
162
+ value: 13.75
163
+ name: R@50
164
+ - type: zsR@50
165
+ value: 2.8
166
+ name: zsR@50
167
+ - type: mR@100
168
+ value: 5.98
169
+ name: mR@100
170
+ - type: R@100
171
+ value: 16.24
172
+ name: R@100
173
+ - type: zsR@100
174
+ value: 3.49
175
+ name: zsR@100
176
+ - type: mean_recall
177
+ value: 21.42
178
+ name: mean_recall
179
+ ---
180
+
181
+ # REACT++ Scene Graph Generation — PSG (yolo12n, yolo12s, yolo12m, yolo12l, yolov8m)
182
+
183
+ This repository contains **REACT++** model checkpoints for scene graph generation (SGG)
184
+ on the **PSG** benchmark, across 5 backbone sizes.
185
+
186
+ REACT++ is a parameter-efficient, attention-augmented relation predictor built on top of
187
+ a YOLO12 backbone. It uses:
188
+
189
+ - **SwiGLU gated MLP** for all feed-forward blocks (½ the params of ReLU-MLP at equal capacity)
190
+ - **Visual × Semantic cross-attention** — visual tokens attend to GloVe prototype embeddings
191
+ - **Geometry RoPE** — box-position encoded as a rotary frequency bias on the Q matrix
192
+ - **Prototype Momentum Buffer** — per-class EMA prototype bank (MoCo/DINO-style)
193
+ - **P5 Scene Context** — AIFI-enhanced P5 tokens provide global context via cross-attention
194
+
195
+ The models were trained with the
196
+ [SGG-Benchmark](https://github.com/Maelic/SGG-Benchmark) framework and described in the
197
+ [REACT paper (Neau et al., BMVC 2025)](https://arxiv.org/abs/2405.16116).
198
+
199
+ ---
200
+
201
+ ## Results — SGDet on PSG test split
202
+
203
+ | Backbone | Params (backbone) | mR@20 | mR@50 | mR@100 | R@20 | R@50 | R@100 |
204
+ |----------|:-----------------:|------:|------:|-------:|-----:|-----:|------:|
205
+ | yolo12n | ~2.6M | - | - | - | - | - | - |
206
+ | yolo12s | ~9.2M | 2.91 | 3.93 | 4.62 | 6.71 | 9.28 | 11.21 |
207
+ | yolo12m | ~20.2M | 22.73 | 25.75 | 27.55 | 31.11 | 36.29 | 39.44 |
208
+ | yolo12l | ~26.5M | 23.34 | 25.82 | 27.47 | 29.72 | 35.12 | 37.99 |
209
+ | yolov8m | ~25.9M | 2.82 | 4.57 | 5.98 | 10.02 | 13.75 | 16.24 |
210
+
211
+ ---
212
+
213
+ ## Checkpoints
214
+
215
+ | Variant | Sub-folder | Checkpoint file |
216
+ |---------|------------|-----------------|
217
+ | yolo12n | `yolo12n/` | `yolo12n/best_model_epoch_5.pth` |
218
+ | yolo12s | `yolo12s/` | `yolo12s/best_model_epoch_6.pth` |
219
+ | yolo12m | `yolo12m/` | `yolo12m/best_model_epoch_9.pth` |
220
+ | yolo12l | `yolo12l/` | `yolo12l/best_model_epoch_9.pth` |
221
+ | yolov8m | `yolov8m/` | `yolov8m/best_model_epoch_6.pth` |
222
+
223
+ ---
224
+
225
+ ## Usage
226
+
227
+ ```python
228
+ # 1. Clone the repository
229
+ # git clone https://github.com/Maelic/SGG-Benchmark
230
+
231
+ # 2. Install dependencies
232
+ # pip install -e .
233
+
234
+ # 3. Download a checkpoint
235
+ from huggingface_hub import hf_hub_download
236
+
237
+ ckpt_path = hf_hub_download(
238
+ repo_id="maelic/REACTPlusPlus_PSG",
239
+ filename="yolo12n/best_model.pth",
240
+ repo_type="model",
241
+ )
242
+ cfg_path = hf_hub_download(
243
+ repo_id="maelic/REACTPlusPlus_PSG",
244
+ filename="yolo12n/hydra_config.yaml",
245
+ repo_type="model",
246
+ )
247
+
248
+ # 4. Run evaluation
249
+ import subprocess
250
+ subprocess.run([
251
+ "python", "tools/relation_train_net_hydra.py",
252
+ "--config-path", str(cfg_path),
253
+ "--task", "sgdet",
254
+ "--eval-only",
255
+ "--checkpoint", str(ckpt_path),
256
+ ])
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Citation
262
+
263
+ ```bibtex
264
+ @inproceedings{neau2025react,
265
+ title = {REACT: Relation Extraction through Attention-guided Contrastive Training},
266
+ author = {Neau, Maëlic and others},
267
+ booktitle = {BMVC},
268
+ year = {2025},
269
+ url = {https://arxiv.org/abs/2405.16116},
270
+ }
271
+ ```