From 6b3c9d30b22abfbaa63c5aaa7750c984990738a6 Mon Sep 17 00:00:00 2001 From: francesco Date: Mon, 20 Sep 2021 17:12:33 +0200 Subject: [PATCH] delete label if there is only one class --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index 0ec51b8..c51d865 100644 --- a/detect.py +++ b/detect.py @@ -107,7 +107,7 @@ def detect(save_img=False): f.write(('%g ' * 5 + '\n') % (cls, *xywh)) # label format if save_img or view_img: # Add bbox to image - label = '%s' % (names[int(cls)]) + label = '%s' % (names[int(cls)]) if len(names) > 1 else None plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=2) # Print time (inference + NMS)