Datasets:
Deliver verified Stage-3 Small: 1M train, 50K validation, 50K test
Browse files- README.md +1 -1
- small/README.md +2 -2
- small/code-tests.json +1 -1
- small/tools/build_stage3_small.py +10 -4
- small/verification.json +4 -4
README.md
CHANGED
|
@@ -37,7 +37,7 @@ configs:
|
|
| 37 |
<!-- STAGE3_SMALL_START -->
|
| 38 |
## Small: prior-restoration experiment
|
| 39 |
|
| 40 |
-
**Ready:** 1,000,000 train + 50,000 validation + 50,000 test rows. Use config `small`, pinned tag `small-v1.0`. [Design, exact task/source/modality counts and loading guide](small/README.md). Uses normalized answer targets and a grounding-aware media loader. **The original media_complete config includes these held-out groups; do not train it unfiltered when evaluating on Small.**
|
| 41 |
|
| 42 |
<!-- STAGE3_SMALL_END -->
|
| 43 |
|
|
|
|
| 37 |
<!-- STAGE3_SMALL_START -->
|
| 38 |
## Small: prior-restoration experiment
|
| 39 |
|
| 40 |
+
**Ready:** 1,000,000 train + 50,000 validation + 50,000 test rows. Use config `small`, pinned tag `small-v1.0.1`. [Design, exact task/source/modality counts and loading guide](small/README.md). Uses normalized answer targets and a grounding-aware media loader. **The original media_complete config includes these held-out groups; do not train it unfiltered when evaluating on Small.**
|
| 41 |
|
| 42 |
<!-- STAGE3_SMALL_END -->
|
| 43 |
|
small/README.md
CHANGED
|
@@ -86,7 +86,7 @@ Small 是独立 HF config `small`。原 `media_complete` 保持不变,**它包
|
|
| 86 |
|
| 87 |
```python
|
| 88 |
from datasets import load_dataset
|
| 89 |
-
ds = load_dataset('AnchorSR/TrainingData_Stage3', 'small', revision='small-v1.0')
|
| 90 |
```
|
| 91 |
|
| 92 |
实际读取图像/视频,请下载 `small/tools/load_stage3_small.py` 和同目录 `small_training.py`,放在同一目录。依赖:`huggingface_hub pyarrow requests pillow numpy`;视频解码另需 `av` 或你的模型视频处理器。
|
|
@@ -94,7 +94,7 @@ ds = load_dataset('AnchorSR/TrainingData_Stage3', 'small', revision='small-v1.0'
|
|
| 94 |
```python
|
| 95 |
from load_stage3_small import SmallDataset
|
| 96 |
data = SmallDataset('/scratch/e1503372/small_training_cache',
|
| 97 |
-
revision='small-v1.0', max_cache_gib=80)
|
| 98 |
row = next(data.rows('train'))
|
| 99 |
sample = data.sample(row)
|
| 100 |
# sample: question, answer, images (PIL, 源帧顺序), videos (本地文件路径)
|
|
|
|
| 86 |
|
| 87 |
```python
|
| 88 |
from datasets import load_dataset
|
| 89 |
+
ds = load_dataset('AnchorSR/TrainingData_Stage3', 'small', revision='small-v1.0.1')
|
| 90 |
```
|
| 91 |
|
| 92 |
实际读取图像/视频,请下载 `small/tools/load_stage3_small.py` 和同目录 `small_training.py`,放在同一目录。依赖:`huggingface_hub pyarrow requests pillow numpy`;视频解码另需 `av` 或你的模型视频处理器。
|
|
|
|
| 94 |
```python
|
| 95 |
from load_stage3_small import SmallDataset
|
| 96 |
data = SmallDataset('/scratch/e1503372/small_training_cache',
|
| 97 |
+
revision='small-v1.0.1', max_cache_gib=80)
|
| 98 |
row = next(data.rows('train'))
|
| 99 |
sample = data.sample(row)
|
| 100 |
# sample: question, answer, images (PIL, 源帧顺序), videos (本地文件路径)
|
small/code-tests.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"scope": "Stage-3 tests",
|
| 3 |
"exit_code": 0,
|
| 4 |
-
"output": "..................................... [100%]\n37 passed in
|
| 5 |
"stderr": "",
|
| 6 |
"note": "Unrelated ScanNet++ full-repository tests require cv2 and a newer Python; no claim of whole-repository test success."
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"scope": "Stage-3 tests",
|
| 3 |
"exit_code": 0,
|
| 4 |
+
"output": "..................................... [100%]\n37 passed in 3.66s\n",
|
| 5 |
"stderr": "",
|
| 6 |
"note": "Unrelated ScanNet++ full-repository tests require cv2 and a newer Python; no claim of whole-repository test success."
|
| 7 |
}
|
small/tools/build_stage3_small.py
CHANGED
|
@@ -26,6 +26,12 @@ FAMILY_TARGETS = {"object_distance": 510000, "object_dimension": 300000,
|
|
| 26 |
"camera_pose_measurement": 15000, "room_measurement": 5000}
|
| 27 |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
def save(path, obj):
|
| 30 |
path.parent.mkdir(parents=True, exist_ok=True)
|
| 31 |
tmp = path.with_suffix(path.suffix + ".tmp")
|
|
@@ -439,7 +445,7 @@ def index_assets():
|
|
| 439 |
f.rfilename:f.size for f in HfApi().dataset_info(REPO,revision=json.loads((ROOT/'input_manifest.json').read_text())['revision'],files_metadata=True).siblings
|
| 440 |
if f.rfilename.startswith('media/')}
|
| 441 |
conn=db()
|
| 442 |
-
conn.execute(f"CREATE OR REPLACE VIEW small AS SELECT * FROM read_parquet(
|
| 443 |
conn.execute('CREATE OR REPLACE TABLE needed AS SELECT DISTINCT source,unnest(media).path media_path FROM small')
|
| 444 |
conn.execute(f"""COPY (SELECT a.* FROM read_parquet('{ROOT}/all_asset_offsets.parquet') a
|
| 445 |
SEMI JOIN needed USING(source,media_path)
|
|
@@ -463,7 +469,7 @@ def verify():
|
|
| 463 |
import pyarrow.parquet as pq
|
| 464 |
conn=db()
|
| 465 |
output=ROOT/'release'
|
| 466 |
-
conn.execute(f"CREATE OR REPLACE VIEW small AS SELECT * FROM read_parquet(
|
| 467 |
checks={
|
| 468 |
'duplicate_sample_ids':"SELECT count(*)-count(DISTINCT sample_id) FROM small",
|
| 469 |
'group_split_overlap':"SELECT count(*) FROM (SELECT group_id FROM small GROUP BY 1 HAVING count(DISTINCT split)>1)",
|
|
@@ -488,7 +494,7 @@ def verify():
|
|
| 488 |
results['seed']=SEED
|
| 489 |
import math
|
| 490 |
grounding_rows=0
|
| 491 |
-
for path in sorted((output/'small').glob('*
|
| 492 |
for batch in pq.ParquetFile(path).iter_batches(columns=['sample_id','media','spatial_annotations'],batch_size=1000):
|
| 493 |
for row in batch.to_pylist():
|
| 494 |
if not row['spatial_annotations']:continue
|
|
@@ -528,7 +534,7 @@ def smoke():
|
|
| 528 |
from load_stage3_small import SmallDataset
|
| 529 |
conn=db()
|
| 530 |
output=ROOT/'release'
|
| 531 |
-
conn.execute(f"CREATE OR REPLACE VIEW small AS SELECT * FROM read_parquet(
|
| 532 |
# Deterministic coverage of each source, each task, and grounding format.
|
| 533 |
sql="""SELECT * FROM small QUALIFY row_number() OVER (PARTITION BY source,task_type,input_modality ORDER BY selection_hash)=1"""
|
| 534 |
rows=conn.execute(sql).fetch_arrow_table().to_pylist()
|
|
|
|
| 26 |
"camera_pose_measurement": 15000, "room_measurement": 5000}
|
| 27 |
|
| 28 |
|
| 29 |
+
def small_parquets():
|
| 30 |
+
# Do not include manifests/group-splits.parquet when rerunning verification.
|
| 31 |
+
return '['+','.join("'"+str(ROOT/f'release/small/{split}/*.parquet')+"'"
|
| 32 |
+
for split in ('train','validation','test'))+']'
|
| 33 |
+
|
| 34 |
+
|
| 35 |
def save(path, obj):
|
| 36 |
path.parent.mkdir(parents=True, exist_ok=True)
|
| 37 |
tmp = path.with_suffix(path.suffix + ".tmp")
|
|
|
|
| 445 |
f.rfilename:f.size for f in HfApi().dataset_info(REPO,revision=json.loads((ROOT/'input_manifest.json').read_text())['revision'],files_metadata=True).siblings
|
| 446 |
if f.rfilename.startswith('media/')}
|
| 447 |
conn=db()
|
| 448 |
+
conn.execute(f"CREATE OR REPLACE VIEW small AS SELECT * FROM read_parquet({small_parquets()})")
|
| 449 |
conn.execute('CREATE OR REPLACE TABLE needed AS SELECT DISTINCT source,unnest(media).path media_path FROM small')
|
| 450 |
conn.execute(f"""COPY (SELECT a.* FROM read_parquet('{ROOT}/all_asset_offsets.parquet') a
|
| 451 |
SEMI JOIN needed USING(source,media_path)
|
|
|
|
| 469 |
import pyarrow.parquet as pq
|
| 470 |
conn=db()
|
| 471 |
output=ROOT/'release'
|
| 472 |
+
conn.execute(f"CREATE OR REPLACE VIEW small AS SELECT * FROM read_parquet({small_parquets()})")
|
| 473 |
checks={
|
| 474 |
'duplicate_sample_ids':"SELECT count(*)-count(DISTINCT sample_id) FROM small",
|
| 475 |
'group_split_overlap':"SELECT count(*) FROM (SELECT group_id FROM small GROUP BY 1 HAVING count(DISTINCT split)>1)",
|
|
|
|
| 494 |
results['seed']=SEED
|
| 495 |
import math
|
| 496 |
grounding_rows=0
|
| 497 |
+
for path in sorted(p for split in ('train','validation','test') for p in (output/'small'/split).glob('*.parquet')):
|
| 498 |
for batch in pq.ParquetFile(path).iter_batches(columns=['sample_id','media','spatial_annotations'],batch_size=1000):
|
| 499 |
for row in batch.to_pylist():
|
| 500 |
if not row['spatial_annotations']:continue
|
|
|
|
| 534 |
from load_stage3_small import SmallDataset
|
| 535 |
conn=db()
|
| 536 |
output=ROOT/'release'
|
| 537 |
+
conn.execute(f"CREATE OR REPLACE VIEW small AS SELECT * FROM read_parquet({small_parquets()})")
|
| 538 |
# Deterministic coverage of each source, each task, and grounding format.
|
| 539 |
sql="""SELECT * FROM small QUALIFY row_number() OVER (PARTITION BY source,task_type,input_modality ORDER BY selection_hash)=1"""
|
| 540 |
rows=conn.execute(sql).fetch_arrow_table().to_pylist()
|
small/verification.json
CHANGED
|
@@ -8,14 +8,14 @@
|
|
| 8 |
"missing_media": 0,
|
| 9 |
"known_sha_split_overlap": 0,
|
| 10 |
"rows": {
|
|
|
|
| 11 |
"validation": 50000,
|
| 12 |
-
"test": 50000
|
| 13 |
-
"train": 1000000
|
| 14 |
},
|
| 15 |
"groups": {
|
| 16 |
"validation": 20709,
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
},
|
| 20 |
"task_coverage": {
|
| 21 |
"validation": 20,
|
|
|
|
| 8 |
"missing_media": 0,
|
| 9 |
"known_sha_split_overlap": 0,
|
| 10 |
"rows": {
|
| 11 |
+
"train": 1000000,
|
| 12 |
"validation": 50000,
|
| 13 |
+
"test": 50000
|
|
|
|
| 14 |
},
|
| 15 |
"groups": {
|
| 16 |
"validation": 20709,
|
| 17 |
+
"test": 20733,
|
| 18 |
+
"train": 406008
|
| 19 |
},
|
| 20 |
"task_coverage": {
|
| 21 |
"validation": 20,
|