From 9d8390f9e1cf281590f72f9665febd8b4b07715f Mon Sep 17 00:00:00 2001 From: Xintao Date: Sun, 29 Aug 2021 11:04:40 +0800 Subject: [PATCH] update prepare_example_data --- datasets/README.md | 26 ++++++++++++++++++++++++-- scripts/prepare_example_data.py | 6 +++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/datasets/README.md b/datasets/README.md index 970e15b..dbee0c5 100644 --- a/datasets/README.md +++ b/datasets/README.md @@ -1,3 +1,25 @@ -# Soft link your dataset here +# Datasets -`ln -s xxx ./` +This folder is mainly for storing datasets used for training/validation/testing. + +## Practice + +1. Separate your codes and datasets. So it is better to soft link your dataset (such as DIV2K, FFHQ, *etc*) here. + ```bash + ln -s DATASET_PATH ./ + ``` + +## Example Datasets + +We provide two example datasets for demo. + +1. [BSDS100](https://github.com/xinntao/BasicSR-examples/releases/download/0.0.0/BSDS100.zip) for training +1. [Set5](https://github.com/xinntao/BasicSR-examples/releases/download/0.0.0/Set5.zip) for validation + +You can easily download them by running the following command in the BasicSR-example root path: + +```bash +python scripts/prepare_example_data.py +``` + +The example datasets are now in the `datasets/example` folder. diff --git a/scripts/prepare_example_data.py b/scripts/prepare_example_data.py index 541234d..499d9d8 100644 --- a/scripts/prepare_example_data.py +++ b/scripts/prepare_example_data.py @@ -4,6 +4,7 @@ def main(url, dataset): # download + print(f'Download {url} ...') response = requests.get(url) with open(f'datasets/example/{dataset}.zip', 'wb') as f: f.write(response.content) @@ -21,7 +22,10 @@ def main(url, dataset): """ os.makedirs('datasets/example', exist_ok=True) - urls = ['', ''] + urls = [ + 'https://github.com/xinntao/BasicSR-examples/releases/download/0.0.0/BSDS100.zip', + 'https://github.com/xinntao/BasicSR-examples/releases/download/0.0.0/Set5.zip' + ] datasets = ['BSDS100', 'Set5'] for url, dataset in zip(urls, datasets): main(url, dataset)