File size: 706 Bytes
cd365c4
 
 
 
 
 
 
 
 
 
 
 
8a34aee
cd365c4
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
"""Load a local configuration; print one record's media references."""
import argparse
from pathlib import Path
from datasets import load_dataset

ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument("--config", default="all")
args = ap.parse_args()
root = Path(__file__).resolve().parents[1]
data = load_dataset(str(root), args.config, split="test")
row = data[0]
print(f"Loaded {len(data):,} records")
if "video_sources" in row:
    for video in row["video_sources"]:
        print(video["url_kind"], video["url"])
    for image in row["images"]:
        print(root / image)
else:
    print(root / row["video"])
    if row["image"]:
        print(root / row["image"])