Sample
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
-
bounding_boxes: List[dict] | NoneThe type of the None singleton. -
category: Literal['training', 'testing', 'anomaly', 'split'] | NoneThe type of the None singleton. -
data: io.BufferedIOBase | _io.StringIO | strThe type of the None singleton. -
filename: str | NoneThe type of the None singleton. -
label: str | NoneThe type of the None singleton. -
metadata: dict | NoneThe type of the None singleton. -
sample_id: int | NoneThe type of the None singleton. -
structured_labels: List[dict] | NoneThe type of the None singleton.
delete_all_samples
None, all samples in the project are deleted.
Parameters
- category: str | None = None
- api_key: str | None = None
- timeout_sec: float | None = None
delete_sample_by_id
- sample_id: int
- api_key: str | None = None
- timeout_sec: float | None = None
delete_samples_by_filename
filename argument must not include the original extension. For example,
if you uploaded a file named my-image.01.png, you must provide the filename as
my-image.01.
Parameters
- filename: str
- category: str | None = None
- api_key: str | None = None
- timeout_sec: float | None = None
download_samples_by_ids
DownloadSample object, which contains the raw data in
a BytesIO object along with associated metadata.
Important! All time series data is returned as a JSON file (in BytesIO format)
with a timestamp column. This includes files originally uploaded as CSV, JSON, and
CBOR. Edge Impulse Studio removes the timestamp column from any uploaded CSV
files and computes an estimated sample rate. The timestamps are computed based on
the sample rate, will always start at 0, and will be in milliseconds. These
timestamps may not be the same as the original timestamps in the uploaded file.
Parameters
- sample_ids: int | List[int]
- api_key: str | None = None
- timeout_sec: float | None = None
- max_workers: int | None = None
- show_progress: bool | None = False
- pool_maxsize: int | None = 20
- pool_connections: int | None = 20
get_filename_by_id
- sample_id: int
- api_key: str | None = None
- timeout_sec: float | None = None
get_sample_ids
my-image.01.png, it will be stored in your project with
a hash such as my-image.01.png.4f262n1b.json. To find the ID(s) that match this
sample, you must provide the argument filename=my-image.01. Notice the lack of
extension and hash.
Because of the potential for multiple samples (i.e., different sample IDs) with the
same filename, we recommend providing unique filenames for your samples when
uploading.
Parameters
- filename: str | None = None
- category: str | None = None
- labels: str | None = None
- api_key: str | None = None
- num_workers: int | None = 4
- timeout_sec: float | None = None
infer_category_and_label_from_filename
my-dataset/training/wave.1.cbor where wave is the label and training is the category.
It checks if there is training, testing or anomaly in the filename to determine the sample category.
Parameters
- sample: edgeimpulse.data.sample_type.Sample
- file: str
numpy_timeseries_to_sample
- values
- sensors: List[edgeimpulse.data.sample_type.Sensor]
- sample_rate_ms: int
pandas_dataframe_to_sample
- More than one row
- A sample rate or an index from which the sample rate can be inferred
- Therefore must be monotonically increasing
- And int or a date
- df
- sample_rate_ms: int | None = None
- label: str | None = None
- filename: str | None = None
- axis_columns: List[str] | None = None
- metadata: dict | None = None
- label_col: str | None = None
- category: Literal[‘training’, ‘testing’, ‘split’] = ‘split’
stream_samples_by_ids
- sample_ids: int | Sequence[int]
- api_key: str | None = None
- timeout_sec: float | None = None
- max_workers: int | None = None
- show_progress: bool | None = False
- pool_maxsize: int | None = 20
- pool_connections: int | None = 20
upload_directory
- directory: str
- category: str | None = None
- label: str | None = None
- metadata: dict | None = None
- transform: <built-in function callable> | None = None
- allow_duplicates: bool | None = False
- show_progress: bool | None = False
- batch_size: int | None = 1024
upload_exported_dataset
info.labels information.
Use this when you’ve exported your data in the studio, via the export functionality.
Parameters
- directory: str
- transform: <built-in function callable> | None = None
- allow_duplicates: bool | None = False
- show_progress: bool | None = False
- batch_size: int | None = 1024
upload_numpy
- data
- labels: List[str]
- sensors: List[edgeimpulse.data.sample_type.Sensor]
- sample_rate_ms: int
- metadata: dict | None = None
- category: Literal[‘training’, ‘testing’, ‘split’, ‘anomaly’] = ‘split’
upload_pandas_dataframe
- df
- feature_cols: List[str]
- label_col: str | None = None
- category_col: str | None = None
- metadata_cols: List[str] | None = None
upload_pandas_dataframe_wide
- df
- sample_rate_ms: int
- data_col_start: int | None = None
- label_col: str | None = None
- category_col: str | None = None
- metadata_cols: List[str] | None = None
- data_col_length: int | None = None
- data_axis_cols: List[str] | None = None
upload_pandas_dataframe_with_group
group_by in order to detect what timeseries value belongs
to which sample.
Parameters
- df
- timestamp_col: str
- group_by: str
- feature_cols: List[str]
- label_col: str | None = None
- category_col: str | None = None
- metadata_cols: List[str] | None = None
upload_pandas_sample
- df
- label: str | None = None
- sample_rate_ms: int | None = None
- filename: str | None = None
- axis_columns: List[str] | None = None
- metadata: dict | None = None
- label_col: str | None = None
- category: Literal[‘training’, ‘testing’, ‘split’] = ‘split’
upload_plain_directory
- directory: str
- category: str | None = None
- label: str | None = None
- metadata: dict | None = None
- transform: <built-in function callable> | None = None
- allow_duplicates: bool | None = False
- show_progress: bool | None = False
- batch_size: int | None = 1024
upload_samples
Sample object, which contains metadata about that sample.
Give this function a single Sample or a List of Sample objects to upload to your
project. The data field of the Sample must be a raw binary stream, such as a BufferedIOBase
object (which you can create with the open(..., "rb") function).
Parameters
- samples: edgeimpulse.data.sample_type.Sample | List[edgeimpulse.data.sample_type.Sample]
- allow_duplicates: bool | None = False
- api_key: str | None = None
- timeout_sec: float | None = None
- max_workers: int | None = None
- show_progress: bool | None = False
- pool_maxsize: int | None = 20
- pool_connections: int | None = 20
