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
Real-ESRGAN_pytorch
Commits
09cac702
Commit
09cac702
authored
Mar 06, 2024
by
Rayyyyy
Browse files
add niqe calcu and update readme info
parent
b0878a53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
README.md
README.md
+4
-4
evalution.py
evalution.py
+7
-4
No files found.
README.md
View file @
09cac702
...
@@ -316,7 +316,7 @@ Model: RealESRGAN_x4plus
...
@@ -316,7 +316,7 @@ Model: RealESRGAN_x4plus
</div>
</div>
### 精度
### 精度
本项目基于ADE20K公开数据集的val数据进行
定性
效果验证,
首先
需要对ADE20K val数据进行
处
理,得到
处
理后的结果
图像
(默认在results下).
本项目基于ADE20K公开数据集的val数据进行效果验证,需
先
要对ADE20K val数据进行
推
理,得到
推
理后的结果(默认在results下).
```
bash
```
bash
# 执行推理
# 执行推理
...
@@ -324,10 +324,10 @@ python inference_realesrgan.py --model_path weights/RealESRGAN_x4plus.pth -n Rea
...
@@ -324,10 +324,10 @@ python inference_realesrgan.py --model_path weights/RealESRGAN_x4plus.pth -n Rea
python evalution.py
--root_path
results
python evalution.py
--root_path
results
```
```
| NIQE | ADE20K
val
|
| NIQE | ADE20K |
| :------: | :------: |
| :------: | :------: |
| V100S | |
| V100S |
4.0358
|
| Z100L |
3.7886
|
| Z100L |
4.0314
|
## 应用场景
## 应用场景
### 算法类别
### 算法类别
...
...
evalution.py
View file @
09cac702
...
@@ -10,14 +10,17 @@ parser.add_argument('--root_path', type=str, default='results')
...
@@ -10,14 +10,17 @@ parser.add_argument('--root_path', type=str, default='results')
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
def
main
():
def
main
():
for
imgname
in
os
.
listdir
(
args
.
root_path
):
res
=
[]
for
idx
,
imgname
in
enumerate
(
os
.
listdir
(
args
.
root_path
)):
img_path
=
os
.
path
.
join
(
args
.
root_path
,
imgname
)
img_path
=
os
.
path
.
join
(
args
.
root_path
,
imgname
)
# img_path = 'tests/data/baboon.png'
img
=
cv2
.
imread
(
img_path
)
img
=
cv2
.
imread
(
img_path
)
with
warnings
.
catch_warnings
():
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
'ignore'
,
category
=
RuntimeWarning
)
warnings
.
simplefilter
(
'ignore'
,
category
=
RuntimeWarning
)
niqe_result
=
calculate_niqe
(
img
,
0
,
input_order
=
'HWC'
,
convert_to
=
'y'
)
niqe_result
=
calculate_niqe
(
img
,
0
,
input_order
=
'HWC'
,
convert_to
=
'y'
)
print
(
niqe_result
)
res
.
append
(
niqe_result
)
print
(
'{} img: {} niqe: {}'
.
format
(
idx
,
img_path
,
niqe_result
))
avg
=
float
(
sum
(
res
)
/
len
(
res
))
print
(
'avg niqe'
,
avg
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
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