Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
HAT_pytorch
Commits
d8a2032d
Commit
d8a2032d
authored
Mar 01, 2024
by
Rayyyyy
Browse files
update README and add gen_LRbicx4.py
parent
91d9e772
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
31 deletions
+70
-31
README.md
README.md
+19
-10
datasets/gen_LRbicx4.py
datasets/gen_LRbicx4.py
+30
-0
options/test/HAT_SRx4_ImageNet-pretrain.yml
options/test/HAT_SRx4_ImageNet-pretrain.yml
+21
-21
No files found.
README.md
View file @
d8a2032d
...
...
@@ -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
...
...
@@ -91,13 +99,17 @@ Tips: DF2K: DIV2K 和 Flickr2 数据的整合
│ ├── LRbicx2
│ ├── LRbicx3
│ ├── LRbicx4
│ ├── original
├── Set14
│ ├── GTmod12
│ ├── LRbicx2
│ ├── LRbicx3
│ ├── LRbicx4
│ ├── original
├── BSDS100
│ ├── GTmod4 # 原始图像
│ ├── LRbicx4
├── urban100
│ ├── GTmod4 # 原始图像
│ ├── LRbicx4
```
Tips: 项目提供了tiny_datasets用于快速上手学习, 如果实用tiny_datasets, 需要对下面的代码内的地址进行替换, 当前默认完整数据集的处理地址。
...
...
@@ -156,13 +168,10 @@ bash val.sh
### 精度
未经x2预训练的SRx4上的基准PSNR测试结果, Mulit-Adds针对64x64输入的计算。
| Model | Params(M) | Multi-Adds(G) | Set5 | Set14 | BSD100 | Urban100 | Manga109 |
| :------: | :------: | :------: | :------: |:------: | :------: | :------: |:------:|
| 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 |
| Model | Params(M) | Multi-Adds(G) | Set5 | Set14 | BSD100 | Urban100 |
| :------: | :------: | :------: | :------: |:------: | :------: | :------: |
| 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 |
## 应用场景
### 算法类别
...
...
datasets/gen_LRbicx4.py
0 → 100644
View file @
d8a2032d
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
options/test/HAT_SRx4_ImageNet-pretrain.yml
View file @
d8a2032d
...
...
@@ -13,29 +13,29 @@ datasets:
io_backend
:
type
:
disk
#
test_2: # the 2nd test dataset
#
name: Set14
#
type: PairedImageDataset
#
dataroot_gt: ./datasets/Set14/GTmod12
#
dataroot_lq: ./datasets/Set14/LRbicx4
#
io_backend:
#
type: disk
test_2
:
# the 2nd test dataset
name
:
Set14
type
:
PairedImageDataset
dataroot_gt
:
./datasets/Set14/GTmod12
dataroot_lq
:
./datasets/Set14/LRbicx4
io_backend
:
type
:
disk
#
test_3:
#
name: Urban100
#
type: PairedImageDataset
#
dataroot_gt: ./datasets/urban100/GTmod4
#
dataroot_lq: ./datasets/urban100/LRbicx4
#
io_backend:
#
type: disk
test_3
:
name
:
Urban100
type
:
PairedImageDataset
dataroot_gt
:
./datasets/urban100/GTmod4
dataroot_lq
:
./datasets/urban100/LRbicx4
io_backend
:
type
:
disk
#
test_4:
#
name: BSDS100
#
type: PairedImageDataset
#
dataroot_gt: ./datasets/BSDS100/GTmod4
#
dataroot_lq: ./datasets/BSDS100/LRbicx4
#
io_backend:
#
type: disk
test_4
:
name
:
BSDS100
type
:
PairedImageDataset
dataroot_gt
:
./datasets/BSDS100/GTmod4
dataroot_lq
:
./datasets/BSDS100/LRbicx4
io_backend
:
type
:
disk
# test_5:
# name: Manga109
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment