-
Notifications
You must be signed in to change notification settings - Fork 150
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
Plotting single channel image with show_sample results in incorrect plot output, with out without masks #1080
Comments
Hey, is your image 8bit or 16bit in grayscale values? We have a set of grayscale record defaults for the purpose of using 16bit grayscale images (https://github.com/airctic/icevision/blob/master/icevision/core/record_defaults.py). It should be enough to just overwrite the icevision/icevision/parsers/coco_parser.py Line 113 in 0e42d3d
COCOMaskParser .
|
Closing due to inactivity |
I think this should be re-opened. one of the components that builds the grayscale default record seems to have been commented out and it is non trivial to find all the imports to set this tempalte record function up https://github.com/airctic/icevision/blob/master/icevision/core/record_components.py#L453 ideally, the COCOMaskParser would handle reading grayscale or n-channel imagery by either using the grayscale record or the other record. after importing all the record components,, masksrecordcomponent isn't defined
|
I tried to replace the commented out
parsing doesn't fail, but show_results does
and these are the components present in the first record. it looks like there are duplicates
|
🐛 Bug
Describe the bug
When I plot a sample that has a single channel image and masks, PIL is used in the background I think and it incorrectly converts the single channel image to a color image instead of keeping it in greyscale. The show sample func also adds a false border as seen below.
To Reproduce
I can't provide the underlying data, but this is what my train record looks like for the single channel dataset
and to show the plot that looks incorrect
Expected behavior
Plot the image in greyscale, with colored masks on top
Screenshots
with labels:
Desktop (please complete the following information):
Additional context
I'm running icevision .12.0
Plotting the file directly with scikit-image .imshow looks as expected. In general I prefer scikit-image to using PIL because PIL makes too many assumptions about the data for my use cases (that it is rgb, that it is of a certain data type, doesn't support float32 fully python-pillow/Pillow#1888)
The text was updated successfully, but these errors were encountered: