Implement XAI for tiling detection#2240
Merged
sovrasov merged 28 commits intoopen-edge-platform:developfrom Jul 4, 2023
Merged
Implement XAI for tiling detection#2240sovrasov merged 28 commits intoopen-edge-platform:developfrom
sovrasov merged 28 commits intoopen-edge-platform:developfrom
Conversation
added 3 commits
June 13, 2023 19:14
8 tasks
Contributor
|
Could you add and update unit test? |
eunwoosh
reviewed
Jun 16, 2023
Contributor
eunwoosh
left a comment
There was a problem hiding this comment.
Thanks for good enhancement! I left some comments. please take a look.
otx/algorithms/common/adapters/mmcv/hooks/recording_forward_hook.py
Outdated
Show resolved
Hide resolved
otx/algorithms/common/adapters/mmcv/hooks/recording_forward_hook.py
Outdated
Show resolved
Hide resolved
otx/algorithms/detection/adapters/mmdet/hooks/det_class_probability_map_hook.py
Outdated
Show resolved
Hide resolved
jaegukhyun
reviewed
Jun 16, 2023
Contributor
|
Overally LGTM, As Eunwoo said, could you add unit test to cover your PR? And is there no need to add intg or e2e test for this feature? |
Contributor
|
Thank you for a PR! |
sovrasov
reviewed
Jun 16, 2023
Contributor
|
Could you resolve conflicts? |
Contributor
Author
|
@eunwoosh @jaegukhyun @negvet @sovrasov |
Contributor
Author
sovrasov
reviewed
Jun 30, 2023
sovrasov
reviewed
Jun 30, 2023
8f50247 to
988816c
Compare
sovrasov
previously approved these changes
Jul 3, 2023
Contributor
|
Could you check fail test cases? |
negvet
approved these changes
Jul 4, 2023
sovrasov
approved these changes
Jul 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the functionality to use saliency maps for tiles and merge them in the unite saliency map. The current approach is to resize a whole image and use its saliency map, which suffers from the lack of details.
The results of the new approach and the current one are below.
Also, the exact same merging mechanism was applied for Mask RCNN (Instance Segmentation) Pytorch inference:

For Mask RCNN (Instance Segmentation) OpenVINO inference saliency maps aren't returned for each tole. So, the merged masks for the united image were used.

What was added:
Merging saliency maps functionality, using both saliency maps from tiles and a whole image, add non-linear normalization afterward
Add implementation for PyTorch inference and OpenVINO inference for all detection models
Add implementation to merge saliency maps for Pytorch task for Instance Segmentation task (Mask RCNN)
Updated saliency map generation for OpenVINO inference task for Instance Segmentation
Add parameter in BaseRecordingForwardHook whether to return normalized saliency maps
Add parameter in DetClassProbabilityMapHook whether to use softmax in saliency maps postprocessing
Fixed the issue there during workplace creation for Mask RCNN model
deployment_tile_classifier.pyconfig file wasn't createdUnit tests
e2e tests
CVS-108355
Checklist
License
Feel free to contact the maintainers if that's a concern.