vis4d.data.transforms.mask

Segmentation/Instance Mask Transform.

Classes

ConvertInstanceMaskToSegMask(*[, in_keys, ...])

Merge all instance masks into a single segmentation map.

RemappingCategories(*[, in_keys, out_keys, ...])

Remap classes using a mapping list.

class ConvertInstanceMaskToSegMask(*, in_keys=('boxes2d_classes', 'instance_masks'), out_keys=['seg_masks'], sensors=None, same_on_batch=True, **kwargs)[source]

Merge all instance masks into a single segmentation map.

__call__(classes_list, masks_list)[source]

Execute conversion.

Parameters:
  • classes_list (list[NDArrayI64]) – List of Array of class ids, shape [N,].

  • masks_list (NDArrayU8) – List of array of instance masks, shape [N, H, W].

Returns:

List of Segmentation mask, shape [H, W].

Return type:

list[NDArrayU8]

class RemappingCategories(*, in_keys=['boxes2d_classes'], out_keys=['boxes2d_classes'], sensors=None, same_on_batch=True, **kwargs)[source]

Remap classes using a mapping list.

__call__(classes_list)[source]

Execute remapping.

Parameters:

classes_list (list[NDArrayI64]) – List of array of class ids, shape [N,].

Returns:

List of array of remapped class ids, shape [N,].

Return type:

list[NDArrayI64]