Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
oguzakif
/
video-object-remover
like
28
Running
on
T4
App
Files
Files
Community
1
2fbd8d1
video-object-remover
/
FGT_codes
/
FGT
/
metrics
/
psnr.py
oguzakif
init repo
d4b77ac
over 1 year ago
raw
Copy download link
history
blame
Safe
204 Bytes
import
numpy
import
math
def
psnr
(
img1, img2
):
mse = numpy.mean( (img1 - img2) **
2
)
if
mse ==
0
:
return
100
PIXEL_MAX =
255.0
return
20
* math.log10(PIXEL_MAX / math.sqrt(mse))