-
Notifications
You must be signed in to change notification settings - Fork 32
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
[Bug] Patches truncated for 16 bit images #166
Comments
@perone do you think there would be any issues in Tensorflow with having a mixed dataset (8bit + 16bit) during the training? |
Hi @mathieuboudreau, |
Thanks! Poking around, although I was able to find where the images are converted toint patches in the dataset building stage, but in the segmentation call the patches are separated by a different function, This is also slightly concerning that we are using two different parts of the code to create patches. Maybe the short term solution for our current user who's dataset has a mix of 8bit and 16 bit files will be to just convert the 8bit files. I'll explore this and give them the option early next week. |
Actually, here are all the calls to |
And here are the calls to |
It may also be the "L" mode: python-pillow/Pillow#3011 L mode is 8bit pixel (black and white): https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imread.html |
Likely due to this line: https://github.com/neuropoly/axondeepseg/blob/57047da51781c12d06c1b5d59dcb705bf4adc376/AxonDeepSeg/data_management/dataset_building.py#L44
Combining
preserve_range
plusasint
may be what's truncating the patches (all white).The solution may be as simple as removing the
asint
call.@maxwab you wrote that line; do you see any issues with removing the
asint
call? I'll double check the rest of the code to make sure it's not assumed to be an 8bit int anywhere else. I guess it means that if I remove this, the data size will be much larger... Otherwise, removing the perserve_range could also possibly be a solution.The text was updated successfully, but these errors were encountered: