tlc.client.data_format
¶
Defines the standard representations of composite features in 3LC.
Module Contents¶
Classes¶
Class |
Description |
---|---|
The base class for dictionary representations of instance segmentation data. |
|
A dictionary representation of instance segmentation data where each instance is represented by a list of
polygons. Has the same keys as |
|
A dictionary representation of instance segmentation data where each instance is represented by a binary mask.
Has the same keys as |
API¶
- class tlc.client.data_format.InstanceSegmentationDict(*args, **kwargs)¶
Bases:
typing.TypedDict
The base class for dictionary representations of instance segmentation data.
- class tlc.client.data_format.SegmentationPolygonsDict(*args, **kwargs)¶
Bases:
tlc.client.data_format.InstanceSegmentationDict
A dictionary representation of instance segmentation data where each instance is represented by a list of polygons. Has the same keys as
InstanceSegmentationDict
plus the keypolygons
.- polygons: list[list[float]] = None¶
A list of lists of floats, where each inner list represents a polygon enclosing a single instance. The inner list is a list of floats representing the coordinates of the polygon vertices, alternating between x and y coordinates, i.e. [x1, y1, x2, y2, …]. The floats can either be in terms of pixels or normalized to the range [0, 1] by dividing by the image width or height respectively, this should be specified in the schema.
- class tlc.client.data_format.SegmentationMasksDict(*args, **kwargs)¶
Bases:
tlc.client.data_format.InstanceSegmentationDict
A dictionary representation of instance segmentation data where each instance is represented by a binary mask. Has the same keys as
InstanceSegmentationDict
plus the keymasks
.- masks: numpy.typing.NDArray[numpy.uint8] = None¶
A numpy array of shape (width, height, num_instances) where each element is 1 if the pixel belongs to an instance and 0 otherwise.