COCOSegToSegMask

class hybrid_learning.datasets.custom.coco.keypoints_dataset.COCOSegToSegMask(img_size=None, coco_handle=None, merge_masks=True, include_crowds=True)[source]

Bases: _ToSegMask

Turn COCO instance segmentation annotations into a single binary segmentation mask. The reduction is the trivial logical AND, as masks are assumed to be binary. Output size: (masks, height, width).

Public Data Attributes:

Inherited from : py: class:_ToSegMask

settings

Settings to reproduce the instance.

Inherited from : py: class:Transform

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings to reproduce the instance.

Public Methods:

to_masks(anns)

Turn annotations into list of boolean masks.

Inherited from : py: class:_ToSegMask

to_masks(anns)

Turn annotations into list of boolean masks.

apply_to(anns)

Turn annotations into a single binary float tensor.

Inherited from : py: class:Transform

apply_to(anns)

Turn annotations into a single binary float tensor.

Special Methods:

Inherited from : py: class:_ToSegMask

__init__([img_size, coco_handle, ...])

Init.

Inherited from : py: class:Transform

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

__copy__()

Return a shallow copy of self using settings.

__add__(other)

Return a flat composition of self with other.

__radd__(other)

Return a flat composition of other and self.

__call__(*inps)

General call to the transformation.


Parameters
  • img_size (Tuple[int, int]) –

  • coco_handle (COCO) –

  • merge_masks (bool) –

  • include_crowds (bool) –

to_masks(anns)[source]

Turn annotations into list of boolean masks.

Parameters

anns (Sequence[Dict[str, Any]]) –

Return type

List[ndarray]