当前位置:网站首页>Measurement index SSMI
Measurement index SSMI
2022-06-25 20:05:00 【Orange cedar】
# Test forecast and truth folder PSNR and SSIM
# Be careful : You need two folders in the same order
import cv2
import glob
import os
from util.metrics import PSNR
from util.metrics import SSIM
psnr_total = 0
ssim_total = 0
# predlist=glob.glob(os.path.join('../Datasets/GoPro/test/results/GoPro', "*"))# Predicted folder path
# gtlist=glob.glob(os.path.join('../Datasets/GoPro/test/target', "*"))# Truth folder path
predlist=glob.glob(os.path.join('../Datasets/CHAOS/test/results/CHAOS', "*"))# Predicted folder path
gtlist=glob.glob(os.path.join('../Datasets/CHAOS/test/target', "*"))# Truth folder path
for i in range(len(predlist)):
print(i,os.path.basename(predlist[i]))
pred_img = cv2.imread(predlist[i])
pred_img = cv2.cvtColor(pred_img, cv2.COLOR_BGR2RGB)
gt_img = cv2.imread(gtlist[i])
gt_img = cv2.cvtColor(gt_img, cv2.COLOR_BGR2RGB)
psnr = PSNR(pred_img, gt_img)
ssim = SSIM(pred_img, gt_img)
psnr_total+=psnr
ssim_total+=ssim
psnr_average=psnr_total/len(predlist)
ssim_average=ssim_total/len(predlist)
print("PSNR = {:.2f}".format(psnr_total / len(predlist)))
print("SSIM = {:.4f}".format(ssim_total / len(predlist)))
# img=cv2.imread('E:\\others\\1.jpg')
# m,n,c=img.shape
# print(m,n,c)
# img = cv2.resize(img, (m, n), interpolation=cv2.INTER_CUBIC)
# m,n,c=img.shape
# print(m,n,c)
边栏推荐
- Profile path and name
- <C>. Figure guessing game
- PHP FPM, workman, spoole, golang simple performance test
- 6. exception handling
- PAT B1091
- String since I can perform performance tuning, I can call an expert directly
- Huawei in application review test requirements
- Web components - Basics
- Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
- 5、 Initialization analysis II of hikaricp source code analysis
猜你喜欢

Clickhouse disables automatic clearing of tables / columns, that is, disables TTL

Panda weekly -2022/02/18

New features of php7

2.14(Knight Moves)

200 OK (from memory cache) and 200 OK (from disk cache)

Vulnhub range - correlation:2

Applet password input box

Now meditation: crash service and performance service help improve application quality

2020-12-09 laravel . Env file loading mechanism process

wooyun-2014-065513
随机推荐
ActiveMQ--CVE-2016-3088
PAT B1056
3、 Hikaricp source code analysis of connection acquisition process III
PAT B1063
Avoid material "minefields"! Play super high conversion rate
二、HikariCP獲取連接流程源碼分析二
通过启牛学堂开的股票账户可以用吗?资金安全吗?
Redis is a loser. If you don't understand the usage specification, you will spoil it
C language PTA -- continuity factor
2.1 write a program to calculate the sum and average of four integers.
PAT B1053
1、 Hikaricp source code analysis of connection acquisition process I
Jsonp processing non homologous
<C>. Calculation date to day conversion
PAT B1091
Uniapp waterfall flow, applet waterfall flow, very simple, suitable for the whole platform
200 OK (from memory cache) and 200 OK (from disk cache)
Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
wooyun-2014-065513
Yaml configuration