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

Add Bbox visualizer #744

Merged
merged 7 commits into from
Oct 18, 2022
Merged

Conversation

vinnamkim
Copy link
Contributor

@vinnamkim vinnamkim commented Oct 17, 2022

Signed-off-by: Kim, Vinnam vinnam.kim@intel.com

Summary

  • Related ticket no. 94410.
  • Add visualization feature for bbox.
Visualize gallery API Visualize 1 sample API
image image
image image

How to test

Unit tests are updated.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

datumaro/components/visualizer.py Outdated Show resolved Hide resolved
datumaro/components/visualizer.py Outdated Show resolved Hide resolved
datumaro/components/visualizer.py Outdated Show resolved Hide resolved
@chuneuny-emily
Copy link
Contributor

Can you add the short summary and link instead of "related ticket no. 94410"?

Copy link
Contributor

@chuneuny-emily chuneuny-emily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visualizer.py is a newly created file in components. Please add it in changelog. And please consider to add Dataset visualization category at "How to use Datumaro" in user manual. It's not urgent, so you can update it all at once when other tasks are completed.

ncols: int,
subset: Optional[str] = None,
) -> Figure:
assert nrows > 0, "nrows should be a positive integer."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that halting the program is not a good idea since the visualizer is 'only for showing' not a core functional logic.
How about just printing error messages and showing empty images when something goes wrong instead of assertion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought is that this API is mainly target for Jupyter Notebook users. So, if there is a problem, their executions will be failed only at a cell scope. I think it will be okay and giving exception can make users more cautious than printing messages. If this API will be used in Python programs, I believe those intermediate users can sufficiently use try-catch clauses to capture exceptions.

if ann.type == AnnotationType.bbox:
self._draw_bbox(ann, label_categories, ax)
else:
raise NotImplementedError(f"{ann.type} is not implemented yet.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An exception will stop the program like an assertion.
How about just printing messages in the visualizer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to my above comment.

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim
Copy link
Contributor Author

visualizer.py is a newly created file in components. Please add it in changelog. And please consider to add Dataset visualization category at "How to use Datumaro" in user manual. It's not urgent, so you can update it all at once when other tasks are completed.

Documentation is planned for the next work in the future.

Copy link
Contributor

@wonjuleee wonjuleee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@bonhunko bonhunko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wonjuleee wonjuleee merged commit a4a5f83 into openvinotoolkit:develop Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ENHANCE Enhancement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants