Fix operator precedence in ObjectCounter.display_counts (#23132)

This commit is contained in:
Murat Raimbekov 2026-01-07 15:33:48 +06:00 committed by GitHub
parent d1c735b306
commit 902ea99ba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,7 @@ class ObjectCounter(BaseSolution):
str.capitalize(key): f"{'IN ' + str(value['IN']) if self.show_in else ''} "
f"{'OUT ' + str(value['OUT']) if self.show_out else ''}".strip()
for key, value in self.classwise_count.items()
if value["IN"] != 0 or (value["OUT"] != 0 and (self.show_in or self.show_out))
if (value["IN"] != 0 and self.show_in) or (value["OUT"] != 0 and self.show_out)
}
if labels_dict:
self.annotator.display_analytics(plot_im, labels_dict, (104, 31, 17), (255, 255, 255), self.margin)