Fix: Label now is showed correctly in overview table#691
Open
Felipedino wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adjusts the imagefolder loading logic in image_dataloader.py to ensure each image record’s label reflects the directory that actually contains the image, and performs small variable renames to improve readability.
Changes:
- Renamed local variables in
_find_imagefolder_rootand_load_images_from_directoryfor clearer semantics. - Updated label assignment to use
os.path.basename(dirpath)so labels match the image’s containing folder during recursive directory walks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request refactors variable names and improves clarity in the
image_dataloader.pyfile, making the code easier to read and maintain. The changes mainly focus on renaming variables for better semantic meaning and ensuring the correct label is assigned to each image.Refactoring and clarity improvements:
entriesvariable tochildrenin the_find_imagefolder_rootfunction to better reflect its purpose as directory children._load_images_from_directory:entriesis nowtop_level_dirs,class_nameis nowtop_level_dir, andclass_pathis nowtop_level_dir_path, clarifying the code's intent.os.path.basename(dirpath)instead of the previous variable, ensuring the label accurately represents the directory name containing the image.