GuangsTrip commited on
Commit
63e2e73
·
verified ·
1 Parent(s): d947b48

Replace empty preview B cells with explicit no-second-input cards

Browse files
README.md CHANGED
@@ -185,8 +185,8 @@ This package does not grant additional rights over the source media.
185
  ## Optional visual preview
186
 
187
  `preview/test.parquet` embeds JPEG thumbnails in two Image-typed columns, `input_a`
188
- and `input_b`, alongside the original question and sample ID. `input_b` is null for
189
- single-scene samples. `preview/manifest.json` records source hashes, preview hashes,
190
  and exact video sampling indices. `preview/build_preview.py` reproduces the browser
191
  assets from the extracted release. These optional files are independent of the release
192
  JSONL, archive hashes, and evaluation paths. An unfiltered whole-repository download
@@ -209,3 +209,7 @@ unchanged and is still the canonical downloadable evaluation artifact.
209
  The optional browser files add approximately 162 MiB to an unfiltered snapshot.
210
  The root `upload_manifest.json` lists required release artifacts under `artifacts`
211
  and optional browser artifacts separately under `optional_artifacts`.
 
 
 
 
 
185
  ## Optional visual preview
186
 
187
  `preview/test.parquet` embeds JPEG thumbnails in two Image-typed columns, `input_a`
188
+ and `input_b`, alongside the original question and sample ID. `input_b` displays a **NO SECOND INPUT** placeholder for
189
+ single-scene samples. This is a browser-only card, not an additional media input. `preview/manifest.json` records source hashes, preview hashes,
190
  and exact video sampling indices. `preview/build_preview.py` reproduces the browser
191
  assets from the extracted release. These optional files are independent of the release
192
  JSONL, archive hashes, and evaluation paths. An unfiltered whole-repository download
 
209
  The optional browser files add approximately 162 MiB to an unfiltered snapshot.
210
  The root `upload_manifest.json` lists required release artifacts under `artifacts`
211
  and optional browser artifacts separately under `optional_artifacts`.
212
+
213
+ For single-scene questions, the B column displays “NO SECOND INPUT” instead of
214
+ an empty Image cell, avoiding the HF Viewer’s misleading pagination warning.
215
+ Actual input counts and paths remain unchanged in `public` and the release JSONL.
preview/build_preview.py CHANGED
@@ -17,6 +17,22 @@ def digest(data):
17
  return hashlib.sha256(data).hexdigest()
18
 
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  def build(root, output, workers):
21
  import cv2
22
  from PIL import Image, ImageDraw, ImageOps
@@ -97,6 +113,7 @@ def build(root, output, workers):
97
  'sample_id': Value('string'), 'input_roles': Value('string'),
98
  'media_paths': Value('string'), 'preview_note': Value('string'),
99
  })
 
100
  records = []
101
  for row in public:
102
  items = row['media']
@@ -105,12 +122,13 @@ def build(root, output, workers):
105
  image = lambda item: {'bytes': cache[item['path']], 'path': Path(item['path']).stem + '.jpg'}
106
  records.append(dict(
107
  question=row['messages'][-1]['content'], input_a=image(items[0]),
108
- input_b=image(items[1]) if len(items) == 2 else None,
109
  modality=modality, scene_relation='single_scene' if len(items) == 1 else 'cross_scene',
110
  sample_id=row['sample_id'], input_roles=', '.join(item['role'] for item in items),
111
  media_paths=json.dumps([item['path'] for item in items]),
112
  preview_note=('Resized image preview; use original media for evaluation.' if modality == 'image' else
113
- '16-frame contact sheet, F1-F16 in row-major order; use original video for evaluation.'),
 
114
  ))
115
  dataset = Dataset.from_list(records, features=features)
116
  parquet = output / 'test.parquet'
@@ -121,18 +139,22 @@ def build(root, output, workers):
121
  assert row['sample_id'] == public[i]['sample_id']
122
  assert row['question'] == public[i]['messages'][-1]['content']
