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

Transparency (alpha) band of PNG images not used when training #112

Open
fferlito opened this issue Feb 16, 2023 · 3 comments
Open

Transparency (alpha) band of PNG images not used when training #112

fferlito opened this issue Feb 16, 2023 · 3 comments

Comments

@fferlito
Copy link

A normal image is composed by red, green, and blue (RGB) channels. Some image format, like .png, allow to have 4, where the 4th usually it's the transparency of the image (this is called alpha channel sometimes). In most of our dataset, we exploit this extra channel to put an extra color information, the infrared band (since we use satellite images with 4 bands). When we upload PNG images with 4 bands, and then we download it back from roboflow, this information is lost, as the downloaded images have in the alpha band only 255 as value, and also the RGB values seems slightly modified.

I'm attaching to this email a link to a COCO dataset that can be uploaded to debug this problem: here

@fferlito fferlito changed the title Transparency (alpha) band of PNG images altered during upload and download [BUG] Transparency (alpha) band of PNG images altered during upload and download Feb 16, 2023
@FrancescoSaverioZuppichini
Copy link
Contributor

Hi @fferlito 👋

Thanks for opening an issue, unfortunately we don't currently allow custom formats (in your case, this is a custom format since the forth channel doesn't hold the transparency information). I do believe we drop it at some point. Moreover, I also believe YOLO uses 3 channels, not more.

cc @Jacobsolawetz

@fferlito
Copy link
Author

Hi,

thanks the reply. The format itself is not custom, but it's PNG. I thought it would be a bug since the RGB values are modified when there any information in the alpha channel, and I guess this is not generally desirable.

For YOLO, yes, that's not a problem, but it is when using any other model which can make use of extra color bands.
This feature will make the life of me and my team a lot easier, as now we need to keep a copy of the dataset locally to use it for local training. I hope it will be added at some point 😃

@FrancescoSaverioZuppichini
Copy link
Contributor

Thank you very much for taking the time to respond. It seems that the information being added to the transparency channel may not actually be transparency, thus it's not really a PNG - strictly speaking.

However, I understand that this may not be the main issue at hand. As far as I am aware, YOLO doesn't currently use the fourth channel, so there may be limited options available to address this matter. I would like to suggest that we consider opening an issue with YOLO (either version 5 or 8) to inquire about the possibility of a solution.

Thank you again for your response :)

@FrancescoSaverioZuppichini FrancescoSaverioZuppichini changed the title [BUG] Transparency (alpha) band of PNG images altered during upload and download Transparency (alpha) band of PNG images not used when training Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants