MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / showImage

Function showImage

pix2pix/mainWindows.py:61–76  ·  view source on GitHub ↗

:param root: 主窗口 :return:

(frame)

Source from the content-addressed store, hash-verified

59 return [canvas0,canvas1,canvas2]
60
61def showImage(frame):
62 """
63 :param root: 主窗口
64 :return:
65 """
66 # 摄像头翻转
67 # frame=cv2.flip(frame,1)
68 image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
69 image = image.astype(np.uint8)
70 PILimage = Image.fromarray(image)
71 PILimage = PILimage.resize((img_width, img_height), Image.ANTIALIAS)
72 try:
73 tkImage = ImageTk.PhotoImage(image=PILimage)
74 except:
75 return 0
76 return tkImage
77
78
79#这里需要将tkImage设置为全局变量,不然显示不图片

Callers 3

set_BackGroundFunction · 0.70
selectFilenameFunction · 0.70
loadModelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected