mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 13:02:15 -07:00
XSegEditor: fix
This commit is contained in:
parent
6f25ebbc9e
commit
e77865ce18
1 changed files with 13 additions and 18 deletions
|
@ -342,6 +342,7 @@ class QCanvasOperator(QWidget):
|
||||||
self.img_pixmap = QPixmap.fromImage(q_img)
|
self.img_pixmap = QPixmap.fromImage(q_img)
|
||||||
|
|
||||||
self.xseg_mask_pixmap = None
|
self.xseg_mask_pixmap = None
|
||||||
|
self.xseg_overlay_mask_pixmap = None
|
||||||
if xseg_mask is not None:
|
if xseg_mask is not None:
|
||||||
h,w,c = img.shape
|
h,w,c = img.shape
|
||||||
xseg_mask = cv2.resize(xseg_mask, (w,h), cv2.INTER_CUBIC)
|
xseg_mask = cv2.resize(xseg_mask, (w,h), cv2.INTER_CUBIC)
|
||||||
|
@ -952,25 +953,19 @@ class QCanvasOperator(QWidget):
|
||||||
qp.setRenderHint(QPainter.HighQualityAntialiasing)
|
qp.setRenderHint(QPainter.HighQualityAntialiasing)
|
||||||
qp.setRenderHint(QPainter.SmoothPixmapTransform)
|
qp.setRenderHint(QPainter.SmoothPixmapTransform)
|
||||||
|
|
||||||
if self.op_mode == OpMode.VIEW_BAKED:
|
|
||||||
|
|
||||||
src_rect = QRect(0, 0, *self.img_size)
|
src_rect = QRect(0, 0, *self.img_size)
|
||||||
dst_rect = self.img_to_cli_rect( src_rect )
|
dst_rect = self.img_to_cli_rect( src_rect )
|
||||||
|
|
||||||
|
if self.op_mode == OpMode.VIEW_BAKED:
|
||||||
qp.drawPixmap(dst_rect, self.img_baked_pixmap, src_rect)
|
qp.drawPixmap(dst_rect, self.img_baked_pixmap, src_rect)
|
||||||
elif self.op_mode == OpMode.VIEW_XSEG_MASK:
|
elif self.op_mode == OpMode.VIEW_XSEG_MASK:
|
||||||
if self.xseg_mask_pixmap is not None:
|
if self.xseg_mask_pixmap is not None:
|
||||||
src_rect = QRect(0, 0, *self.img_size)
|
|
||||||
dst_rect = self.img_to_cli_rect( src_rect )
|
|
||||||
qp.drawPixmap(dst_rect, self.xseg_mask_pixmap, src_rect)
|
qp.drawPixmap(dst_rect, self.xseg_mask_pixmap, src_rect)
|
||||||
elif self.op_mode == OpMode.VIEW_XSEG_OVERLAY_MASK:
|
elif self.op_mode == OpMode.VIEW_XSEG_OVERLAY_MASK:
|
||||||
if self.xseg_overlay_mask_pixmap is not None:
|
if self.xseg_overlay_mask_pixmap is not None:
|
||||||
src_rect = QRect(0, 0, *self.img_size)
|
|
||||||
dst_rect = self.img_to_cli_rect( src_rect )
|
|
||||||
qp.drawPixmap(dst_rect, self.xseg_overlay_mask_pixmap, src_rect)
|
qp.drawPixmap(dst_rect, self.xseg_overlay_mask_pixmap, src_rect)
|
||||||
else:
|
else:
|
||||||
if self.img_pixmap is not None:
|
if self.img_pixmap is not None:
|
||||||
src_rect = QRect(0, 0, *self.img_size)
|
|
||||||
dst_rect = self.img_to_cli_rect( src_rect )
|
|
||||||
qp.drawPixmap(dst_rect, self.img_pixmap, src_rect)
|
qp.drawPixmap(dst_rect, self.img_pixmap, src_rect)
|
||||||
|
|
||||||
polys = self.ie_polys.get_polys()
|
polys = self.ie_polys.get_polys()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue