Download OakInk-v2/shared-v1.1/script/validate_oakink.py from ParityLab/Hand-Datasets-Raw: direct link, hf CLI and curl.
- Browser
- Download file 749 Bytes
-
https://huggingface.co/datasets/ParityLab/Hand-Datasets-Raw/resolve/main/OakInk-v2/shared-v1.1/script/validate_oakink.py
- Command line
-
hf download hf://datasets/ParityLab/Hand-Datasets-Raw/OakInk-v2/shared-v1.1/script/validate_oakink.py
-
curl -L -o validate_oakink.py https://huggingface.co/datasets/ParityLab/Hand-Datasets-Raw/resolve/main/OakInk-v2/shared-v1.1/script/validate_oakink.py
749 Bytes
| #!/usr/bin/env python3 | |
| """Validate a v1.1 OakInk view. Missing media/assets are errors by default.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import torch | |
| from oakink_bundle import audit_view | |
| def main(): | |
| p=argparse.ArgumentParser(description=__doc__);p.add_argument('view',type=Path) | |
| p.add_argument('--schema',type=Path,default=Path(__file__).resolve().parents[1]/'doc/schema.json') | |
| p.add_argument('--source',type=Path) | |
| p.add_argument('--numerical-only',action='store_true',help='allow deferred media, not release approval') | |
| a=p.parse_args();torch.set_num_threads(1) | |
| print(json.dumps(audit_view(a.view,json.loads(a.schema.read_text()),a.source,not a.numerical_only),indent=2)) | |
| if __name__=='__main__':main() | |