Schnowflake commited on
Commit
455fe45
·
verified ·
1 Parent(s): 8c617f7

geneval2, situate_plus and judge_evaluation subsets

Browse files
Files changed (48) hide show
  1. README.md +74 -3
  2. geneval2/test-00000-of-00020.parquet +3 -0
  3. geneval2/test-00001-of-00020.parquet +3 -0
  4. geneval2/test-00002-of-00020.parquet +3 -0
  5. geneval2/test-00003-of-00020.parquet +3 -0
  6. geneval2/test-00004-of-00020.parquet +3 -0
  7. geneval2/test-00005-of-00020.parquet +3 -0
  8. geneval2/test-00006-of-00020.parquet +3 -0
  9. geneval2/test-00007-of-00020.parquet +3 -0
  10. geneval2/test-00008-of-00020.parquet +3 -0
  11. geneval2/test-00009-of-00020.parquet +3 -0
  12. geneval2/test-00010-of-00020.parquet +3 -0
  13. geneval2/test-00011-of-00020.parquet +3 -0
  14. geneval2/test-00012-of-00020.parquet +3 -0
  15. geneval2/test-00013-of-00020.parquet +3 -0
  16. geneval2/test-00014-of-00020.parquet +3 -0
  17. geneval2/test-00015-of-00020.parquet +3 -0
  18. geneval2/test-00016-of-00020.parquet +3 -0
  19. geneval2/test-00017-of-00020.parquet +3 -0
  20. geneval2/test-00018-of-00020.parquet +3 -0
  21. geneval2/test-00019-of-00020.parquet +3 -0
  22. judge_evaluation/test-00000-of-00002.parquet +3 -0
  23. judge_evaluation/test-00001-of-00002.parquet +3 -0
  24. make_geneval2.py +123 -0
  25. make_judge_evaluation.py +84 -0
  26. make_situate_plus.py +67 -0
  27. situate_plus/test-00000-of-00002.parquet +3 -0
  28. situate_plus/test-00001-of-00002.parquet +3 -0
  29. situate_plus/train-00000-of-00020.parquet +3 -0
  30. situate_plus/train-00001-of-00020.parquet +3 -0
  31. situate_plus/train-00002-of-00020.parquet +3 -0
  32. situate_plus/train-00003-of-00020.parquet +3 -0
  33. situate_plus/train-00004-of-00020.parquet +3 -0
  34. situate_plus/train-00005-of-00020.parquet +3 -0
  35. situate_plus/train-00006-of-00020.parquet +3 -0
  36. situate_plus/train-00007-of-00020.parquet +3 -0
  37. situate_plus/train-00008-of-00020.parquet +3 -0
  38. situate_plus/train-00009-of-00020.parquet +3 -0
  39. situate_plus/train-00010-of-00020.parquet +3 -0
  40. situate_plus/train-00011-of-00020.parquet +3 -0
  41. situate_plus/train-00012-of-00020.parquet +3 -0
  42. situate_plus/train-00013-of-00020.parquet +3 -0
  43. situate_plus/train-00014-of-00020.parquet +3 -0
  44. situate_plus/train-00015-of-00020.parquet +3 -0
  45. situate_plus/train-00016-of-00020.parquet +3 -0
  46. situate_plus/train-00017-of-00020.parquet +3 -0
  47. situate_plus/train-00018-of-00020.parquet +3 -0
  48. situate_plus/train-00019-of-00020.parquet +3 -0
README.md CHANGED
@@ -7,15 +7,38 @@ configs:
7
  data_files:
8
  - split: test
