Improved hubconf.py CI tests (#2251)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-02-19 12:35:38 -08:00
1 parent 9d87307784
commit db28ce61ac
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -254,7 +254,7 @@ class Detections:
n = (pred[:, -1] == c).sum() # detections per class
str += f"{n} {self.names[int(c)]}{'s' * (n > 1)}, " # add to string
if show or save or render:
img = Image.fromarray(img) if isinstance(img, np.ndarray) else img # from np
img = Image.fromarray(img.astype(np.uint8)) if isinstance(img, np.ndarray) else img # from np
for *box, conf, cls in pred: # xyxy, confidence, class
# str += '%s %.2f, ' % (names[int(cls)], conf) # label
ImageDraw.Draw(img).rectangle(box, width=4, outline=colors[int(cls) % 10]) # plot