Commit d8a2032d authored by Rayyyyy's avatar Rayyyyy
Browse files

update README and add gen_LRbicx4.py

parent 91d9e772
...@@ -78,7 +78,15 @@ Tips: DF2K: DIV2K 和 Flickr2 数据的整合 ...@@ -78,7 +78,15 @@ Tips: DF2K: DIV2K 和 Flickr2 数据的整合
数据准备具体步骤如下: 数据准备具体步骤如下:
1. 将数据存放在datasets目录下, 数据集的目录结构如下: 1. 将数据存放在datasets目录下;
2. BSD100和urban100需要再各自目录下新GTmod4、LRbicx4两个新目录,并把原始图片存放进GTmod4目录下,然后再datasets目录下分别执行下面两条命令:
```bash
python gen_LRbicx4.py --file_name ./BSD100
python gen_LRbicx4.py --file_name ./urban100
```
3. 建数据集的目录结构如下:
``` ```
├── DF2K ├── DF2K
...@@ -91,13 +99,17 @@ Tips: DF2K: DIV2K 和 Flickr2 数据的整合 ...@@ -91,13 +99,17 @@ Tips: DF2K: DIV2K 和 Flickr2 数据的整合
│ ├── LRbicx2 │ ├── LRbicx2
│ ├── LRbicx3 │ ├── LRbicx3
│ ├── LRbicx4 │ ├── LRbicx4
│ ├── original
├── Set14 ├── Set14
│ ├── GTmod12 │ ├── GTmod12
│ ├── LRbicx2 │ ├── LRbicx2
│ ├── LRbicx3 │ ├── LRbicx3
│ ├── LRbicx4 │ ├── LRbicx4
│ ├── original ├── BSDS100
│ ├── GTmod4 # 原始图像
│ ├── LRbicx4
├── urban100
│ ├── GTmod4 # 原始图像
│ ├── LRbicx4
``` ```
Tips: 项目提供了tiny_datasets用于快速上手学习, 如果实用tiny_datasets, 需要对下面的代码内的地址进行替换, 当前默认完整数据集的处理地址。 Tips: 项目提供了tiny_datasets用于快速上手学习, 如果实用tiny_datasets, 需要对下面的代码内的地址进行替换, 当前默认完整数据集的处理地址。
...@@ -156,13 +168,10 @@ bash val.sh ...@@ -156,13 +168,10 @@ bash val.sh
### 精度 ### 精度
未经x2预训练的SRx4上的基准PSNR测试结果, Mulit-Adds针对64x64输入的计算。 | Model | Params(M) | Multi-Adds(G) | Set5 | Set14 | BSD100 | Urban100 |
| :------: | :------: | :------: | :------: |:------: | :------: | :------: |
| Model | Params(M) | Multi-Adds(G) | Set5 | Set14 | BSD100 | Urban100 | Manga109 | | HAT | 20.8 | 102.4 | 33.1486 | 29.3587 | 25.4074 | 21.2687 |
| :------: | :------: | :------: | :------: |:------: | :------: | :------: |:------:| | HAT(our) | 20.8 | 102.4 | 33.1486 | 29.3587 | 25.4074 | 21.2687 |
| HAT-S | 9.6 | 54.9 | 32.92 | 29.15 | 27.97 | 27.87 | 32.35 |
| HAT | 20.8 | 102.4 | 33.04 | 29.23 | 28.00 | 27.97 | 32.48 |
| HAT(our) | 20.8 | 102.4 | 33.1486 | xxx | xxx | xxx | xxx |
## 应用场景 ## 应用场景
### 算法类别 ### 算法类别
......
import os
import cv2
import argparse
parser = argparse.ArgumentParser('gen BSD/urban100 LRbicx4', add_help=False)
parser.add_argument('--file_name', default='', type=str, help='Name of image file')
args = parser.parse_args()
if __name__ == "__main__":
root_path = './{}'.format(args.file_name)
GT_images_path = os.path.join(root_path, 'GTmod4')
LR_images_path = os.path.join(root_path, 'LRbicx4')
for img_name in os.listdir(GT_images_path):
img_path = os.path.join(GT_images_path, img_name)
print("img_path", img_path)
save_path = os.path.join(LR_images_path, img_name)
img = cv2.imread(img_path)
if img is None:
print("empty!!!!!", img_path)
continue
resize_width = int(img.shape[1]/4)
resize_height = int(img.shape[0]/4)
print("original size {} resize size {}".format(img.shape, (resize_width, resize_height)))
img_resize = cv2.resize(img, (resize_width, resize_height), interpolation = cv2.INTER_AREA)
cv2.imwrite(save_path, img_resize)
print("processing end.")
\ No newline at end of file
...@@ -13,29 +13,29 @@ datasets: ...@@ -13,29 +13,29 @@ datasets:
io_backend: io_backend:
type: disk type: disk
# test_2: # the 2nd test dataset test_2: # the 2nd test dataset
# name: Set14 name: Set14
# type: PairedImageDataset type: PairedImageDataset
# dataroot_gt: ./datasets/Set14/GTmod12 dataroot_gt: ./datasets/Set14/GTmod12
# dataroot_lq: ./datasets/Set14/LRbicx4 dataroot_lq: ./datasets/Set14/LRbicx4
# io_backend: io_backend:
# type: disk type: disk
# test_3: test_3:
# name: Urban100 name: Urban100
# type: PairedImageDataset type: PairedImageDataset
# dataroot_gt: ./datasets/urban100/GTmod4 dataroot_gt: ./datasets/urban100/GTmod4
# dataroot_lq: ./datasets/urban100/LRbicx4 dataroot_lq: ./datasets/urban100/LRbicx4
# io_backend: io_backend:
# type: disk type: disk
# test_4: test_4:
# name: BSDS100 name: BSDS100
# type: PairedImageDataset type: PairedImageDataset
# dataroot_gt: ./datasets/BSDS100/GTmod4 dataroot_gt: ./datasets/BSDS100/GTmod4
# dataroot_lq: ./datasets/BSDS100/LRbicx4 dataroot_lq: ./datasets/BSDS100/LRbicx4
# io_backend: io_backend:
# type: disk type: disk
# test_5: # test_5:
# name: Manga109 # name: Manga109
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment