DataAcquisition

class edgeimpulse.data.sample_type.DataAcquisition(
		protected: edgeimpulse.data.sample_type.Protected,
		payload: edgeimpulse.data.sample_type.Payload,
		signature: str | None = None
)
Wrapper class for the Edge Impulse data acquisition format. See here for more information: https://docs.edgeimpulse.com/reference/data-acquisition-format. Parameters
  • protected: edgeimpulse.data.sample_type.Protected
  • payload: edgeimpulse.data.sample_type.Payload
  • signature: str | None = None
Instance variables
  • payload: edgeimpulse.data.sample_type.Payload The type of the None singleton.
  • protected: edgeimpulse.data.sample_type.Protected The type of the None singleton.
  • signature: str | None The type of the None singleton.

Payload

class edgeimpulse.data.sample_type.Payload(
		device_type: str,
		sensors: List[edgeimpulse.data.sample_type.Sensor],
		values: List[List[float]],
		interval_ms: int | None = 0,
		device_name: str | None = None
)
Wrapper class for the sensor data. Information about the data acquisition format can be found here: https://docs.edgeimpulse.com/reference/data-acquisition-format. Parameters
  • device_type: str
  • sensors: List[edgeimpulse.data.sample_type.Sensor]
  • values: List[List[float]]
  • interval_ms: int | None = 0
  • device_name: str | None = None
Instance variables
  • device_name: str | None The type of the None singleton.
  • device_type: str The type of the None singleton.
  • interval_ms: int | None The type of the None singleton.
  • sensors: List[edgeimpulse.data.sample_type.Sensor] The type of the None singleton.
  • values: List[List[float]] The type of the None singleton.

Protected

