Explorar el Código

fix det visualize bug when color is defined by user

will-jl944 hace 4 años
padre
commit
0f61c6fa1c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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)