Segmentor
Segmentor
¶
Source code in geograypher/predictors/segmentor.py
Functions¶
inds_to_one_hot(inds_image, num_classes=None, ignore_ind=255)
staticmethod
¶
Convert an image of indices to a one-hot, one-per-channel encoding
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inds_image |
ndarray
|
Image of integer indices. (m, n) |
required |
num_classes |
(int, None)
|
The number of classes. If None, computed as the max index provided. Default None |
None
|
ignore_ind |
inte
|
This index is an ignored class |
255
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: (m, n, num_classes) boolean array with one channel filled with a True, all else False |
Source code in geograypher/predictors/segmentor.py
segment_image(image, **kwargs)
¶
Produce a segmentation mask for an image
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
ndarray
|
np |
required |
segment_image_batch(images, **kwargs)
¶
Segment a batch of images, to potentially use full compute capacity. The current implementation should be overriden when there is a way to get improvements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
images |
List[ndarray]
|
The list of images |
required |