yolov5 icon indicating copy to clipboard operation
yolov5 copied to clipboard

Train Yolo with packed RGB(A) pictures ?

Open LeRatierBretonnien opened this issue 7 months ago • 4 comments
trafficstars

Search before asking

  • [x] I have searched the YOLOv5 issues and discussions and found no similar questions.

Question

Hello,

I would like to know if it is possible to train Yolo with RGB pictures but in packed format. So instead of having 3 planes (ie 1 R, 1 G, 1 B), the pixels are packed in a single plane, with 24 bits (or 32 bits) value for each pixel.

I see that I can change the channels of the training process (ie for grayscale and depth, for example), but I do not see how to indicate that the picture is in fact a single plane with 24 bits (or 32), with 1 byte per channel.

Thanks for clarification/help,

Additional

No response

LeRatierBretonnien avatar Mar 27 '25 07:03 LeRatierBretonnien

👋 Hello @LeRatierBretonnien, thank you for your question and interest in YOLOv5 🚀!

To address your query about training YOLO with packed RGB(A) images, we would need additional details to assist you better. If this is a 🐛 Bug Report, please provide a minimum reproducible example (MRE), including code snippets, sample inputs, or any logs that can help us understand the behavior you're encountering.

If this is a ❓ Question, we recommend sharing more context about your dataset, preprocessing steps, and any modifications you've made to the YOLOv5 codebase. This can help us provide a more tailored response. In the meantime, you can explore our ⭐️ Tutorials for insights on data preprocessing and training workflows, including Custom Data Training.

Requirements

Ensure you are running YOLOv5 in a supported environment with the correct dependencies: Python>=3.8.0 and PyTorch>=1.8 installed with all requirements.txt. To set up your environment:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 supports various environments, making it versatile for experimentation:

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify the correct operation of YOLOv5's training, validation, inference, export, and benchmarks across macOS, Windows, and Ubuntu platforms.

This is an automated response to provide initial guidance. An Ultralytics engineer will review your issue and provide additional assistance shortly. Thank you for your patience and for using YOLOv5! 😊

UltralyticsAssistant avatar Mar 27 '25 07:03 UltralyticsAssistant

@LeRatierBretonnien yOLOv5 models require input images in standard 3-channel RGB format. For packed RGB(A) formats, you'll need to preprocess your images to unpack them into standard 3-channel format (HWC shape) before training. You can implement this conversion in your custom dataset loader or preprocessing pipeline.

For guidance on custom data handling, see the Ultralytics YOLOv5 dataset documentation. If you need to apply additional augmentations after conversion, consider exploring the Albumentations integration guide for advanced preprocessing options.

pderrenger avatar Mar 27 '25 23:03 pderrenger

Thanks for clarification and explanation, this is appreciated

LeRatierBretonnien avatar Mar 29 '25 11:03 LeRatierBretonnien

You're welcome! For YOLOv5 training, ensure your packed RGB(A) images are converted to 3-channel RGB format during preprocessing. For implementation specifics, see our custom dataset documentation. Let us know if you need further guidance. 🚀

pderrenger avatar Mar 29 '25 23:03 pderrenger

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

  • Docs: https://docs.ultralytics.com
  • HUB: https://hub.ultralytics.com
  • Community: https://community.ultralytics.com

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

github-actions[bot] avatar Oct 10 '25 00:10 github-actions[bot]