123
  assert row['input_a'].width > 0
124
- assert (row['input_b'] is not None) == (len(public[i]['media']) == 2)
 
 
125
  public_dataset = Dataset.from_json(str(public_path))
126
  public_parquet = output / 'public.parquet'
127
  public_dataset.to_parquet(str(public_parquet))
128
  restored_public = Dataset.from_parquet(str(public_parquet))
129
  assert restored_public.features == public_dataset.features
130
  assert restored_public.to_list() == public_dataset.to_list()
131
- manifest = dict(version='asr-bench-1k-preview-v1', records=len(records),
132
  modality=dict(Counter(r['modality'] for r in records)),
133
  source_public_sha256=digest(public_path.read_bytes()),
134
  public_parquet={'bytes': public_parquet.stat().st_size, 'sha256': digest(public_parquet.read_bytes())},
135
  preview_only=True, hidden_annotations_read=False,
 
 
136
  test_parquet={'bytes': parquet.stat().st_size, 'sha256': digest(parquet.read_bytes())},
137
  unique_media=len(media), media=audits)
138
  (output / 'manifest.json').write_text(json.dumps(manifest, indent=2) + '\n')
 
17
  return hashlib.sha256(data).hexdigest()
18
 
19
 
20
+ def no_second_input():
21
+ """Display-only card for a single-scene sample; never an evaluation input."""
22
+ from PIL import Image, ImageDraw, ImageFont
23
+ picture = Image.new('RGB', (640, 360), '#f1f5f9')
24
+ draw = ImageDraw.Draw(picture)
25
+ for y, text, size, color in [
26
+ (120, 'NO SECOND INPUT', 36, '#334155'),
27
+ (182, 'Single-scene question', 24, '#475569'),
28
+ (250, 'Display placeholder only', 18, '#64748b'),
29
+ ]:
30
+ draw.text((320, y), text, font=ImageFont.load_default(size=size), anchor='mm', fill=color)
31
+ buffer = io.BytesIO()
32
+ picture.save(buffer, format='PNG')
33
+ return {'bytes': buffer.getvalue(), 'path': 'no-second-input.png'}
34
+
35
+
36
  def build(root, output, workers):
37
  import cv2
38
  from PIL import Image, ImageDraw, ImageOps
 
113
  'sample_id': Value('string'), 'input_roles': Value('string'),
114
  'media_paths': Value('string'), 'preview_note': Value('string'),
115
  })
116
+ placeholder = no_second_input()
117
  records = []
118
  for row in public:
119
  items = row['media']
 
122
  image = lambda item: {'bytes': cache[item['path']], 'path': Path(item['path']).stem + '.jpg'}
123
  records.append(dict(
124
  question=row['messages'][-1]['content'], input_a=image(items[0]),
125
+ input_b=image(items[1]) if len(items) == 2 else placeholder,
126
  modality=modality, scene_relation='single_scene' if len(items) == 1 else 'cross_scene',
127
  sample_id=row['sample_id'], input_roles=', '.join(item['role'] for item in items),
128
  media_paths=json.dumps([item['path'] for item in items]),
129
  preview_note=('Resized image preview; use original media for evaluation.' if modality == 'image' else
130
+ '16-frame contact sheet, F1-F16 in row-major order; use original video for evaluation.') +
131
+ (' Input B is a display placeholder; this sample has one actual media input.' if len(items) == 1 else ''),
132
  ))
133
  dataset = Dataset.from_list(records, features=features)
134
  parquet = output / 'test.parquet'
 
139
  assert row['sample_id'] == public[i]['sample_id']
140
  assert row['question'] == public[i]['messages'][-1]['content']
141
  assert row['input_a'].width > 0
142
+ assert row['input_b'].width > 0
143
+ if len(public[i]['media']) == 1:
144
+ assert row['input_b'].size == (640, 360)
145
  public_dataset = Dataset.from_json(str(public_path))
146
  public_parquet = output / 'public.parquet'
