Segments

Segments are how we define an event location in the SensiML Toolkit. They contain the start and end location of the event and the Label for the event

Examples:

from sensiml.datamanager.label_relationship import Segment, SegmentSet

# to see a list of segments associated with a capture
segment_set = SegmentSet(client._connection, client._project, capture)
print(segment_set.segments)

# To create a new segment
segment = Segment(client._connection, project, capture, segmenter, label, label_value)
segment.sample_start = 100
segment.sample_end = 1000
segment.insert()
class sensiml.datamanager.label_relationship.Segment(connection: Connection, project: Project, capture: Capture, segmenter: Optional[Segmenter] = None, label: Optional[Label] = None, label_value: Optional[LabelValue] = None)

Base class for a label object.

delete() Response

Calls the REST API and deletes the object from the server.

insert() Response

Calls the REST API and inserts a metadata object onto the server using the local object’s properties.

refresh() Response

Calls the REST API and populates the local object’s properties from the server.

property sample_end: int

The index of the last sample of the label

property sample_start: int

The index of the first sample of the label

property segmenter: str

The index of the last sample of the label

update() Response

Calls the REST API and updates the object on the server.

property uuid: str

Auto generated unique identifier for the metadata object

class sensiml.datamanager.label_relationship.SegmentSet(connection: Connection, project: Project, capture: Capture, initialize_set: bool = True)

Base class for a collection of segments

property get_set_url

replace this with the url to call to pull down the set objects