Skip to content

Commit 3b7abb5

Browse files
HighMansClay Januhowski
authored andcommitted
Fix confidence threshold for ClearML debug images (ultralytics#9174)
* Fix confidence threshold The confidence is converted to a percentage on line 144, but it is being compared to a default conf_threshold value of a decimal value instead of percent value. Signed-off-by: HighMans <[email protected]> * Revert "Fix confidence threshold" This reverts commit f84a099. * Fix confidence comparison Fix the confidence percentage is being compared to a decimal value. Signed-off-by: HighMans <[email protected]>
1 parent 832fc92 commit 3b7abb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/loggers/clearml/clearml_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ def log_image_with_boxes(self, image_path, boxes, class_names, image, conf_thres
141141
color = colors(i)
142142

143143
class_name = class_names[int(class_nr)]
144-
confidence = round(float(conf) * 100, 2)
145-
label = f"{class_name}: {confidence}%"
144+
confidence_percentage = round(float(conf) * 100, 2)
145+
label = f"{class_name}: {confidence_percentage}%"
146146

147-
if confidence > conf_threshold:
147+
if conf > conf_threshold:
148148
annotator.rectangle(box.cpu().numpy(), outline=color)
149149
annotator.box_label(box.cpu().numpy(), label=label, color=color)
150150

0 commit comments

Comments
 (0)