Spaces:
Runtime error
Runtime error
Download code/preprocess_dataset.py from promptsai/crowdcontrol: direct link, hf CLI and curl.
- Browser
- Download file 884 Bytes
-
https://huggingface.co/spaces/promptsai/crowdcontrol/resolve/main/code/preprocess_dataset.py
- Command line
-
hf download hf://spaces/promptsai/crowdcontrol/code/preprocess_dataset.py
-
curl -L -o preprocess_dataset.py https://huggingface.co/spaces/promptsai/crowdcontrol/resolve/main/code/preprocess_dataset.py
884 Bytes
| # Preprocess images in QNRF and NWPU dataset. | |
| import argparse | |
| parser = argparse.ArgumentParser(description='Preprocess') | |
| parser.add_argument('--dataset', default='qnrf', | |
| help='dataset name, only support qnrf and nwpu') | |
| parser.add_argument('--input-dataset-path', default='data/QNRF', | |
| help='original data directory') | |
| parser.add_argument('--output-dataset-path', default='data/QNRF-Train-Val-Test', | |
| help='processed data directory') | |
| args = parser.parse_args() | |
| if args.dataset.lower() == 'qnrf': | |
| from preprocess.preprocess_dataset_qnrf import main | |
| main(args.input_dataset_path, args.output_dataset_path, 512, 2048) | |
| elif args.dataset.lower() == 'nwpu': | |
| from preprocess.preprocess_dataset_nwpu import main | |
| main(args.input_dataset_path, args.output_dataset_path, 384, 1920) | |
| else: | |
| raise NotImplementedError | |