-
Notifications
You must be signed in to change notification settings - Fork 24
Fixes multi-module feature extraction bugs and handling of Pytorch dataloaders, which return image-target pairs. #191
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
Conversation
lucaeyring
left a comment
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.
Looks good to me, thanks for the fixes!!
MarcoMorik
left a comment
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.
Looks good to me
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #191 +/- ##
=======================================
Coverage 75.36% 75.36%
=======================================
Files 40 40
Lines 2139 2172 +33
Branches 272 276 +4
=======================================
+ Hits 1612 1637 +25
- Misses 429 437 +8
Partials 98 98
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MarcoMorik
left a comment
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.
Great Tests
LukasMut
left a comment
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.
LGTM
This PR fixes the following bugs in the feature extraction pipeline
extract_featuresBaseExtractor.extract_features:features=defaultdict(list). This, unfortunately, deletes the intermediate results of other modules. Therefore changed tofeatures[module_name]=[]module/featuredoes not exist, then an error is thrown.save_in_one_file=True,output_diris prepended again. Which incorrect.super().extract_features--> need to addfile_name_suffixandsave_in_one_fileas arguments to be able to pass it to the parent.NEW: Dataloader modifier
PR adds a context manager for PyTorch feature extraction. Assumes that a dataloader either returns an image or a tuple of (image, *args) or a list of (image, *args). If the dataloader returns a tuple of (image, *args) or a list of (image, *args), it will return only the images. The class does not modify otherwise (e.g., specialized dataloaders).