直接判断numpy相等:
(np.array(self.cls_1)==df_label.columns[1:]).all()
判断图片相似:
二、
import cv2
import numpy as np
image1 = cv2.imread("1.png")
image2 = cv2.imread("22.png")
difference = cv2.subtract(image1, image2)
result = not np.any(difference) #if difference is all zeros it will return False
if result is True:
print("两张图片一样")
else:
cv2.imwrite("result.jpg", difference)
print ("两张图片不一样")
结果改一下: