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

Fix spatial resolution for saliency_maps in torchvision_models #3336

Merged

Conversation

GalyaZalesskaya
Copy link
Contributor

Summary

  • Fixed spatial resolution for saliency_maps in torchvision_models. CVS-137552
  • get_feature_vector -> feature_vector_fn renaming for consistency. Reguest

Currently, in torchvision models the features are passed to the explainer after passing AvgPool2D layer, that causes the final saliency map to lose spatial resolution (e.g. (2, 3, 1, 1) instead of (2, 3, 7, 7)).
This PR breaks backbone into feature_extractor and avgpool and passes features after feature_extractor to explainer.
Also I added tests to check spatial resolution of the resulting saliency maps.

Issue: CVS-137552

How to test

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added e2e tests for validation.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache 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) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@github-actions github-actions bot added TEST Any changes in tests OTX 2.0 labels Apr 16, 2024
@GalyaZalesskaya
Copy link
Contributor Author

@vinnamkim Here is the fix of the issue you reported

vinnamkim
vinnamkim previously approved these changes Apr 18, 2024
harimkang
harimkang previously approved these changes Apr 18, 2024
@GalyaZalesskaya GalyaZalesskaya merged commit e821d31 into openvinotoolkit:develop Apr 18, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants