Skip to content

v0.7.26.2 - updating draw function

Compare
Choose a tag to compare
@Ziad-Algrafi Ziad-Algrafi released this 10 May 16:24
· 40 commits to main since this release
7c31038

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.