147
  public_dataset.to_parquet(str(public_parquet))
148
  restored_public = Dataset.from_parquet(str(public_parquet))
149
  assert restored_public.features == public_dataset.features
150
  assert restored_public.to_list() == public_dataset.to_list()
151
+ manifest = dict(version='asr-bench-1k-preview-v2', records=len(records),
152
  modality=dict(Counter(r['modality'] for r in records)),
153
  source_public_sha256=digest(public_path.read_bytes()),
154
  public_parquet={'bytes': public_parquet.stat().st_size, 'sha256': digest(public_parquet.read_bytes())},
155
  preview_only=True, hidden_annotations_read=False,
156
+ empty_input_b={'display': 'NO SECOND INPUT', 'count': sum(len(r['media']) == 1 for r in public),
157
+ 'placeholder_sha256': digest(placeholder['bytes'])},
158
  test_parquet={'bytes': parquet.stat().st_size, 'sha256': digest(parquet.read_bytes())},
159
  unique_media=len(media), media=audits)
160
  (output / 'manifest.json').write_text(json.dumps(manifest, indent=2) + '\n')
preview/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "version": "asr-bench-1k-preview-v1",
3
  "records": 1000,
4
  "modality": {
5
  "image": 751,
@@ -9,8 +9,8 @@
9
  "preview_only": true,
10
  "hidden_annotations_read": false,
11
  "test_parquet": {
12
- "bytes": 166181254,
13
- "sha256": "8cc517bdb1948695d5090ef679679fcc1c03d7c4199bd940d55a500bb8cb75aa"
14
  },
15
  "unique_media": 902,
16
  "media": {
@@ -16018,8 +16018,13 @@
16018
  "sha256": "3e981ee725e19ecfa0f8d79fa7dee14cb97d9751e3c1ce5452f1d9f524c103be"
16019
  },
16020
  "build_script": {
16021
- "bytes": 7507,
16022
- "sha256": "9258b0d187508b0dfc497aca67dc603631ae8bc62e640da07bb779438c7ce683"
16023
  },
16024
- "public_default_equivalence_verified": true
 
 
 
 
 
16025
  }
 
1
  {
2
+ "version": "asr-bench-1k-preview-v2",
3
  "records": 1000,
4
  "modality": {
5
  "image": 751,
 
9
  "preview_only": true,
10
  "hidden_annotations_read": false,
11
  "test_parquet": {
12
+ "bytes": 171475353,
13
+ "sha256": "7be86746a6930a4bb7e9def39a3a92f859898d861c377c7150ff676145590553"
14
  },
15
  "unique_media": 902,
16
  "media": {
 
16018
  "sha256": "3e981ee725e19ecfa0f8d79fa7dee14cb97d9751e3c1ce5452f1d9f524c103be"
16019
  },
16020
  "build_script": {
16021
+ "bytes": 8626,
16022
+ "sha256": "1bb70ca864895dd056722bf68a7dfaeba946a2560c41541a6078e3b0f98078a9"
16023
  },
16024
+ "public_default_equivalence_verified": true,
16025
+ "empty_input_b": {
16026
+ "display": "NO SECOND INPUT",
16027
+ "count": 427,
16028
+ "placeholder_sha256": "fe1295e47d1b9c1b971f96a0e5143f5e057edef0be58399909f3dab77b5bb7dc"
16029
+ }
16030
  }
preview/no-second-input.png ADDED

Git LFS Details

  • SHA256: fe1295e47d1b9c1b971f96a0e5143f5e057edef0be58399909f3dab77b5bb7dc
  • Pointer size: 130 Bytes
  • Size of remote file: 12.4 kB
preview/test.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8cc517bdb1948695d5090ef679679fcc1c03d7c4199bd940d55a500bb8cb75aa
3
- size 166181254
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7be86746a6930a4bb7e9def39a3a92f859898d861c377c7150ff676145590553
3
+ size 171475353
upload_manifest.json CHANGED
@@ -4311,8 +4311,8 @@
4311
  },
