-
Notifications
You must be signed in to change notification settings - Fork 709
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 torchfx feature extractor #675
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another comment would be that this PR would break the backward compatibility due to the removal of FeatureExtractor
. It would be good to still support it such that when the user tries to import from anomalib.models.components import FeatureExtractor
it would inherit TimmFeatureExtractor
but throws a deprecation warning.
Good point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ashwinvaidya17 for your great effort! Only minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just one suggestion for improving the unit tests.
@@ -39,6 +42,32 @@ def test_feature_extraction(self, backbone, pretrained): | |||
else: | |||
pass | |||
|
|||
def test_torchfx_feature_extraction(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a test case for creating a feature extractor from a local model definition, and a string to a weights file. That way we would have a more complete coverage of the possible use cases of the class.
We could use a dummy model consisting of a few convolutional layers and a corresponding weights file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added functionality to directly pass locally defined class + tests for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
sorry @ashwinvaidya17 i couldn't find the time to review this one |
Description
This PR only introduces torchfx. For other refactor see #717
Changes
Checklist