asdadaac commited on
Commit
a880fd6
·
verified ·
1 Parent(s): 3c86e83

Sync folder via upload_folder API

Browse files
.gitattributes CHANGED
@@ -61,3 +61,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
61
  HPD/qwen/HPD_train_data_qwen.json filter=lfs diff=lfs merge=lfs -text
62
  HPD/qwen/HPD_train_data_qwen_rev.json filter=lfs diff=lfs merge=lfs -text
63
  HPD/train_data.json filter=lfs diff=lfs merge=lfs -text
 
 
61
  HPD/qwen/HPD_train_data_qwen.json filter=lfs diff=lfs merge=lfs -text
62
  HPD/qwen/HPD_train_data_qwen_rev.json filter=lfs diff=lfs merge=lfs -text
63
  HPD/train_data.json filter=lfs diff=lfs merge=lfs -text
64
+ OpenAI-4o_t2i_human_preference/train_data.json filter=lfs diff=lfs merge=lfs -text
OpenAI-4o_t2i_human_preference/.gitattributes ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
OpenAI-4o_t2i_human_preference/README.md ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ features:
4
+ - name: prompt
5
+ dtype: string
6
+ - name: image1
7
+ dtype: image
8
+ - name: image2
9
+ dtype: image
10
+ - name: model1
11
+ dtype: string
12
+ - name: model2
13
+ dtype: string
14
+ - name: weighted_results_image1_preference
15
+ dtype: float32
16
+ - name: weighted_results_image2_preference
17
+ dtype: float32
18
+ - name: detailed_results_preference
19
+ dtype: string
20
+ - name: weighted_results_image1_coherence
21
+ dtype: float32
22
+ - name: weighted_results_image2_coherence
23
+ dtype: float32
24
+ - name: detailed_results_coherence
25
+ dtype: string
26
+ - name: weighted_results_image1_alignment
27
+ dtype: float32
28
+ - name: weighted_results_image2_alignment
29
+ dtype: float32
30
+ - name: detailed_results_alignment
31
+ dtype: string
32
+ splits:
33
+ - name: train
34
+ num_bytes: 10832696953.0
35
+ num_examples: 13000
36
+ download_size: 5203247080
37
+ dataset_size: 10832696953.0
38
+ configs:
39
+ - config_name: default
40
+ data_files:
41
+ - split: train
42
+ path: data/train-*
43
+ license: cdla-permissive-2.0
44
+ task_categories:
45
+ - text-to-image
46
+ - image-to-text
47
+ - image-classification
48
+ - reinforcement-learning
49
+ language:
50
+ - en
51
+ tags:
52
+ - Human
53
+ - Preference
54
+ - Coherence
55
+ - Alignment
56
+ - country
57
+ - language
58
+ - flux
59
+ - midjourney
60
+ - dalle3
61
+ - stabeldiffusion
62
+ - alignment
63
+ - flux1.1
64
+ - flux1
65
+ - imagen3
66
+ - aurora
67
+ - lumina
68
+ - recraft
69
+ - recraft v2
70
+ - ideogram
71
+ - frames
72
+ - OpenAI 4o
73
+ - 4o
74
+ - OpenAI
75
+ size_categories:
76
+ - 10K<n<100K
77
+ pretty_name: OpenAI 4o vs. Ideogram V2 / Recraft V2 / Lumina-15-2-25 / Frames-23-1-25
78
+ / Aurora / imagen-3 / Flux-1.1-pro / Flux-1-pro / Dalle-3 / Midjourney-5.2 / Stabel-Diffusion-3
79
+ - Human Preference Dataset
80
+ ---
81
+
82
+ <style>
83
+
84
+ .vertical-container {
85
+ display: flex;
86
+ flex-direction: column;
87
+ gap: 60px;
88
+ }
89
+
90
+ .horizontal-container {
91
+ display: flex;
92
+ flex-direction: row;
93
+ justify-content: center;
94
+ gap: 60px;
95
+ }
96
+
97
+ .image-container img {
98
+ max-height: 250px; /* Set the desired height */
99
+ margin:0;
100
+ object-fit: contain; /* Ensures the aspect ratio is maintained */
101
+ width: auto; /* Adjust width automatically based on height */
102
+ box-sizing: content-box;
103
+ }
104
+
105
+ .image-container img.big {
106
+ max-height: 350px; /* Set the desired height */
107
+ }
108
+
109
+
110
+ .image-container {
111
+ display: flex; /* Aligns images side by side */
112
+ justify-content: space-around; /* Space them evenly */
113
+ align-items: center; /* Align them vertically */
114
+ gap: .5rem
115
+ }
116
+
117
+ .container {
118
+ width: 90%;
119
+ margin: 0 auto;
120
+ }
121
+
122
+ .text-center {
123
+ text-align: center;
124
+ }
125
+
126
+ .score-amount {
127
+ margin: 0;
128
+ margin-top: 10px;
129
+ }
130
+
131
+ .score-percentage {Score:
132
+ font-size: 12px;
133
+ font-weight: semi-bold;
134
+ }
135
+
136
+ </style>
137
+
138
+ # Rapidata OpenAI 4o Preference
139
+
140
+ <a href="https://www.rapidata.ai">
141
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/66f5624c42b853e73e0738eb/jfxR79bOztqaC6_yNNnGU.jpeg" width="400" alt="Dataset visualization">
142
+ </a>
143
+
144
+ This T2I dataset contains over 200'000 human responses from over ~45,000 individual annotators, collected in less than half a day using the [Rapidata Python API](https://docs.rapidata.ai), accessible to anyone and ideal for large scale evaluation.
145
+ Evaluating OpenAI 4o (version from 26.3.2025) across three categories: preference, coherence, and alignment.
146
+
147
+ Explore our latest model rankings on our [website](https://www.rapidata.ai/benchmark).
148
+
149
+ If you get value from this dataset and would like to see more in the future, please consider liking it ❤️
150
+
151
+ ## Overview
152
+
153
+ The evaluation consists of 1v1 comparisons between OpenAI 4o (version from 26.3.2025) and 12 other models: Ideogram V2, Recraft V2, Lumina-15-2-25, Frames-23-1-25, Imagen-3, Flux-1.1-pro, Flux-1-pro, DALL-E 3, Midjourney-5.2, Stable Diffusion 3, Aurora, and Janus-7b.
154
+
155
+ Below, you'll find key visualizations that highlight how these models compare in terms of prompt alignment and coherence, where OpenAI 4o (version from 26.3.2025) significantly outperforms the other models.
156
+
157
+ <div style="width: 100%; display: flex; justify-content: center; align-items: center; gap: 20px;">
158
+ <div style="width: 90%; max-width: 1000px;">
159
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/fMf6_uredbYDY7Hzuyk9J.png" style="width: 95%; height: auto; display: block;">
160
+ </div>
161
+ <div style="width: 90%; max-width: 1000px;">
162
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/rMjvWjG8HFql65D47TGsZ.png" style="width: 100%; height: auto; display: block;">
163
+ </div>
164
+ </div>
165
+
166
+ ## Master of Absurd Prompts
167
+ The benchmark intentially includes a range of absurd or conflicting prompts that aim to target situations or scenes that are very unlikely to occur in the training data
168
+ such as *'A Chair on a cat'* or *'Car is bigger than the airplane.'*. Most other models struggle to adhere to these prompts consistently, but the 4o image generation model
169
+ appears to be significantly ahead of the competition in this regard.
170
+
171
+ <div class="horizontal-container">
172
+ <div clas="container">
173
+ <div class="text-center">
174
+ <q>A chair on a cat.</q>
175
+ </div>
176
+ <div class="image-container">
177
+ <div>
178
+ <h3 class="score-amount">OpenAI 4o</h3>
179
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/kS2uE91Q3QAKxR205DxS_.webp" width=300>
180
+ </div>
181
+ <div>
182
+ <h3 class="score-amount">Imagen 3 </h3>
183
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/KKQRsy9xzJVs7QsYyhuzp.jpeg" width=300>
184
+ </div>
185
+ </div>
186
+ </div>
187
+ <div clas="container">
188
+ <div class="text-center">
189
+ <q>Car is bigger than the airplane.</q>
190
+ </div>
191
+ <div class="image-container">
192
+ <div>
193
+ <h3 class="score-amount">OpenAI 4o</h3>
194
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/TWSsbPFxVJgaHW0gVCR2a.webp" width=300>
195
+ </div>
196
+ <div>
197
+ <h3 class="score-amount">Flux1.1-pro</h3>
198
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/7w3Ls8a6PmuR1ZR1J72Zk.jpeg" width=300>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ </div>
203
+
204
+ That being said, some of the 'absurd' prompts are still not fully solved.
205
+
206
+ <div class="horizontal-container">
207
+ <div clas="container">
208
+ <div class="text-center">
209
+ <q>A fish eating a pelican.</q>
210
+ </div>
211
+ <div class="image-container">
212
+ <div>
213
+ <h3 class="score-amount">OpenAI 4o</h3>
214
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/xsJ2E_0Kx5gJjIO6C29-Q.webp" width=300>
215
+ </div>
216
+ <div>
217
+ <h3 class="score-amount">Recraft V2</h3>
218
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/R7Zf5dmhvjUTgkBMEx9Ns.webp" width=300>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ <div clas="container">
223
+ <div class="text-center">
224
+ <q>A horse riding an astronaut.</q>
225
+ </div>
226
+ <div class="image-container">
227
+ <div>
228
+ <h3 class="score-amount">OpenAI 4o</h3>
229
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/RretHzxWGlXsjD9gXmg2k.webp" width=300>
230
+ </div>
231
+ <div>
232
+ <h3 class="score-amount">Ideogram</h3>
233
+ <img class="big" src="https://cdn-uploads.huggingface.co/production/uploads/6710d82fd3a72fc574ea620f/qtVKN58c0JgCYKK2Xc5bT.png" width=300>
234
+ </div>
235
+ </div>
236
+ </div>
237
+ </div>
238
+
239
+
240
+ ## Alignment
241
+
242
+ The alignment score quantifies how well an video matches its prompt. Users were asked: "Which image matches the description better?".
243
+
244
+ <div class="vertical-container">
245
+ <div class="container">
246
+ <div class="text-center">
247
+ <q>A baseball player in a blue and white uniform is next to a player in black and white .</q>
248
+ </div>
249
+ <div class="image-container">
250
+ <div>
251
+ <h3 class="score-amount">OpenAI 4o</h3>
252
+ <div class="score-percentage">Score: 100%</div>
253
+ <img style="border: 5px solid #18c54f;" src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/pzKcqdCXwVDZi5lwgoeGv.jpeg" width=500>
254
+ </div>
255
+ <div>
256
+ <h3 class="score-amount">Stable Diffusion 3 </h3>
257
+ <div class="score-percentage">Score: 0%</div>
258
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/rbxFhkeir8TUTK-vYDn6Q.jpeg" width=500>
259
+ </div>
260
+ </div>
261
+ </div>
262
+
263
+ <div class="container">
264
+ <div class="text-center">
265
+ <q>A couple of glasses are sitting on a table.</q>
266
+ </div>
267
+ <div class="image-container">
268
+ <div>
269
+ <h3 class="score-amount">OpenAI 4o</h3>
270
+ <div class="score-percentage">Score: 2.8%</div>
271
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/AY-I6WqgUF4Eh3thLkAqJ.jpeg" width=500>
272
+ </div>
273
+ <div>
274
+ <h3 class="score-amount">Dalle-3</h3>
275
+ <div class="score-percentage">Score: 97.2%</div>
276
+ <img style="border: 5px solid #18c54f;" src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/3ygGq2P4dS6rfh5q-x3jb.jpeg" width=500>
277
+ </div>
278
+ </div>
279
+ </div>
280
+ </div>
281
+
282
+ ## Coherence
283
+
284
+ The coherence score measures whether the generated video is logically consistent and free from artifacts or visual glitches. Without seeing the original prompt, users were asked: "Which image has **more** glitches and is **more** likely to be AI generated?"
285
+
286
+ <div class="vertical-container">
287
+ <div class="container">
288
+ <div class="image-container">
289
+ <div>
290
+ <h3 class="score-amount">OpenAI 4o </h3>
291
+ <div class="score-percentage">Glitch Rating: 0%</div>
292
+ <img style="border: 5px solid #18c54f;" src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/DzuAiklD3R_pwe-yFtRM7.jpeg" width=500>
293
+ </div>
294
+ <div>
295
+ <h3 class="score-amount">Lumina-15-2-25 </h3>
296
+ <div class="score-percentage">Glitch Rating: 100%</div>
297
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/iAn4zphOEL_cpOorp0JNZ.jpeg" width=500>
298
+ </div>
299
+ </div>
300
+ </div>
301
+
302
+ <div class="container">
303
+ <div class="image-container">
304
+ <div>
305
+ <h3 class="score-amount">OpenAI 4o </h3>
306
+ <div class="score-percentage">Glitch Rating: 98.6%</div>
307
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/IeJHwzNc77tjVAKf8nGEk.jpeg" width=500>
308
+ </div>
309
+ <div>
310
+ <h3 class="score-amount">Recraft V2</h3>
311
+ <div class="score-percentage">Glitch Rating: 1.4%</div>
312
+ <img style="border: 5px solid #18c54f;" src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/iCuVaPrVGbDeLHuqbMgkc.jpeg" width=500>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ </div>
317
+
318
+ ## Preference
319
+
320
+ The preference score reflects how visually appealing participants found each image, independent of the prompt. Users were asked: "Which image do you prefer?"
321
+
322
+ <div class="vertical-container">
323
+ <div class="container">
324
+ <div class="image-container">
325
+ <div>
326
+ <h3 class="score-amount">OpenAI 4o</h3>
327
+ <div class="score-percentage">Score: 100%</div>
328
+ <img style="border: 5px solid #18c54f;" src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/ve4DVzU0kZznjA9N0AdkO.jpeg" width=500>
329
+ </div>
330
+ <div>
331
+ <h3 class="score-amount">Lumina-15-2-25</h3>
332
+ <div class="score-percentage">Score: 0%</div>
333
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/zTZRillcEV85C9gfLa25L.jpeg" width=500>
334
+ </div>
335
+ </div>
336
+ </div>
337
+
338
+ <div class="container">
339
+ <div class="image-container">
340
+ <div>
341
+ <h3 class="score-amount">OpenAI 4o </h3>
342
+ <div class="score-percentage">Score: 0%</div>
343
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/0EmcYSDQeseS1XSWyG-lb.jpeg" width=500>
344
+ </div>
345
+ <div>
346
+ <h3 class="score-amount">Flux-1.1 Pro </h3>
347
+ <div class="score-percentage">Score: 100%</div>
348
+ <img style="border: 5px solid #18c54f;" src="https://cdn-uploads.huggingface.co/production/uploads/664dcc6296d813a7e15e170e/MO7RnVUWC0gR84PIKDuyI.jpeg" width=500>
349
+ </div>
350
+ </div>
351
+ </div>
352
+ </div>
353
+
354
+ ## About Rapidata
355
+
356
+ Rapidata's technology makes collecting human feedback at scale faster and more accessible than ever before. Visit [rapidata.ai](https://www.rapidata.ai/) to learn more about how we're revolutionizing human feedback collection for AI development.
OpenAI-4o_t2i_human_preference/data.tar.gz.part-000 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62a08068ec2019d7c4dbdfdaa87100590be7052081b3aed1e94d70d2c14a211b
3
+ size 5368709120
OpenAI-4o_t2i_human_preference/data.tar.gz.part-001 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08d8f50251f5d08b350e27bd7488a0cdfcc0830f3dcca1e4a83a3af473ec2963
3
+ size 5196481255
OpenAI-4o_t2i_human_preference/read.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pyarrow.parquet as pq
2
+ from pathlib import Path
3
+ import json
4
+ from typing import List, Dict, Any, Optional
5
+
6
+ def write_json(file_path: str, data: Any):
7
+ with open(file_path, "w", encoding="utf-8") as f:
8
+ json.dump(data, f, ensure_ascii=False, indent=4)
9
+
10
+ data_dir = Path("/inspire/qb-ilm/project/deepgen/wangdianyi-240107110022/BXH/RL_Data/OpenAI-4o_t2i_human_preference/data")
11
+ out_dir = Path("/inspire/qb-ilm/project/deepgen/wangdianyi-240107110022/BXH/T2I-CoReBench-main/Bench/GEditBench-v2/Images")
12
+ out_dir.mkdir(parents=True, exist_ok=True)
13
+
14
+ parquet_files = sorted(data_dir.glob("*.parquet"))
15
+
16
+ total_saved = 0
17
+ total_skipped = 0
18
+
19
+ save_data = []
20
+
21
+ idx = 1
22
+ save_data = []
23
+
24
+ for parquet_path in parquet_files:
25
+ print(f"\nreading {parquet_path}")
26
+
27
+ pf = pq.ParquetFile(parquet_path)
28
+
29
+ for rg in range(pf.num_row_groups):
30
+ table = pf.read_row_group(rg).combine_chunks()
31
+ rows = table.to_pylist()
32
+
33
+ for i, row in enumerate(rows):
34
+ prompt = row['prompt']
35
+ image1_score = row['weighted_results_image1_preference']
36
+ image2_score = row['weighted_results_image2_preference']
37
+ gpt_value = ""
38
+ if image1_score > image2_score:
39
+ gpt_value = "Image 1 is better than Image 2."
40
+ image1_path = f'images/{idx}_chosen.png'
41
+ image2_path = f"images/{idx}_rejected.png"
42
+ elif image2_score > image1_score:
43
+ gpt_value = "Image 2 is better than Image 1."
44
+ image2_path = f'images/{idx}_chosen.png'
45
+ image1_path = f"images/{idx}_rejected.png"
46
+
47
+ print(row['image1'].keys())
48
+ image1_byte = row['image1']['bytes']
49
+ import os
50
+ with open(os.path.join("/inspire/qb-ilm/project/deepgen/wangdianyi-240107110022/BXH/RL_Data/OpenAI-4o_t2i_human_preference",image1_path), "wb") as f:
51
+ f.write(image1_byte)
52
+
53
+
54
+ image2_byte = row['image2']['bytes']
55
+ with open(os.path.join("/inspire/qb-ilm/project/deepgen/wangdianyi-240107110022/BXH/RL_Data/OpenAI-4o_t2i_human_preference",image2_path), "wb") as f:
56
+ f.write(image2_byte)
57
+
58
+ template = {
59
+ "id": f"{idx}",
60
+ "prompt": f"{prompt}",
61
+ "conversations": [
62
+ {
63
+ "from": "human",
64
+ "value": "<image>\n <image>\nYou are given a text caption and two generated images based on that caption. Your task is to evaluate and compare these images based on two key criteria:\n1. Alignment with the Caption: Assess how well each image aligns with the provided caption. Consider the accuracy of depicted objects, their relationships, and attributes as described in the caption.\n2. Overall Image Quality: Examine the visual quality of each image, including clarity, detail preservation, color accuracy, and overall aesthetic appeal.\nCompare both images using the above criteria and select the one that better aligns with the caption while exhibiting superior visual quality.\nProvide a clear conclusion such as \"Image 1 is better than Image 2.\", \"Image 2 is better than Image 1.\" and \"Both images are equally good.\".\nYour task is provided as follows:\nText Caption: [A harmoniously crafted glass sculpture, cinematically capturing the interplay of fire and ice, with dramatic lighting and deep, rich colors.]"
65
+ },
66
+ {
67
+ "from": "gpt",
68
+ "value": gpt_value
69
+ }
70
+ ],
71
+ "images": [
72
+ image1_path,
73
+ image2_path
74
+ ]
75
+ }
76
+ idx += 1
77
+ save_data.append(template)
78
+
79
+ write_json("/inspire/qb-ilm/project/deepgen/wangdianyi-240107110022/BXH/RL_Data/OpenAI-4o_t2i_human_preference/train_data.json", save_data)
OpenAI-4o_t2i_human_preference/train_data.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1013a3175805d5d188e533c164d7e2f988e577cebf7cb7a320aab886951ad734
3
+ size 19677435