Skip to content

Commit

Permalink
Fix confidence threshold for ClearML debug images (#9174)
Browse files Browse the repository at this point in the history
* 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 <42877729+HighMans@users.noreply.github.com>

* 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 <42877729+HighMans@users.noreply.github.com>
  • Loading branch information
HighMans authored Aug 26, 2022
1 parent cff9717 commit ffbce38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/loggers/clearml/clearml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def log_image_with_boxes(self, image_path, boxes, class_names, image, conf_thres
color = colors(i)

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

if confidence > conf_threshold:
if conf > conf_threshold:
annotator.rectangle(box.cpu().numpy(), outline=color)
annotator.box_label(box.cpu().numpy(), label=label, color=color)

Expand Down

0 comments on commit ffbce38

Please sign in to comment.