class edgeimpulse.data.sample_type.Protected(
		ver: str = 'v1',
		alg: Literal['HS256''none'= 'none',
		iat: int | None = None
)
Wrapper class for information about the signature format. More information can be found here: https://docs.edgeimpulse.com/reference/data-acquisition-format. Parameters
  • ver: str = ‘v1’
  • alg: Literal[‘HS256’, ‘none’] = ‘none’
  • iat: int | None = None
Instance variables
  • alg: Literal['HS256', 'none'] The type of the None singleton.
  • iat: int | None The type of the None singleton.
  • ver: str The type of the None singleton.

Sample

class edgeimpulse.data.sample_type.Sample(
		data: io.BufferedIOBase | _io.StringIO | str,
		filename: str | None = None,
		category: Literal['training''testing''anomaly''split'| None = 'split',
		label: str | None = None,
		bounding_boxes: List[dict| None = None,
		metadata: dict | None = None,
		sample_id: int | None = None,
		structured_labels: List[dict| None = None
)
Wrapper class for sample data, labels, and associated metadata. Sample data should be contained in a file or file-like object, for example, as the return from open(..., "rb"). The upload_samples() function expects Sample objects as input. Parameters
  • data: io.BufferedIOBase | _io.StringIO | str
  • filename: str | None = None
  • category: Literal[‘training’, ‘testing’, ‘anomaly’, ‘split’] | None = ‘split’
  • label: str | None = None
  • bounding_boxes: List[dict] | None = None
  • metadata: dict | None = None
  • sample_id: int | None = None
  • structured_labels: List[dict] | None = None
Instance variables
  • bounding_boxes: List[dict] | None The type of the None singleton.
  • category: Literal['training', 'testing', 'anomaly', 'split'] | None The type of the None singleton.
  • data: io.BufferedIOBase | _io.StringIO | str The type of the None singleton.
  • filename: str | None The type of the None singleton.
  • label: str | None The type of the None singleton.
  • metadata: dict | None The type of the None singleton.
  • sample_id: int | None The type of the None singleton.
  • structured_labels: List[dict] | None The type of the None singleton.

SampleInfo

class edgeimpulse.data.sample_type.SampleInfo(
		sample_id: int | None = None,
		filename: str | None = None,
		category: str | None = None,
		label: str | None = None
)
Wrapper for the response from the Edge Impulse ingestion service when retrieving sample information. Parameters
  • sample_id: int | None = None
  • filename: str | None = None
  • category: str | None = None
  • label: str | None = None
Instance variables
  • category: str | None The type of the None singleton.
  • filename: str | None The type of the None singleton.
  • label: str | None The type of the None singleton.
  • sample_id: int | None The type of the None singleton.

SampleIngestionResponse

class edgeimpulse.data.sample_type.SampleIngestionResponse(
		sample: edgeimpulse.data.sample_type.Sample,
		response: dict
)
Wrapper for the response from the Edge Impulse ingestion service when uploading a sample along with the sample that was uploaded. Parameters
  • sample: edgeimpulse.data.sample_type.Sample
  • response: dict

Sensor

class edgeimpulse.data.sample_type.Sensor(
		name: str,
		units: Literal['m''kg''g''s''A''K''cd''mol''Hz''rad''sr''N''Pa''J''W''C''V''F''Ohm''S''Wb''T''H''Cel''lm''lx''Bq''Gy''Sv''kat''m2''m3''l''m/s''m/s2''m3/s''l/s''W/m2''cd/m2''bit''bit/s''lat''lon''pH''dB''dBW''Bspl''count''/''%''%RH''%EL''EL''1/s''1/min''beat/min''beats''S/m''B''VA''VAs''var''vars''J/m''kg/m3''deg''NTU''rgba'= 'm/s'
)
Represents a sensor in the Edge Impulse data acquisition format. Note: The units must comply with the SenML units list: https://www.iana.org/assignments/senml/senml.xhtml Parameters
  • name: str
  • units: Literal[‘m’, ‘kg’, ‘g’, ‘s’, ‘A’, ‘K’, ‘cd’, ‘mol’, ‘Hz’, ‘rad’, ‘sr’, ‘N’, ‘Pa’, ‘J’, ‘W’, ‘C’, ‘V’, ‘F’, ‘Ohm’, ‘S’, ‘Wb’, ‘T’, ‘H’, ‘Cel’, ‘lm’, ‘lx’, ‘Bq’, ‘Gy’, ‘Sv’, ‘kat’, ‘m2’, ‘m3’, ‘l’, ‘m/s’, ‘m/s2’, ‘m3/s’, ‘l/s’, ‘W/m2’, ‘cd/m2’, ‘bit’, ‘bit/s’, ‘lat’, ‘lon’, ‘pH’, ‘dB’, ‘dBW’, ‘Bspl’, ‘count’, ’/’, ’%’, ‘%RH’, ‘%EL’, ‘EL’, ‘1/s’, ‘1/min’, ‘beat/min’, ‘beats’, ‘S/m’, ‘B’, ‘VA’, ‘VAs’, ‘var’, ‘vars’, ‘J/m’, ‘kg/m3’, ‘deg’, ‘NTU’, ‘rgba’] = ‘m/s’
Instance variables
  • name: str The type of the None singleton.
  • units: Literal['m', 'kg', 'g', 's', 'A', 'K', 'cd', 'mol', 'Hz', 'rad', 'sr', 'N', 'Pa', 'J', 'W', 'C', 'V', 'F', 'Ohm', 'S', 'Wb', 'T', 'H', 'Cel', 'lm', 'lx', 'Bq', 'Gy', 'Sv', 'kat', 'm2', 'm3', 'l', 'm/s', 'm/s2', 'm3/s', 'l/s', 'W/m2', 'cd/m2', 'bit', 'bit/s', 'lat', 'lon', 'pH', 'dB', 'dBW', 'Bspl', 'count', '/', '%', '%RH', '%EL', 'EL', '1/s', '1/min', 'beat/min', 'beats', 'S/m', 'B', 'VA', 'VAs', 'var', 'vars', 'J/m', 'kg/m3', 'deg', 'NTU', 'rgba'] The type of the None singleton.

UploadSamplesResponse

class edgeimpulse.data.sample_type.UploadSamplesResponse(
		successes: List[edgeimpulse.data.sample_type.SampleIngestionResponse],
		fails: List[edgeimpulse.data.sample_type.SampleIngestionResponse]
)
Response from the Edge Impulse server when uploading multiple samples. Parameters
  • successes: List[edgeimpulse.data.sample_type.SampleIngestionResponse]
  • fails: List[edgeimpulse.data.sample_type.SampleIngestionResponse]

Methods

extend

edgeimpulse.data.sample_type.extend(
		self,
		successes: List[edgeimpulse.data.sample_type.SampleIngestionResponse],
		fails: List[edgeimpulse.data.sample_type.SampleIngestionResponse]
)
Add new responses to the existing responses. Parameters
  • self
  • successes: List[edgeimpulse.data.sample_type.SampleIngestionResponse]
  • fails: List[edgeimpulse.data.sample_type.SampleIngestionResponse]