-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
How to train 16bit grayscale images? #8481
Comments
👋 Hello @pourmand1376, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com. RequirementsPython>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
@pourmand1376 I don't think you want to try using 16 bit imagery. uint8 is the standard across all ML, and the 255 value is hard coded in multiple places throughout the repository, as well as the assumption built into many functions, not to mention your model will be unable to deploy using any standard workflows. If you have greyscale imagery I would simply convert these to normal greyscale PNGs like you did and let YOLO train on them directly without any modifications. You might disable HSV augmentation or visit the Tips for Best Training Tutorial for training best practices. |
Thank you. As each patient in my case has 200 images and they are totally related, do you recommend creating a 16 channel image (each image is gray-scale) which consists 16 random samples from the same patient and make model learn that thing? (Something like #1741) Currently it seems that I am not using all information which a patient has, I am just using a 1% of information. |
@pourmand1376 oh I see. Well if you have 200 channels you could just submit all 200. But you are confusing topics. 8 bits or 16 bits is just the color depth of a channel. 3ch vs 1ch is about RGB vs greyscale. You can have RGB images at 8, 16, 32, 64 bits and they still only have 3 channels. |
Well.Thanks for explanation. I should have created another issue for this one. Mixing issues is not a good idea. My question is resolved so I think it is best to close this issue. Thank you again🙏 |
@pourmand1376 you're welcome! 🙏 I'm glad I could help clarify things for you. If you have any more questions in the future, please feel free to open a new issue. Have a great day! |
Search before asking
Question
Issues I've read:
I have 16-bit grayscale images. Until now, I've converted all images to
grayscale png
with 16-bit depth. YOLOv5 works but it doesn't give good results. One of my assumptions is that since a lot of information is lost, training results is not good. The images were originaldcm
format and I converted them topng
to be able to read it.I read source code and I understood that YOLO convert png image to 8bit. To be specific, whenever I see
cv2.imread
it is like this:I changed every
imread
function and also changed every scaling from 255 to 65535, but I am not able to get any results. I get some weird error which I can not trace back.There is also a stackoverflow post about this but it doesn't help.
I try to get my image to work with YOLOv5, but it appears hopeless. Could you please give me a starting point?
Additional
No response
The text was updated successfully, but these errors were encountered: