Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
BSH_Project3
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김재형
2021-04-07 14:21:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2db55916da221fc50458e52015411c67556e744e
2db55916
1 parent
a45aedf3
PSNR 계산 코드 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
notebooks/psnr.ipynb
notebooks/psnr.ipynb
0 → 100644
View file @
2db5591
{
"cells"
:
[
{
"cell_type"
:
"code"
,
"execution_count"
:
15
,
"id"
:
"automotive-circus"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"from glob import glob
\n
"
,
"import cv2
\n
"
,
"from tqdm import tqdm
\n
"
,
"
\n
"
,
"gt_list = sorted(glob(
\"
../bbb_sunflower_1080p/*.png
\"
))
\n
"
,
"sr_list = sorted(glob(
\"
./experiment/test/results-Demo/*.png
\"
))"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
16
,
"id"
:
"unique-wichita"
,
"metadata"
:
{},
"outputs"
:
[
{
"name"
:
"stderr"
,
"output_type"
:
"stream"
,
"text"
:
[
"100%|██████████| 1800/1800 [02:55<00:00, 10.24it/s]
\n
"
]
}
],
"source"
:
[
"with open(
\"
result.csv
\"
,
\"
w
\"
) as f:
\n
"
,
" f.write(
\"
idx,psnr
\\
n
\"
);
\n
"
,
" for idx, (gt, sr) in tqdm(enumerate(zip(gt_list, sr_list)), total=len(sr_list)):
\n
"
,
" gt_img = cv2.imread(gt)
\n
"
,
" sr_img = cv2.imread(sr)
\n
"
,
" psnr = cv2.PSNR(gt_img, sr_img)
\n
"
,
" f.write(f
\"
{idx},{psnr}
\\
n
\"
)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
null
,
"id"
:
"raised-projector"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[]
}
],
"metadata"
:
{
"kernelspec"
:
{
"display_name"
:
"Python 3"
,
"language"
:
"python"
,
"name"
:
"python3"
},
"language_info"
:
{
"codemirror_mode"
:
{
"name"
:
"ipython"
,
"version"
:
3
},
"file_extension"
:
".py"
,
"mimetype"
:
"text/x-python"
,
"name"
:
"python"
,
"nbconvert_exporter"
:
"python"
,
"pygments_lexer"
:
"ipython3"
,
"version"
:
"3.7.7"
}
},
"nbformat"
:
4
,
"nbformat_minor"
:
5
}
Please
register
or
login
to post a comment