import cv2 import numpy as np from skimage.measure import compare_ssim def ssim(i1, i2): (score, diff) = compare_ssim(i1, i2, full=True,multichannel=True) ret