Skip to content

Train Yolo with packed RGB(A) pictures ? #13549

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

Open
1 task done
LeRatierBretonnien opened this issue Mar 27, 2025 · 4 comments
Open
1 task done

Train Yolo with packed RGB(A) pictures ? #13549

LeRatierBretonnien opened this issue Mar 27, 2025 · 4 comments
Labels
question Further information is requested

Comments

@LeRatierBretonnien
Copy link

Search before asking

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 LeRatierBretonnien added the question Further information is requested label Mar 27, 2025
@UltralyticsAssistant
Copy link
Member

👋 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! 😊

@pderrenger
Copy link
Member

@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.

@LeRatierBretonnien
Copy link
Author

Thanks for clarification and explanation, this is appreciated

@pderrenger
Copy link
Member

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. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants