def load_image(self):
'''
????
'''
try:
im_path,_=QFileDialog.getOpenFileName(self,'??????','./','Image Files(*.png *.jpg *.bmp)')
if not os.path.exists(im_path):
return
self.im_path=im_path
self.statu_text.append('???????'+self.im_path)
if not self.swapper:
self.swapper=Coupleswapper([self.im_path])
elif not self.im_path== self.cur_im_path:
self.swapper.load_heads([self.im_path])
self.img_ori=self.swapper.heads[os.path.split(self.im_path)[-1]][0]
cv2.imshow('Origin',self.img_ori)
except (TooManyFaces,NoFace):
self.statu_text.append(traceback.format_exc()+'\n????????????????????????????')
return
评论列表
文章目录