Skip to content

Fix: Label now is showed correctly in overview table#691

Open
Felipedino wants to merge 1 commit into
developfrom
fix/images-preview
Open

Fix: Label now is showed correctly in overview table#691
Felipedino wants to merge 1 commit into
developfrom
fix/images-preview

Conversation

@Felipedino

Copy link
Copy Markdown
Collaborator

This pull request refactors variable names and improves clarity in the image_dataloader.py file, 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:

  • Renamed the entries variable to children in the _find_imagefolder_root function to better reflect its purpose as directory children.
  • Renamed variables in _load_images_from_directory: entries is now top_level_dirs, class_name is now top_level_dir, and class_path is now top_level_dir_path, clarifying the code's intent.
  • Changed the label assignment in the image records to use os.path.basename(dirpath) instead of the previous variable, ensuring the label accurately represents the directory name containing the image.

Copilot AI review requested due to automatic review settings June 7, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_root and _load_images_from_directory for 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants