Skip to content

Commit

Permalink
update prepare_example_data
Browse files Browse the repository at this point in the history
  • Loading branch information
xinntao committed Aug 29, 2021
1 parent b9d69c4 commit 9d8390f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 24 additions & 2 deletions datasets/README.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 5 additions & 1 deletion scripts/prepare_example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit 9d8390f

Please sign in to comment.