Download scripts/download_file.py from sunnycloudhust/TrafficVision: direct link, hf CLI and curl.
- Browser
- Download file 646 Bytes
-
https://huggingface.co/datasets/sunnycloudhust/TrafficVision/resolve/main/scripts/download_file.py
- Command line
-
hf download hf://datasets/sunnycloudhust/TrafficVision/scripts/download_file.py
-
curl -L -o download_file.py https://huggingface.co/datasets/sunnycloudhust/TrafficVision/resolve/main/scripts/download_file.py
646 Bytes
| """Download one direct HTTP/cloud object to a verified runtime cache. | |
| Google Drive confirmation/share pages are NOT archive URLs. Use gdown for those, | |
| then pass downloaded images/XML to prepare_ua_detrac.py. | |
| """ | |
| import argparse | |
| from trafficvision.data.cache import cached_file | |
| if __name__ == "__main__": | |
| p = argparse.ArgumentParser(description=__doc__) | |
| p.add_argument("--url", required=True) | |
| p.add_argument("--cache-dir", default="/tmp/trafficvision-downloads") | |
| p.add_argument("--sha256") | |
| p.add_argument("--size", type=int) | |
| args = p.parse_args() | |
| print(cached_file(args.url, args.cache_dir, args.sha256, args.size)) | |