Skip to content
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

Fix shape mismatch #598

Merged
merged 13 commits into from
Jan 24, 2023
Merged

Fix shape mismatch #598

merged 13 commits into from
Jan 24, 2023

Conversation

Laughing-q
Copy link
Member

@Laughing-q Laughing-q commented Jan 24, 2023

@AyushExel @glenn-jocher
the shape mismatch issue happens when there're mixed labels(both detection labels and segmentation labels).
Now it will force to use detection labels and remove segmentation labels when there're mixed labels and raise a warning.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancements in label caching and consistency checks for mixed datasets.

📊 Key Changes

  • 📝 Improved the cache_labels method to update im_files based on the cached labels.
  • 🚀 Added consistency checks to handle datasets containing a mix of bounding boxes and segments within the get_labels method.
  • ⚠️ Added a warning for when a dataset contains both detection boxes and segmentation labels, now defaults to using only boxes in such cases.

🎯 Purpose & Impact

  • 🎨 The update ensures the list of image files remains consistent with the cached labels, improving data integrity.
  • 💡 This change helps prevent potential issues when training models on mixed datasets, by enforcing dataset consistency and creating awareness about the ideal dataset structure.
  • 🛠️ Benefits users by automatically resolving inconsistencies in their data which might have led to training errors or suboptimal model performance.

@Laughing-q
Copy link
Member Author

tested this dataset with the same command and it works as expected. #548 (comment)
before:
image

after this PR, the training looks good and raise a warning says the dataset is not pure:
jHle18YVuN

@glenn-jocher glenn-jocher changed the base branch from main to torch_safe_load January 24, 2023 15:46
@glenn-jocher glenn-jocher merged commit 133f9ac into torch_safe_load Jan 24, 2023
@glenn-jocher glenn-jocher deleted the fix_shape_mismatch branch January 24, 2023 15:46
@glenn-jocher
Copy link
Member

@Laughing-q PR merged! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants