当前位置:网站首页>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)
边栏推荐
- Clickhouse disables automatic clearing of tables / columns, that is, disables TTL
- <C>. String comparison
- Bindgetuserinfo will not pop up
- Force wechat page font size to be 100%
- 200 OK (from memory cache) and 200 OK (from disk cache)
- Install spoole
- 2.5 find the sum of the first n terms of the square root sequence
- Redis high availability: do you call this the principle of master-slave architecture data synchronization?
- Pat b1054 average (20 points)
- LNMP compilation and installation
猜你喜欢

Applet wx Request encapsulation

Huawei fast application access advertising service development guide

String since I can perform performance tuning, I can call an expert directly
![[harmonyos] [arkui] how can Hongmeng ETS call pa](/img/19/9d2c68be48417e0aaa0d27068a67ce.jpg)
[harmonyos] [arkui] how can Hongmeng ETS call pa

mysql load data infile

Vulnhub range the planes: mercury

Short video is just the time. How can you quickly build your video creation ability in your app?

H5 application conversion fast application

Redis core article: the secret that can only be broken quickly

Pcl+vs2019 configuration and some source code test cases and demos
随机推荐
PHP FPM, workman, spoole, golang simple performance test
Uni app through uni Navigateto failed to pass parameter (pass object)
打新债证券开户安全吗
Processing method for uniapp or applet onload not receiving parameters
6. exception handling
Single chip microcomputer line selection method to store impression (address range) method + Example
JQ implements tab switching
Est - il sûr d'ouvrir un compte avec de nouvelles dettes? Une faible Commission est - elle crédible?
PostgreSQL division considerations
Pcl+vs2019 configuration and some source code test cases and demos
2.6 finding the sum of the first n terms of factorial sequence
Panda weekly -2022/02/18
Bloom filter
Profile path and name
5、 Initialization analysis II of hikaricp source code analysis
C language PTA -- continuity factor
<C>. tic-tac-toe
Applet Click to return to the top 2 methods
Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
Vulnhub range - the planes:venus