Skip to content

Commit

Permalink
[Fix] fix some dataset converters typos (#1910)
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-Fran authored Jun 21, 2023
1 parent 05ed042 commit 442fa76
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 44 deletions.
4 changes: 2 additions & 2 deletions configs/_base_/datasets/deblurring-motion_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
dict(type='PackInputs')
]

gopro_data_root = 'data/GoPro'
gopro_data_root = 'data/gopro/test'
gopro_dataloader = dict(
num_workers=4,
persistent_workers=False,
Expand All @@ -24,7 +24,7 @@
type='BasicImageDataset',
metainfo=dict(dataset_type='GoPro', task_name='deblurring'),
data_root=gopro_data_root,
data_prefix=dict(img='input', gt='target'),
data_prefix=dict(img='blur', gt='sharp'),
pipeline=test_pipeline))
gopro_evaluator = [
dict(type='PSNR', prefix='GoPro'),
Expand Down
5 changes: 3 additions & 2 deletions configs/_base_/datasets/denoising-real_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
dict(type='PackInputs')
]

sidd_data_root = 'data/SIDD'
sidd_data_root = 'data/SIDD/val/'
sidd_dataloader = dict(
num_workers=4,
persistent_workers=False,
Expand All @@ -24,7 +24,8 @@
type='BasicImageDataset',
metainfo=dict(dataset_type='SIDD', task_name='denoising'),
data_root=sidd_data_root,
data_prefix=dict(img='input', gt='groundtruth'),
data_prefix=dict(img='noisy', gt='gt'),
filename_tmpl=dict(gt='{}_GT', img='{}_NOISY'),
pipeline=test_pipeline))
sidd_evaluator = [
dict(type='PSNR', prefix='SIDD'),
Expand Down
12 changes: 6 additions & 6 deletions configs/restormer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Evaluated on Y channels. The metrics are `PSNR` / `SSIM` .

Evaluated on RGB channels for GoPro and HIDE, and Y channel for ReakBlur-J and ReakBlur-R. The metrics are `PSNR` / `SSIM` .

| Model | Dataset | PSNR/SSIM (RGB) | <br>PSNR/SSIM (Y) | Training Resources | Download |
| :-------------------------------------------------------: | :----------: | :-------------: | :---------------: | :----------------: | :-------------------------------------------------------------------------------: |
| [restormer_official_gopro](./restormer_official_gopro.py) | DatasetGoPro | 32.9295/0.9496 | - | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| [restormer_official_gopro](./restormer_official_gopro.py) | HIDE | 31.2289/0.9345 | - | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| [restormer_official_gopro](./restormer_official_gopro.py) | RealBlur-J | - | 28.4356/0.8681 | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| [restormer_official_gopro](./restormer_official_gopro.py) | RealBlur-R | - | 35.9141/0.9707 | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| Model | Dataset | PSNR/SSIM (RGB) | <br>PSNR/SSIM (Y) | Training Resources | Download |
| :-------------------------------------------------------: | :--------: | :-------------: | :---------------: | :----------------: | :---------------------------------------------------------------------------------: |
| [restormer_official_gopro](./restormer_official_gopro.py) | GoPro | 32.9295/0.9496 | - | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| [restormer_official_gopro](./restormer_official_gopro.py) | HIDE | 31.2289/0.9345 | - | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| [restormer_official_gopro](./restormer_official_gopro.py) | RealBlur-J | - | 28.4356/0.8681 | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |
| [restormer_official_gopro](./restormer_official_gopro.py) | RealBlur-R | - | 35.9141/0.9707 | 1 | [model](https://download.openmmlab.com/mmediting/restormer/restormer_official_gopro-db7363a0.pth) \| log |

### **Defocus Deblurring**

Expand Down
2 changes: 1 addition & 1 deletion configs/restormer/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Models:
In Collection: Restormer
Name: restormer_official_gopro
Results:
- Dataset: DatasetGoPro
- Dataset: GoPro
Metrics:
PSNR/SSIM (RGB):
PSNR: 32.9295
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
dataset=dict(
type=dataset_type,
metainfo=dict(dataset_type='classic5', task_name='CAR'),
data_root=data_root + '/classic5',
data_root=data_root + '/Classic5',
data_prefix=dict(img='', gt=''),
pipeline=val_pipeline))

val_evaluator = [
dict(type='PSNR', prefix='classic5'),
dict(type='SSIM', prefix='classic5'),
dict(type='PSNR', prefix='Classic5'),
dict(type='SSIM', prefix='Classic5'),
]

train_cfg = dict(
Expand Down
2 changes: 0 additions & 2 deletions tools/dataset_converters/classic5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ mmagic
├── configs
├── data
|   ├── Classic5
|   |   ├── input
|   |   ├── target
```
3 changes: 0 additions & 3 deletions tools/dataset_converters/deraining/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,4 @@ mmagic
|   ├── Test2800
|   |   ├── input
|   |   ├── target
|   ├── Test100
|   |   ├── input
|   |   ├── target
```
3 changes: 0 additions & 3 deletions tools/dataset_converters/deraining/README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,4 @@ mmagic
|   ├── Test2800
|   |   ├── input
|   |   ├── target
|   ├── Test100
|   |   ├── input
|   |   ├── target
```
4 changes: 4 additions & 0 deletions tools/dataset_converters/dpdd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ mmagic
|   |   ├── inputR
|   |   ├── inputC
|   |   ├── target
|   |   ├── indoor_labels.npy
|   |   ├── indoor_labels.txt
|   |   ├── outdoor_labels.npy
|   |   ├── outdoor_labels.txt
```
4 changes: 4 additions & 0 deletions tools/dataset_converters/dpdd/README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ mmagic
|   |   ├── inputR
|   |   ├── inputC
|   |   ├── target
|   |   ├── indoor_labels.npy
|   |   ├── indoor_labels.txt
|   |   ├── outdoor_labels.npy
|   |   ├── outdoor_labels.txt
```
8 changes: 4 additions & 4 deletions tools/dataset_converters/gopro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ mmagic
├── data
|   ├── GoPro
|   |   ├── train
|   |   | ├── input
|   |   | ├── target
|   |   | ├── blur
|   |   | ├── sharp
|   |   ├── test
|   |   | ├── input
|   |   | ├── target
|   |   | ├── blur
|   |   | ├── sharp
```
8 changes: 4 additions & 4 deletions tools/dataset_converters/gopro/README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ mmagic
├── data
|   ├── GoPro
|   |   ├── train
|   |   | ├── input
|   |   | ├── target
|   |   | ├── blur
|   |   | ├── sharp
|   |   ├── test
|   |   | ├── input
|   |   | ├── target
|   |   | ├── blur
|   |   | ├── sharp
```
11 changes: 5 additions & 6 deletions tools/dataset_converters/sidd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
}
```

The train datasets can be download from [here](https://drive.google.com/file/d/1UHjWZzLPGweA9ZczmV8lFSRcIxqiOVJw/). The validation datasets can be download from [here](https://drive.google.com/file/d/1Fw6Ey1R-nCHN9WEpxv0MnMqxij-ECQYJ/). The test datasets can be download from [here](https://drive.google.com/file/d/11vfqV-lqousZTuAit1Qkqghiv_taY0KZ/).
The train datasets can be download from [here](https://drive.google.com/file/d/1UHjWZzLPGweA9ZczmV8lFSRcIxqiOVJw/). The validation datasets can be download from [here](https://drive.google.com/file/d/11vfqV-lqousZTuAit1Qkqghiv_taY0KZ/).

For test datasets, we need to export images from mat file. We provide such a script:
For validation datasets, we need to export images from mat file. We provide such a script:

```shell
python tools/dataset_converters/sidd/preprocess_sidd_test_dataset.py --data-root ./data/SIDD/test --out-dir ./data/SIDD/test
python tools/dataset_converters/sidd/preprocess_sidd_test_dataset.py --data-root ./data/SIDD/val --out-dir ./data/SIDD/val
```

The folder structure should look like:
Expand All @@ -32,9 +32,8 @@ mmagic
|   |   | ├── gt
|   |   | ├── noisy
|   |   ├── val
|   |   | ├── input_crops
|   |   | ├── target_crops
|   |   ├── test
|   |   | ├── gt
|   |   | ├── noisy
|   |   | ├── ValidationNoisyBlocksSrgb.mat
|   |   | ├── ValidationGtBlocksSrgb.mat
```
11 changes: 5 additions & 6 deletions tools/dataset_converters/sidd/README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
}
```

训练数据集可以从 [此处](https://drive.google.com/file/d/1UHjWZzLPGweA9ZczmV8lFSRcIxqiOVJw/) 下载。验证数据集可以从 [此处](https://drive.google.com/file/d/1Fw6Ey1R-nCHN9WEpxv0MnMqxij-ECQYJ/) 下载。测试数据集可以从 [此处](https://drive.google.com/file/d/11vfqV-lqousZTuAit1Qkqghiv_taY0KZ/) 下载。
训练数据集可以从 [此处](https://drive.google.com/file/d/1UHjWZzLPGweA9ZczmV8lFSRcIxqiOVJw/) 下载。验证数据集可以从 [此处](https://drive.google.com/file/d/11vfqV-lqousZTuAit1Qkqghiv_taY0KZ/) 下载。

测试数据集需要从 mat 文件中导出,为此,我们提供了一个脚本:
验证数据集需要从 mat 文件中导出,为此,我们提供了一个脚本:

```shell
python tools/dataset_converters/sidd/preprocess_sidd_test_dataset.py --data-root ./data/SIDD/test --out-dir ./data/SIDD/test
python tools/dataset_converters/sidd/preprocess_sidd_test_dataset.py --data-root ./data/SIDD/val --out-dir ./data/SIDD/val
```

文件目录结构应如下所示:
Expand All @@ -32,9 +32,8 @@ mmagic
|   |   | ├── gt
|   |   | ├── noisy
|   |   ├── val
|   |   | ├── input_crops
|   |   | ├── target_crops
|   |   ├── test
|   |   | ├── gt
|   |   | ├── noisy
|   |   | ├── ValidationNoisyBlocksSrgb.mat
|   |   | ├── ValidationGtBlocksSrgb.mat
```
4 changes: 2 additions & 2 deletions tools/dataset_converters/sidd/preprocess_sidd_test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def export_images(args):
noisy_patch = torch.clamp(noisy_patch, 0,
1).detach().permute(0, 2, 3,
1).squeeze(0)
save_path = osp.join(noisy_dir, '%04d_%02d.png' % (i + 1, k + 1))
save_path = osp.join(noisy_dir, f'val_{str(i*32+k)}_NOISY.png')
cv2.imwrite(
save_path,
cv2.cvtColor(img_as_ubyte(noisy_patch), cv2.COLOR_RGB2BGR))
Expand All @@ -52,7 +52,7 @@ def export_images(args):
gt_images[i, k, :, :, :]).unsqueeze(0).permute(0, 3, 1, 2)
gt_patch = torch.clamp(gt_patch, 0,
1).detach().permute(0, 2, 3, 1).squeeze(0)
save_path = osp.join(gt_dir, '%04d_%02d.png' % (i + 1, k + 1))
save_path = osp.join(gt_dir, f'val_{str(i*32+k)}_GT.png')
cv2.imwrite(
save_path,
cv2.cvtColor(img_as_ubyte(gt_patch), cv2.COLOR_RGB2BGR))
Expand Down

0 comments on commit 442fa76

Please sign in to comment.