dsp_api

edgeimpulse_api v1.0.0

edgeimpulse_api.api.dsp_api module

class edgeimpulse_api.api.dsp_api.DSPApi(api_client=None)

Bases: object

clear_dsp_block(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Clear DSP block

Clear generated features for a DSP block (used in tests).

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

download_dsp_data(project_id: StrictInt, dsp_id: StrictInt, category: StrictStr, raw: Optional[StrictBool] = None, **kwargs)

Download DSP data

Download output from a DSP block over all data in the training set, already sliced in windows. In Numpy binary format.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • category (str) – Which of the three acquisition categories to download data from (required)

    • raw (bool) – Whether to download raw data or processed data. Processed data is the default.

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

  • Return type

    str

download_dsp_labels(project_id: StrictInt, dsp_id: StrictInt, category: StrictStr, **kwargs)

Download DSP labels

Download labels for a DSP block over all data in the training set, already sliced in windows.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • category (str) – Which of the three acquisition categories to download data from (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

  • Return type

    str

dsp_get_features_for_sample(project_id: StrictInt, dsp_id: StrictInt, sample_id: StrictInt, **kwargs)

Features for sample

Runs the DSP block against a sample. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and run the DSP function for every window that is extracted.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • sample_id (int) – Sample ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

dsp_sample_trained_features(project_id: StrictInt, dsp_id: StrictInt, feature_ax1: StrictInt, feature_ax2: StrictInt, feature_ax3: StrictInt, category: StrictStr, **kwargs)

Sample of trained features

Get a sample of trained features, this extracts a number of samples and their labels. Used to visualize the current training set.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • feature_ax1 (int) – Feature axis 1 (required)

    • feature_ax2 (int) – Feature axis 2 (required)

    • feature_ax3 (int) – Feature axis 3 (required)

    • category (str) – Which of the three acquisition categories to download data from (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_autotuner_results(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Get results from DSP autotuner

Get a set of parameters, found as a result of running the DSP autotuner.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_dsp_config(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Get config

Retrieve the configuration parameters for the DSP block. Use the impulse functions to retrieve all DSP blocks.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_dsp_feature_importance(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Feature importance

Retrieve the feature importance for a DSP block (only available for blocks where dimensionalityReduction is not enabled)

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_dsp_feature_labels(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Feature labels

Retrieve the names of the features the DSP block generates

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_dsp_metadata(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Get metadata

Retrieve the metadata from a generated DSP block.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_dsp_raw_sample(project_id: StrictInt, dsp_id: StrictInt, sample_id: StrictInt, limit_payload_values: Optional[StrictInt] = None, **kwargs)

Get raw sample

Get raw sample data, but with only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out. If you pass dspId = 0 this will return a raw graph without any processing.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • sample_id (int) – Sample ID (required)

    • limit_payload_values (int) – Limit the number of payload values in the response

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_dsp_sample_slice(project_id: StrictInt, dsp_id: StrictInt, sample_id: StrictInt, slice_start: StrictInt, slice_end: StrictInt, **kwargs)

Get raw sample (slice)

Get slice of raw sample data, but with only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • sample_id (int) – Sample ID (required)

    • slice_start (int) – Begin index of the slice (required)

    • slice_end (int) – End index of the slice (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

get_performance_all_variants(project_id: StrictInt, dsp_id: StrictInt, **kwargs)

Get DSP block performance for all latency devices

Get estimated performance (latency and RAM) for the DSP block, for all supported project latency devices.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

run_dsp_sample_slice(project_id: StrictInt, dsp_id: StrictInt, sample_id: StrictInt, slice_start: StrictInt, slice_end: StrictInt, dsp_run_request_without_features: DspRunRequestWithoutFeatures, **kwargs)

Get processed sample (slice)

Get slice of sample data, and run it through the DSP block. This only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • sample_id (int) – Sample ID (required)

    • slice_start (int) – Begin index of the slice (required)

    • slice_end (int) – End index of the slice (required)

    • dsp_run_request_without_features (DspRunRequestWithoutFeatures) – (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

run_dsp_sample_slice_read_only(project_id: StrictInt, dsp_id: StrictInt, sample_id: StrictInt, slice_start: StrictInt, slice_end: StrictInt, **kwargs)

Get processed sample (slice)

Get slice of sample data, and run it through the DSP block. This only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • sample_id (int) – Sample ID (required)

    • slice_start (int) – Begin index of the slice (required)

    • slice_end (int) – End index of the slice (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

set_dsp_config(project_id: StrictInt, dsp_id: StrictInt, dsp_config_request: DSPConfigRequest, **kwargs)

Set config

Set configuration parameters for the DSP block. Only values set in the body will be overwritten.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • dsp_config_request (DSPConfigRequest) – (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

start_profile_custom_dsp_block(project_id: StrictInt, dsp_id: StrictInt, dsp_run_request_without_features_read_only: DspRunRequestWithoutFeaturesReadOnly, **kwargs)

Profile custom DSP block

Returns performance characteristics for a custom DSP block (needs hasTfliteImplementation). Updates are streamed over the websocket API (or can be retrieved through the /stdout endpoint). Use getProfileTfliteJobResult to get the results when the job is completed.

  • Parameters

    • project_id (int) – Project ID (required)

    • dsp_id (int) – DSP Block ID, use the impulse functions to retrieve the ID (required)

    • dsp_run_request_without_features_read_only (DspRunRequestWithoutFeaturesReadOnly) – (required)

    • async_req (bool*, *optional) – Whether to execute the request asynchronously.

    • _preload_content (bool*, *optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

    • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • Returns

    Returns the result object. If the method is called asynchronously, returns the request thread.

  • Return type

    StartJobResponse

Last updated

Was this helpful?