def showImg(self,label,img):
if len(img.shape) == 2:
img = cv2.applyColorMap(img, cv2.COLORMAP_JET)
img = cv2.resize(img, (512, 512),cv2.INTER_AREA)
height, width, byteValue = img.shape
byteValue = byteValue * width
timg = img.copy()
image = QtGui.QImage(timg.data, width, height,byteValue, QtGui.QImage.Format_RGB888)
label.setPixmap(QtGui.QPixmap(image).scaled(label.size(),aspectMode=QtCore.Qt.KeepAspectRatio))
""" visualize function from
https://github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb
"""
评论列表
文章目录