Conversation
|
Seems like it's working. The only thing I'm worried about is non-contiguous images being passed around the dataloader. I'll check to see if they're contiguous |
@glenn-jocher But what does that have to do with the changes here? Or do you mean they could become noncontinous because of the changes? |
|
@UnglvKitDe ops on non-contiguous arrays will still run but they are no longer optimized and the operations may be much slower, i.e.: import cv2
import numpy
im_bgr = cv2.imread('data/images/bus.jpg')
im_rgb1 = im_bgr[...,::-1]
im_rgb2 = cv2.cvtColor(im_bgr, cv2.COLOR_BGR2RGB)
print(im_bgr.data.contiguous) # True
print(im_rgb1.data.contiguous) # False
print(im_rgb2.data.contiguous) # True |
Mh ok, thats a good point. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions YOLOv5 🚀 and Vision AI ⭐. |
|
👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap. We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved. For additional resources and information, please see the links below:
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
|
@UnglvKitDe yes, it's important to ensure that the image arrays remain contiguous for performance reasons. The changes in the PR should not affect the contiguity of the arrays, but it's always good to verify that such issues don't arise with modifications to image handling. If you encounter any performance issues or have further questions, feel free to reach out. Thanks for your contribution! 🚀 |
Second attempt at resolving RGB Albmentations order issue #8695.
First PR fix #8695 failed and reverted.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Improved color handling in image augmentations and loading by ensuring consistent RGB color space usage.
📊 Key Changes
cv2.COLOR_BGR2HSVtocv2.COLOR_RGB2HSVinaugment_hsv()to start with RGB images for HSV conversion.cv2.COLOR_HSV2BGRtocv2.COLOR_HSV2RGBafter HSV operations to maintain images in RGB format.transposeoperation in__getitem__()indataloaders.py.load_image()andcache_images_to_diskto indicate that images are kept in RGB.🎯 Purpose & Impact