XSegEditor: fix
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user