Download scripts/load_example.py from evanbuzzZ/RememBench: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/evanbuzzZ/RememBench/resolve/main/scripts/load_example.py
- Command line
-
hf download hf://datasets/evanbuzzZ/RememBench/scripts/load_example.py
-
curl -L -o load_example.py https://huggingface.co/datasets/evanbuzzZ/RememBench/resolve/main/scripts/load_example.py
1.07 kB
| #!/usr/bin/env python3 | |
| """Inspect a sample from a downloaded copy of RememBench.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import numpy as np | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument('--root', type=Path, default=Path(__file__).resolve().parents[1]) | |
| ap.add_argument('--subset', choices=['t2v', 'i2v'], default='t2v') | |
| ap.add_argument('--index', type=int, default=0) | |
| args = ap.parse_args() | |
| rows = [json.loads(line) for line in (args.root / 'data' / args.subset / 'test.jsonl').read_text().splitlines()] | |
| row = rows[args.index] | |
| print(json.dumps(row, indent=2)) | |
| print('Exact integer seed:', int(row['seed'])) | |
| if args.subset == 'i2v': | |
| with np.load(args.root / row['trajectory_path'], allow_pickle=False) as trajectory: | |
| print('Camera-to-world poses:', trajectory['poses'].shape) | |
| print('Intrinsics [fx, fy, cx, cy]:', trajectory['intrinsics'][0]) | |
| print('Conditioning image prepared:', (args.root / row['image_path']).is_file()) | |
| if __name__ == '__main__': | |
| main() | |