openvinotoolkit / openvino_xai

OpenVINO™ Explainable AI (XAI) Toolkit: Visual Explanation for OpenVINO Models
https://openvinotoolkit.github.io/openvino_xai/
Apache License 2.0
29 stars 9 forks source link

Add explanation.plot() #53

Closed GalyaZalesskaya closed 3 months ago

GalyaZalesskaya commented 3 months ago

Use matplotlib (recommended for Jupyter) - default backend

explanation.plot(targets=[7, 11], backend="matplotlib") explanation.plot(targets=-1, backend="matplotlib") # plot saliency maps for all classes explanation.plot(targets=['cat', 'dog'], backend="matplotlib")

image image

Use OpenCV (recommended for Python) - will open new windows with maps

explanation.plot(targets=[7, 11], backend="cv") explanation.plot(targets=-1, backend="cv") # plot saliency maps for all classes explanation.plot(targets=['cat', 'dog'], backend="cv")

image

negvet commented 3 months ago

Thanks for the nice feature, could you please post some screenshots of how it looks like in jupyter and python?

Regarding juputer, we might want to update the openvino notebooks with this feature (where applicable) after the release. This might be a good check to create a draft pull request with your current branch and see how it works in current notebooks

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.17%. Comparing base (00ebd2e) to head (a6bc688).

Files Patch % Lines
openvino_xai/explainer/explanation.py 97.77% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #53 +/- ## =========================================== + Coverage 91.97% 92.17% +0.20% =========================================== Files 19 19 Lines 1233 1278 +45 =========================================== + Hits 1134 1178 +44 - Misses 99 100 +1 ``` | [Flag](https://app.codecov.io/gh/openvinotoolkit/openvino_xai/pull/53/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openvinotoolkit) | Coverage Δ | | |---|---|---| | [dev-py310](https://app.codecov.io/gh/openvinotoolkit/openvino_xai/pull/53/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openvinotoolkit) | `92.17% <97.77%> (+0.20%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openvinotoolkit#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

GalyaZalesskaya commented 3 months ago

@negvet Added pretty images to the description :)