소스 검색

instance segmentation prediction return decoded masks

will-jl944 4 년 전
부모
커밋
b503e472cb
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      paddlex/cv/models/utils/visualize.py

+ 1 - 2
paddlex/cv/models/utils/visualize.py

@@ -16,7 +16,6 @@ import os
 import cv2
 import numpy as np
 import time
-import pycocotools.mask as mask_util
 import paddlex.utils.logging as logging
 from paddlex.utils import is_pic
 from .det_metrics.coco_utils import loadRes
@@ -215,7 +214,7 @@ def draw_bbox_mask(image, results, threshold=0.5, color_map=None):
             image = image.astype('float32')
             alpha = .7
             w_ratio = .4
-            color_mask = np.asarray(color, dtype=np.int)
+            color_mask = np.asarray(color, dtype=int)
             for c in range(3):
                 color_mask[c] = color_mask[c] * (1 - w_ratio) + w_ratio * 255
             idx = np.nonzero(mask)