Skip to content
Snippets Groups Projects
Commit 98be6bb7 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Improve normalization when generating instance segmentation model

parent a3edc324
No related branches found
No related tags found
2 merge requests!16Completed (de)serialization of RoiSet,!13Patch stack one channel
......@@ -252,7 +252,12 @@ class IlastikObjectClassifierFromPixelPredictionsModel(IlastikModel, ImageToImag
def label_instance_class(
self, img: GenericImageDataAccessor, mask: GenericImageDataAccessor, **kwargs
) -> GenericImageDataAccessor:
return super().label_instance_class(img, mask, pixel_classification_channel=px_ch)
if mask.dtype == 'bool':
norm_mask = 1.0 * mask.data
else:
norm_mask = mask.data / np.iinfo(mask.dtype).max
norm_mask_acc = InMemoryDataAccessor(norm_mask.astype('float32'))
return super().label_instance_class(img, norm_mask_acc, pixel_classification_channel=px_ch)
return _Mod(params={'project_file': self.project_file})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment