Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawn bounding box labels #519

Open
marcheseV opened this issue Dec 10, 2019 · 2 comments
Open

Drawn bounding box labels #519

marcheseV opened this issue Dec 10, 2019 · 2 comments

Comments

@marcheseV
Copy link

Hi,

When initializing an object using the BoundingBox class an option to store a label parameter is available. However, an option to then draw this label onto an image together with the bounding box, using the method draw_on_image is not an option. This presents an issue when drawing bounding boxes onto an image that contains multiple objects.

Is there a way to get these labels drawn onto an image using the imgaug library, or is there a plan to add this functionality in the near future.

Thanks!

@aleju
Copy link
Owner

aleju commented Dec 16, 2019

Currently this is not available in an easy function call. It has been requested in the past and is a todo since quite a while. There just wasn't the time available to add it yet.
The best to do currently is to manually set the BB color based on the label, which is admittedly not a very convenient solution.

@aleju aleju added the TODO Planned to be added to the library or changed in the future label Dec 16, 2019
aleju added a commit that referenced this issue Jan 1, 2020
This patch adds automatic drawing of BB labels upon
calls of `BoundingBox.draw_on_image()` and
`BoundingBoxesOnImage.draw_on_image()`.

This resolves issues #519 and #195.

* Add method `imgaug.augmentables.BoundingBox.draw_label_on_image()`.
* Add method `imgaug.augmentables.BoundingBox.draw_box_on_image()`.
* Change method `imgaug.augmentables.BoundingBox.draw_on_image()`
  to automatically draw a bounding box's label.
@aleju aleju removed the TODO Planned to be added to the library or changed in the future label Feb 22, 2020
@aleju
Copy link
Owner

aleju commented Feb 22, 2020

This feature was recently added to the library in 0.4.0. Bounding box labels are now automatically drawn (so long as the bounding box has a label).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants