v0.7.26.2 - updating draw function
Release Notes: Improved Drawing of Bounding Boxes and Labels
We are excited to announce the release of an enhanced version of the draw_boxes_on_image
function, which now includes intelligent scaling of bounding boxes and labels based on the size of the detected objects.
Key Features
-
Adaptive Font Scaling: The font size of the class labels is now automatically adjusted based on the size of the detected objects. Larger objects will have larger font sizes, ensuring that the labels remain readable and proportional to the bounding box size.
-
Dynamic Text Thickness: In addition to the font size, the thickness of the label text is also dynamically adjusted based on the object size. This ensures that the labels maintain good visibility and clarity regardless of the object's dimensions.
-
Consistent Color Scheme: The function now utilizes a
class_colors
dictionary to assign consistent colors to each class ID across multiple images. This enhances visual coherence and makes it easier to identify and track objects of the same class. -
Improved Background Rectangle: The background rectangle behind the class labels has been enhanced to provide better readability. The rectangle size is intelligently adjusted based on the label text dimensions, ensuring that the text fits comfortably within the background.