4312
  "artifacts": {
4313
  "README.md": {
4314
- "bytes": 9729,
4315
- "sha256": "67963b4a742bbb15020311936ce76a0a595991612070275a00bbd528118ce773"
4316
  },
4317
  "SOURCE_README.md": {
4318
  "bytes": 16258,
@@ -4353,20 +4353,20 @@
4353
  },
4354
  "optional_artifacts": {
4355
  "preview/build_preview.py": {
4356
- "bytes": 7507,
4357
- "sha256": "9258b0d187508b0dfc497aca67dc603631ae8bc62e640da07bb779438c7ce683"
4358
  },
4359
  "preview/manifest.json": {
4360
- "bytes": 413321,
4361
- "sha256": "c220d62afb0b5ee021c1c666212fb5d0485bc3a6067d12722b1363acb5e92a43"
4362
  },
4363
  "preview/public.parquet": {
4364
  "bytes": 3457541,
4365
  "sha256": "3e981ee725e19ecfa0f8d79fa7dee14cb97d9751e3c1ce5452f1d9f524c103be"
4366
  },
4367
  "preview/test.parquet": {
4368
- "bytes": 166181254,
4369
- "sha256": "8cc517bdb1948695d5090ef679679fcc1c03d7c4199bd940d55a500bb8cb75aa"
4370
  },
4371
  "preview/examples/001e6903e380f50c6bc10549c1b68306-input_a.jpg": {
4372
  "bytes": 73980,
@@ -4379,6 +4379,10 @@
4379
  "preview/examples/00509805f1e11ad8ce67ba91b14a3fb3-input_a.jpg": {
4380
  "bytes": 160513,
4381
  "sha256": "80446339bd583a920d60756cb788af806a0ce5db6469b32d7d1743355195007c"
 
 
 
 
4382
  }
4383
  }
4384
  }
 
4311
  },
4312
  "artifacts": {
4313
  "README.md": {
4314
+ "bytes": 10069,
4315
+ "sha256": "f6014bc18c572a3ab7df91fea64d88720601a8935e806713f3ac4d8636b62a29"
4316
  },
4317
  "SOURCE_README.md": {
4318
  "bytes": 16258,
 
4353
  },
4354
  "optional_artifacts": {
4355
  "preview/build_preview.py": {
4356
+ "bytes": 8626,
4357
+ "sha256": "1bb70ca864895dd056722bf68a7dfaeba946a2560c41541a6078e3b0f98078a9"
4358
  },
4359
  "preview/manifest.json": {
4360
+ "bytes": 413492,
4361
+ "sha256": "0ce0eb90a951db9b49b3eff5fc0d8fc2ab263fc71f8e1e0888269f050a71e7de"
4362
  },
4363
  "preview/public.parquet": {
4364
  "bytes": 3457541,
4365
  "sha256": "3e981ee725e19ecfa0f8d79fa7dee14cb97d9751e3c1ce5452f1d9f524c103be"
4366
  },
4367
  "preview/test.parquet": {
4368
+ "bytes": 171475353,
4369
+ "sha256": "7be86746a6930a4bb7e9def39a3a92f859898d861c377c7150ff676145590553"
4370
  },
4371
  "preview/examples/001e6903e380f50c6bc10549c1b68306-input_a.jpg": {
4372
  "bytes": 73980,
 
4379
  "preview/examples/00509805f1e11ad8ce67ba91b14a3fb3-input_a.jpg": {
4380
  "bytes": 160513,
4381
  "sha256": "80446339bd583a920d60756cb788af806a0ce5db6469b32d7d1743355195007c"
4382
+ },
4383
+ "preview/no-second-input.png": {
4384
+ "bytes": 12370,
4385
+ "sha256": "fe1295e47d1b9c1b971f96a0e5143f5e057edef0be58399909f3dab77b5bb7dc"
4386
  }
4387
  }
4388
  }