瀏覽代碼

fix det visualize bug when color is defined by user

will-jl944 4 年之前
父節點
當前提交
0f61c6fa1c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dygraph/paddlex/cv/models/utils/visualize.py

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

@@ -204,7 +204,7 @@ def draw_bbox_mask(image, results, threshold=0.5, color_map=None):
         xmax = xmin + w
         ymax = ymin + h
 
-        color = tuple(color_map[labels.index(cname)])
+        color = tuple(map(int, color_map[labels.index(cname)]))
         # draw bbox
         image = cv2.rectangle(image, (xmin, ymin), (xmax, ymax), color,
                               linewidth)