Explorar o código

fix det visualize bug when color is defined by user

will-jl944 %!s(int64=4) %!d(string=hai) anos
pai
achega
0f61c6fa1c
Modificáronse 1 ficheiros con 1 adicións e 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)