Prioritize using imagesize library to get image size for ImageFromFile#1259
Merged
vinnamkim merged 5 commits intoopen-edge-platform:developfrom Feb 6, 2024
Merged
Prioritize using imagesize library to get image size for ImageFromFile#1259vinnamkim merged 5 commits intoopen-edge-platform:developfrom
vinnamkim merged 5 commits intoopen-edge-platform:developfrom
Conversation
vinnamkim
reviewed
Feb 5, 2024
Co-authored-by: Vinnam Kim <vinnam.kim@gmail.com>
Contributor
Author
|
@vinnamkim
|
vinnamkim
reviewed
Feb 5, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1259 +/- ##
===========================================
- Coverage 80.54% 80.51% -0.04%
===========================================
Files 271 270 -1
Lines 30438 30426 -12
Branches 5930 5931 +1
===========================================
- Hits 24517 24498 -19
- Misses 4532 4535 +3
- Partials 1389 1393 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
Accelerate loading of image file-based datasets.
I found that printing out the YOLO dataset information for the first time was slow. After some digging I found that
datamarowas reading the entire dataset through to get the size of each image.Interactive encoding with datasets on HDD is slow. So I added an override
size()property in theImageFromFileclass which first tries to get the image size usingPIL. ThePILlibrary is about 8 times faster thanOpenCVin getting the image size.All dataset classes that use the
sizeproperty ofImageFromFilecan benefit from this modification.How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.