9
  path: situate_diffuse/*.parquet
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
  # SITUATE-Diffuse
13
 
14
  Pictures and results of the SITUATE-Diffuse paper. The code that made them: [situate-diffuse-paper](https://gitlab.iisys.de/systemintegration/situate-diffuse-paper).
15
 
 
 
 
 
 
 
 
 
 
16
  ## situate_diffuse
17
 
18
- One row per scene (472): the prompt, what should be in the picture, and for each of the 9 image models its picture, what SAM 3.1
19
  found and the scene's points. Every model drew the scene with a rewritten prompt: the 4 `*_reprompt` models with their own rewriter
20
  (`<model>_rewrite`), the other 5 with HiDream-O1's (`hidream_o1_image_reprompt_rewrite`).
21
 
@@ -40,6 +63,54 @@ Models: `ideogram_4_reprompt`, `fibo_2_edit_turbo`, `flux_3_klein_reprompt`, `hi
40
 
41
  A model's score in the paper is per category the sum of its points over the sum of `possible_points`, then the mean of the 8 categories.
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ```python
44
  from datasets import load_dataset
45
 
@@ -47,6 +118,6 @@ scenes = load_dataset("iisys-hof/situate-diffuse", "situate_diffuse", split="tes
47
  scene = scenes[0]
48
  scene["moss_image_sft"] # PIL image
49
  scene["moss_image_sft_found"] # '{"all balls": 2, "solid": 0, ...}'
50
- ```
51
 
52
- `make_situate_diffuse.py` builds the subset from a finished run of the code.
 
 
7
  data_files:
8
  - split: test
9
  path: situate_diffuse/*.parquet
10
+ - config_name: geneval2
11
+ data_files:
12
+ - split: test
13
+ path: geneval2/*.parquet
14
+ - config_name: situate_plus
15
+ data_files:
16
+ - split: train
17
+ path: situate_plus/train-*.parquet
18
+ - split: test
19
+ path: situate_plus/test-*.parquet
20
+ - config_name: judge_evaluation
21
+ data_files:
22
+ - split: test
23
+ path: judge_evaluation/*.parquet
24
  ---
25
 
26
  # SITUATE-Diffuse
27
 
28
  Pictures and results of the SITUATE-Diffuse paper. The code that made them: [situate-diffuse-paper](https://gitlab.iisys.de/systemintegration/situate-diffuse-paper).
29
 
30
+ | Subset | Rows | |
31
+ |---|---|---|
32
+ | `situate_diffuse` | 472 scenes | the SITUATE-Diffuse benchmark: 9 image models, checked by SAM 3.1 |
33
+ | `geneval2` | 800 prompts | GenEval2 with 9 image models, plain and rewritten prompts, judged by three Qwen models |
34
+ | `situate_plus` | 8,936 pictures | SITUATE+: rendered scenes with counting questions and their ground truth |
35
+ | `judge_evaluation` | 720 questions | 8 judges answering the SITUATE+ test questions |
36
+
37
+ `make_<subset>.py` builds each subset from the finished runs of the code.
38
+
39
  ## situate_diffuse
40
 
41
+ One row per scene: the prompt, what should be in the picture, and for each of the 9 image models its picture, what SAM 3.1
42
  found and the scene's points. Every model drew the scene with a rewritten prompt: the 4 `*_reprompt` models with their own rewriter
43
  (`<model>_rewrite`), the other 5 with HiDream-O1's (`hidream_o1_image_reprompt_rewrite`).
44
 
 
63
 
64
  A model's score in the paper is per category the sum of its points over the sum of `possible_points`, then the mean of the 8 categories.
65
 
66
+ ## geneval2
67
+
68
+ One row per [GenEval2](https://github.com/facebookresearch/GenEval2) prompt: for each model its picture with the plain prompt
69
+ (`<model>_raw`) next to the one with a rewritten prompt (`<model>_reprompted`). Models with their own rewriter used it
70
+ (`<model>_reprompted_rewrite`); the others drew our fixed rewrite (`fixed_rewrite`, written with the prompt of the GenEval2 paper).
71
+ Every picture is judged against the original prompt and questions. The prompts and questions are GenEval2's (CC BY-NC 4.0, Meta).
72
+
73
+ | Column | |
74
+ |---|---|
75
+ | `prompt`, `atom_count`, `skills` | GenEval2's prompt, its number of atoms and the skill of each question |
76
+ | `questions`, `answers` | GenEval2's questions about the picture and their expected answers |
77
+ | `fixed_rewrite` | our rewrite of the prompt |
78
+ | `<model>_raw`, `<model>_reprompted` | the pictures, 1024x1024 (Ideogram 4 only reprompted) |
79
+ | `<model>_reprompted_rewrite` | the rewrite of the model's own rewriter (FLUX.3 klein, Qwen-Image-2.1-Turbo, HiDream-O1, Ideogram 4) |
80
+ | `<picture>_gm` | Soft-TIFA GM of the prompt per judge: `qwen3vl` (Qwen3-VL-8B, GenEval2's), `qwen35` (Qwen3.5-9B), `qwen38` (Qwen3.8-27B) |
81
+ | `<picture>_question_scores` | Soft-TIFA's score per question and judge, in the order of `questions` |
82
+
83
+ A model's GM in the paper is the mean of `<picture>_gm` over the 800 prompts.
84
+
85
+ ## situate_plus
86
+
87
+ One row per rendered picture, with all questions asked about it. The test split (720 pictures, one question each, 80 per category)
88
+ is what the judges were evaluated on; train and test share no scenes. Nuts is only in test (80 pictures, no camera, groundtruth, qtype
89
+ or present_items).
90
+
91
+ | Column | |
92
+ |---|---|
93
+ | `image`, `file_name` | the rendered picture |
94
+ | `category` | Billard, Checkers, Chess, Cupcake_Candles, Fruitcake, Ludo, Nuts, Shelf, Situate_Table |
95
+ | `scene`, `camera`, `source` | the rendered scene, its camera and where it comes from |
96
+ | `questions` | list of `question`, `subtask`, `qtype`, `adversarial` (the answer is 0), `present_items`, `groundtruth`, `groundtruth_short`, `groundtruth_number` |
97
+
98
+ ## judge_evaluation
99
+
100
+ One row per SITUATE+ test question, with each judge's answer. A judge is right when it gives exactly `groundtruth_number`.
101
+
102
+ | Column | |
103
+ |---|---|
104
+ | `image`, `file_name`, `category`, `subtask`, `question`, `adversarial`, `groundtruth_number` | the test question, as in `situate_plus` |
105
+ | `<judge>_predicted` | the judge's number (empty if it gave none) |
106
+ | `<judge>_correct` | whether it is exactly right |
107
+
108
+ Judges: `lisa_pro`, `qwen3_vl_8b`, `qwen3_8_27b` (VLMs, asked the question as it is), `groundingpi_prompt`, `groundingpi_calc`,
109
+ `locateanything_prompt`, `locateanything_calc` (box models: *prompt* counts the boxes for the question, *calc* labels every object
110
+ and works on the boxes), `sam3_1` (SAM 3.1, the judge of `situate_diffuse`).
111
+
112
+ ## Loading
113
+
114
  ```python
115
  from datasets import load_dataset
116
 
 
118
  scene = scenes[0]
119
  scene["moss_image_sft"] # PIL image
120
  scene["moss_image_sft_found"] # '{"all balls": 2, "solid": 0, ...}'
 
121
 
122
+ prompts = load_dataset("iisys-hof/situate-diffuse", "geneval2", split="test", streaming=True) # streaming: no full download
123
+ ```
geneval2/test-00000-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc4d5ea1cfe6e08d4b92d3964ded4914e032aebce9b520e0a7e259c034bd045d
3
+ size 243943060
geneval2/test-00001-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3c355d98935af884e7aa2a675f5b387d1e736d9f5d3074c5522f988521eef59
3
+ size 233611309
geneval2/test-00002-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f08430279daf9f1f2e936ce656c7a580af6fbe945c27c43b038ddfba51d87f25
3
+ size 226207466
geneval2/test-00003-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ad106b481edd0d5ace2f7575431cd80882cc5f30fe1be05b6b209f887a9f5b5
3
+ size 239686315
geneval2/test-00004-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f0bc35694d7bb390f3d4dd759711ffccf889b1dea9ec5895c2aad52dbbb5950
3
+ size 241526717
geneval2/test-00005-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5044ca70c5235066a1be8234a37a882627eccd22eea780257dbe03f9f69decc
3
+ size 231193499
geneval2/test-00006-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:566a85af7a2a9191a17d1a8edb05d683808510ff8fd939c6aa79a25ed7f55215
3
+ size 239212415
geneval2/test-00007-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d245ed57cc46f326696cd164ae8178640aef909309553e2e1bc7f391a4399c9
3
+ size 241677971
geneval2/test-00008-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d639790159910912a3df09cb7c64783f77b4aba43b42568a7768c974bcc12c99
3
+ size 238449294
geneval2/test-00009-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:134253124e94ee286c3cf1d28099d4cda8cdd00b445ce31a67d9c780b1cda46c
3
+ size 242196299
geneval2/test-00010-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f001ce8fa2bdce89d06ed26191324423c69edfe5204a0daf35ab6d17ca16b8d
3
+ size 242441588
geneval2/test-00011-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ea34ef2a834b5b236154107f732d5f303488d9d5c2c081bd9cd495495bfb8e3
3
+ size 246007658
geneval2/test-00012-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccb1f0a954a5df268e6b948338adfa9e0750692bab861637d42e38ce43b6772c
3
+ size 246184167
geneval2/test-00013-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe4c0edb7abe3a1814f713f6c5d2a2fa7a15ee2b6d1f81d03a14b4f1c53e429b
3
+ size 244523896
geneval2/test-00014-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7329a3ea7fff669c214f11eb88501b32e49af2d45cbec046417e2cd31ea5a052
3
+ size 247868036
geneval2/test-00015-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29344aa46c4e54cc63ed993dd75a58ad71b0a85f709fabf873d14a231d8eb649
3
+ size 247286408
geneval2/test-00016-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8bdcecd8f07415ff00db29d63aac7dbe4c39af88ec5633a34f18b2b3b5ca373
3
+ size 240476056
geneval2/test-00017-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed324974d5c1bb487c97333df9b4d6738869f5d027ce464c88b1eb7105a4079e
3
+ size 244285124
geneval2/test-00018-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:daa2a4c1bf4b5e07f7e251930eb2f7c3ab0d2d356fd2f82922e8c493d7419339
3
+ size 251566065
geneval2/test-00019-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9496feffdb60e3462daf18b377364ed0605a23f389e64f9b46b064f199ce55f
3
+ size 242960494
judge_evaluation/test-00000-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49cfba542996ac4ec8fa0c144b5b1eb9367bf435d525381bc75e8f5b63b0ec6d
3
+ size 212048615
judge_evaluation/test-00001-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6950f5cb9b96690345d47249f5204735deac7f5d375b7f1259fcc2c1530764e
3
+ size 186637138
make_geneval2.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Writes the geneval2 subset from the finished GenEval2 runs: one row per prompt (800), for every model its raw and reprompted
2
+ picture next to each other, with Soft-TIFA's score per question and per prompt (GM) from all three judges.
3
+
4
+ python make_geneval2.py ../SITUATE-DIFFUSER26/1_benchmarks/GenEval2
5
+ """
6
+ import json
7
+ import math
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ from datasets import Dataset, Features, Image, Sequence, Value
12
+
13
+ HERE = Path(__file__).resolve().parent
14
+ GENEVAL2 = Path(sys.argv[1])
15
+ RESULTS = GENEVAL2 / "results"
16
+ OUT = HERE / "geneval2"
17
+ SHARDS = 20 # parquet files of about 250 MB
18
+
19
+ MODELS = [ # column name -> (raw run, reprompted run); None = that run doesn't exist
20
+ ("krea_2_turbo", "raw/krea-2-turbo", "reprompted/krea-2-turbo"),
21
+ ("fibo_2_edit_turbo", "raw/fibo-2-edit-turbo", "reprompted/fibo-2-edit-turbo"),
22
+ ("ming_image_0_1_design", "raw/ming-image-0.1-design", "reprompted/ming-image-0.1-design"),
23
+ ("moss_image_sft", "raw/moss-image-sft", "reprompted/moss-image-sft"),
24
+ ("flux_3_klein", "raw/flux-3-klein", "reprompted/flux-3-klein-reprompt"),
25
+ ("qwen_image_2_1_turbo", "raw/qwen-image-2.1-turbo", "reprompted/qwen-image-2.1-turbo-reprompt"),
26
+ ("qwen_image_2512_lightning", "raw/qwen-image-2512-lightning", "reprompted/qwen-image-2512-lightning"),
27
+ ("hidream_o1_image", "raw/hidream-o1-image", "reprompted/hidream-o1-image-reprompt"),
28
+ ("ideogram_4", None, "reprompted/ideogram-4-reprompt"),
29
+ ]
30
+ JUDGES = {"qwen3vl": "scores.json", "qwen35": "scores_qwen35.json", "qwen38": "scores_qwen38.json"} # Qwen3-VL-8B, Qwen3.5-9B, Qwen3.8-27B
31
+
32
+
33
+ def runs(): # [(column, run)] of every picture column, raw before reprompted
34
+
35
+ found = []
36
+
37
+ for name, raw, reprompted in MODELS:
38
+ if raw is not None:
39
+ found.append((f"{name}_raw", raw))
40
+
41
+ found.append((f"{name}_reprompted", reprompted))
42
+
43
+ return found
44
+
45
+
46
+ def gmean(scores): # Soft-TIFA GM of one prompt: the geometric mean of its question scores
47
+
48
+ return math.prod(scores) ** (1 / len(scores))
49
+
50
+
51
+ def own_rewriter(run):
52
+
53
+ return run.endswith("-reprompt")
54
+
55
+
56
+ def features():
57
+
58
+ judge_scores = {judge: Value("float64") for judge in JUDGES}
59
+ question_scores = {judge: Sequence(Value("float64")) for judge in JUDGES}
60
+ fields = {"prompt": Value("string"),
61
+ "atom_count": Value("int32"),
62
+ "skills": Sequence(Value("string")),
63
+ "questions": Sequence(Value("string")),
64
+ "answers": Sequence(Value("string")),
65
+ "fixed_rewrite": Value("string")}
66
+
67
+ for name, run in runs():
68
+ fields[name] = Image()
69
+
70
+ if own_rewriter(run):
71
+ fields[f"{name}_rewrite"] = Value("string")
72
+
73
+ fields[f"{name}_gm"] = judge_scores
74
+ fields[f"{name}_question_scores"] = question_scores
75
+
76
+ return Features(fields)
77
+
78
+
79
+ def rows():
80
+
81
+ data = [json.loads(line) for line in (GENEVAL2 / "geneval2/geneval2_data.jsonl").read_text().splitlines()]
82
+ fixed = [json.loads(line) for line in (GENEVAL2 / "reprompts/geneval2_reprompted.jsonl").read_text().splitlines()]
83
+ pictures = {}
84
+ scores = {}
85
+ rewrites = {}
86
+
87
+ for _, run in runs():
88
+ pictures[run] = json.loads((RESULTS / run / "images.json").read_text())
89
+ scores[run] = {judge: json.loads((RESULTS / run / file).read_text()) for judge, file in JUDGES.items()}
90
+
91
+ if own_rewriter(run):
92
+ rewrites[run] = json.loads((RESULTS / run / "prompts.json").read_text())
93
+
94
+ for number, item in enumerate(data):
95
+ prompt = item["prompt"]
96
+ row = {"prompt": prompt,
97
+ "atom_count": item["atom_count"],
98
+ "skills": item["skills"],
99
+ "questions": [question for question, _ in item["vqa_list"]],
100
+ "answers": [answer for _, answer in item["vqa_list"]],
101
+ "fixed_rewrite": fixed[number]["prompt"]}
102
+
103
+ for name, run in runs():
104
+ picture = Path(pictures[run][prompt])
105
+ row[name] = {"bytes": picture.read_bytes(), "path": f"{run}/{picture.name}"}
106
+
107
+ if own_rewriter(run):
108
+ row[f"{name}_rewrite"] = rewrites[run][prompt]
109
+
110
+ row[f"{name}_gm"] = {judge: gmean(scores[run][judge][number]) for judge in JUDGES}
111
+ row[f"{name}_question_scores"] = {judge: scores[run][judge][number] for judge in JUDGES}
112
+
113
+ yield row
114
+
115
+
116
+ data = Dataset.from_generator(rows, features=features())
117
+ OUT.mkdir(exist_ok=True)
118
+
119
+ for index in range(SHARDS):
120
+ shard = data.shard(SHARDS, index, contiguous=True)
121
+ shard.to_parquet(OUT / f"test-{index:05d}-of-{SHARDS:05d}.parquet")
122
+
123
+ print(f"{len(data)} prompts, {len(data.column_names)} columns -> {OUT}")
make_judge_evaluation.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Writes the judge_evaluation subset: one row per SITUATE+ test question (720), the picture and every judge's answer next to it.
2
+
3
+ python make_judge_evaluation.py ../SITUATE-DIFFUSER26
4
+ """
5
+ import json
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ from datasets import Dataset, Features, Image, Value
10
+
11
+ HERE = Path(__file__).resolve().parent
12
+ PROJECT = Path(sys.argv[1])
13
+ SITUATE_PLUS = PROJECT / "data/situate_plus"
14
+ RESULTS = PROJECT / "2_judge_evaluation/results"
15
+ OUT = HERE / "judge_evaluation"
16
+ SHARDS = 2 # parquet files of about 200 MB
17
+ JUDGES = {"lisa_pro": "lisa-pro", # column name -> results folder
18
+ "qwen3_vl_8b": "qwen3-vl-8b",
19
+ "qwen3_8_27b": "qwen3.8-27b",
20
+ "groundingpi_prompt": "groundingpi-prompt",
21
+ "groundingpi_calc": "groundingpi-calc",
22
+ "locateanything_prompt": "locateanything-prompt",
23
+ "locateanything_calc": "locateanything-calc",
24
+ "sam3_1": "sam3.1"}
25
+ QUESTION = ["category", "subtask", "question", "adversarial", "groundtruth_number"]
26
+
27
+
28
+ def key(item): # a question is its picture plus its text
29
+
30
+ return item["image-filename"], item["question"]
31
+
32
+
33
+ def features():
34
+
35
+ fields = {"image": Image(),
36
+ "file_name": Value("string"),
37
+ "category": Value("string"),
38
+ "subtask": Value("string"),
39
+ "question": Value("string"),
40
+ "adversarial": Value("bool"),
41
+ "groundtruth_number": Value("int32")}
42
+
43
+ for name in JUDGES:
44
+ fields[f"{name}_predicted"] = Value("int32")
45
+ fields[f"{name}_correct"] = Value("bool")
46
+
47
+ return Features(fields)
48
+
49
+
50
+ def rows():
51
+
52
+ test = [json.loads(line) for line in (SITUATE_PLUS / "test.jsonl").read_text().splitlines()]
53
+ answers = {}
54
+
55
+ for name, folder in JUDGES.items():
56
+ answers[name] = {}
57
+
58
+ for line in (RESULTS / folder / "answers.jsonl").read_text().splitlines():
59
+ answer = json.loads(line)
60
+ answers[name][key(answer)] = answer
61
+
62
+ for item in test:
63
+ image = SITUATE_PLUS / "media" / item["image-filename"]
64
+ row = {"image": {"bytes": image.read_bytes(), "path": item["image-filename"]}, "file_name": item["image-filename"]}
65
+
66
+ for field in QUESTION:
67
+ row[field] = item[field]
68
+
69
+ for name in JUDGES:
70
+ answer = answers[name][key(item)]
71
+ row[f"{name}_predicted"] = answer["predicted"]
72
+ row[f"{name}_correct"] = answer["correct"]
73
+
74
+ yield row
75
+
76
+
77
+ data = Dataset.from_generator(rows, features=features())
78
+ OUT.mkdir(exist_ok=True)
79
+
80
+ for index in range(SHARDS):
81
+ shard = data.shard(SHARDS, index, contiguous=True)
82
+ shard.to_parquet(OUT / f"test-{index:05d}-of-{SHARDS:05d}.parquet")
83
+
84
+ print(f"{len(data)} questions, {len(data.column_names)} columns -> {OUT}")
make_situate_plus.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Writes the situate_plus subset: one row per rendered picture, with all its questions and their ground truth; splits train and test.
2
+
3
+ python make_situate_plus.py ../SITUATE-DIFFUSER26/data/situate_plus
4
+ """
5
+ import json
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ from datasets import Dataset, Features, Image, Sequence, Value
10
+
11
+ HERE = Path(__file__).resolve().parent
12
+ SOURCE = Path(sys.argv[1])
13
+ OUT = HERE / "situate_plus"
14
+ SHARDS = {"train": 20, "test": 2} # parquet files of about 250 MB
15
+ PICTURE = ["category", "scene", "camera", "source"] # the same for every question of a picture
16
+ QUESTION = {"question": Value("string"),
17
+ "subtask": Value("string"),
18
+ "qtype": Value("string"),
19
+ "adversarial": Value("bool"),
20
+ "present_items": Value("int32"),
21
+ "groundtruth": Value("string"),
22
+ "groundtruth_short": Value("string"),
23
+ "groundtruth_number": Value("int32")}
24
+
25
+
26
+ def features():
27
+
28
+ fields = {"image": Image(), "file_name": Value("string")}
29
+
30
+ for key in PICTURE:
31
+ fields[key] = Value("string")
32
+
33
+ fields["questions"] = [QUESTION]
34
+
35
+ return Features(fields)
36
+
37
+
38
+ def rows(split):
39
+
40
+ pictures = {}
41
+
42
+ for line in (SOURCE / f"{split}.jsonl").read_text().splitlines():
43
+ item = json.loads(line)
44
+ name = item["image-filename"]
45
+
46
+ if name not in pictures:
47
+ pictures[name] = {key: item.get(key) for key in PICTURE} # the nuts pictures have no camera
48
+ pictures[name]["questions"] = []
49
+
50
+ pictures[name]["questions"].append({key: item.get(key) for key in QUESTION}) # nor groundtruth, qtype, present_items
51
+
52
+ for name, picture in pictures.items():
53
+ image = SOURCE / "media" / name
54
+ yield {"image": {"bytes": image.read_bytes(), "path": name}, "file_name": name, **picture}
55
+
56
+
57
+ OUT.mkdir(exist_ok=True)
58
+
59
+ for split, shards in SHARDS.items():
60
+ data = Dataset.from_generator(rows, gen_kwargs={"split": split}, features=features())
61
+
62
+ for index in range(shards):
63
+ shard = data.shard(shards, index, contiguous=True)
64
+ shard.to_parquet(OUT / f"{split}-{index:05d}-of-{shards:05d}.parquet")
65
+
66
+ questions = sum(len(questions) for questions in data["questions"])
67
+ print(f"{split}: {len(data)} pictures, {questions} questions -> {OUT}")
situate_plus/test-00000-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14319dd966f5874686cae00ebe530eb2b8ba167b1b248df2ec494e9ae05d6bed
3
+ size 212047532
situate_plus/test-00001-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5657de96fe8ad19c9b7221a87a5996a8825fa824a82b17340af29b3731aef1c1
3
+ size 186640021
situate_plus/train-00000-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8f281fe6039c30720bfcda77332dd711c30a76ab71892f3190a2de2cba3c64c
3
+ size 244023323
situate_plus/train-00001-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9be028dc81d8ae5c691cd376e91ec3e4e576b97bf44da0f737ac4e5bd316166
3
+ size 247182371
situate_plus/train-00002-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23e77e9f9b71064bfda0078e64db361a58f125e9b1e785dc3b5713c9904098f8
3
+ size 243053754
situate_plus/train-00003-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:244387da436eaf91b38a77b44cde22293efcebe9fe8f04619fd480d5c21aba7f
3
+ size 245631220
situate_plus/train-00004-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75a917141ce7ad44e12b1538886b368fd0663b829997406f5f7aa9c2ebd9f827
3
+ size 243435430
situate_plus/train-00005-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f222fb05691631a63e940dffdebc3b4437e76c6661e35656eaf24683543cb86a
3
+ size 246319949
situate_plus/train-00006-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:364abbd5ede30461a622449ebb0f4fddbf69b4fde66c2c09ccbafda81ba39507
3
+ size 247453188
situate_plus/train-00007-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b031523685cf1159a72ce8606643f15c873374d5d404e6350228ea7f6b7b68a6
3
+ size 248657114
situate_plus/train-00008-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81400aa86fbdb1fb8fa54edbae0f3f9d7d8aaff8672fef84e5aaecd24e262a32
3
+ size 244868632
situate_plus/train-00009-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6850e51dd812979a8903608f74ed7a43ea4138ee85f2c1693aef63b856e7496
3
+ size 243672198
situate_plus/train-00010-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c6bb18a7411dd8befc74d6f74ed4fbf3cd50fbcf7d49b9627cfa4dfb7d6da3a
3
+ size 244012998
situate_plus/train-00011-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6c9b3f85f04b9430c3c639b2fcbf61818bf3e1f7bd69d9469e42a215198e4c3
3
+ size 246622354
situate_plus/train-00012-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18b3594c2cce0015d04d4cd583db88a31f420355de926648bad324cb61817dbb
3
+ size 247633394
situate_plus/train-00013-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9f97ce40b9d5156d65eda45aa3c109830b72da26fd6fa805c048760653340da
3
+ size 247133936
situate_plus/train-00014-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:057bf2fb5f2bd6670625ebeb2de26cfce619f385506d96086e5dd0ffb7b563d9
3
+ size 246814424
situate_plus/train-00015-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cb42954d272c244badfa6e67bc4cc092476400b62a040d8bf32246ecb21a8d8
3
+ size 250208409
situate_plus/train-00016-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23cfeea1c561923c6bff6bc7c505d0833e27157e066049e7695c5315525da3cc
3
+ size 246753346
situate_plus/train-00017-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c9f350fca2c4abee741572d7cfc3ef97b3630a54c3228907ab0351a536940c5
3
+ size 250047322
situate_plus/train-00018-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7387c7c3e5d315dd2ef4c8dcb0c8e70da61bb96e35e2fb91b25870b00fc990c
3
+ size 250692056
situate_plus/train-00019-of-00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a73e9052108d566d38a9f01541e6809609a14b02f2f8419d51270e0926b654c7
3
+ size 252950625