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, project, capture, segmenter=None, label=None, label_value=None)

Base class for a label object.

delete()

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

insert()

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

refresh()

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

property sample_end

The index of the last sample of the label

property sample_start

The index of the first sample of the label

property segmenter

The index of the last sample of the label

update()

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

property uuid

Auto generated unique identifier for the metadata object

class sensiml.datamanager.label_relationship.SegmentSet(connection, project, capture, initialize_set=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