-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for single-band rasters in segmentation #125
Comments
Thanks, good observation, we will be definitively looking into it soon to add support for 1 channel images |
I have 4 input channels (RGB + height data). Would be great to allow arbitrary amount of input bands! |
Hi @adrianloy and @Saareem! Could you share with me your models and provide example data for these features' development process? |
@adrianloy As selection of normalization is based on the model and same normalization is expected at inference time as during the training, it would certainly be beneficial to have the possibility to run models without any normalization, assuming that the normalization is performed before input to the model, as a separate preprocessing step. Another option would be to change the architecture of the plugin so that different normalization routine (min/max, division by 255 for byte rasters, z-score, you name it) could be selected on input channel level but it complicates things significantly. In that way, it would be easier to run models which used some particular type of normalization during the training. As an example, the UNet I mentioned Standardizes RGB channels by
However, for height information, such as DSM and DEM, this is not performed. For DSM and DEM
For now, I'm performing the global, raster level operations, in a separate preprocessing step using BandMathX tool in OrfeoToolBox in QGIS and then input the prenormalized raster to Deepness. In the overridden preprocessing method I'm only calculating the tile-level means and making the subtraction of mean from tile for DSM and DEM. |
@adrianloy @bartoszptak |
What you say is correct in general, however in my specific case I am not running into the normalization issue, as I use the height data for some post-processing in raw format. So my custom computational graph will take care of it, but I need to be able to pass the band as input to it. |
@adrianloy Are you using composite or multi-band raster? I'm using 5-channel multi-band raster without issues so it should be possible. It seems in composite rasters there is an assumption it will contain at most 4 channels. |
Currently, single-channel rasters for segmentation are not supported. This is an artificial restriction as there are certainly some segmentation models which use single input band instead of an RGB, RGBA or composite band raster. The current implementation assumes the input raster to be any of the previously mentioned or, rather, having more than 1 standalone bands. I don't need this feature at the moment, so I won't implement it, but it should be noted. I know of some models which use a single-band probability mask as an input to perform post-processing for segmentation model outputs. One use case for single-band rasters as input could be segmentation of DTM, DSM or their derivatives and, additionally, radar images.
From input_channels_mapping_widget.py
I stumbled upon this on accident as I quit QGIS when I had a single-band raster set as the input. When QGIS loaded, it also checked the input channel mapping using this single-band raster previously written in the config and produced an error: "Invalid input layer type!".
The text was updated successfully, but these errors were encountered: