Skip to main content

Classes

LearnApi

edgeimpulse_api.api.learn_api.LearnApi(
	api_client=None
)
Parameters
api_client=None

METHODS

anomaly_trained_features

edgeimpulse_api.api.learn_api.LearnApi.anomaly_trained_features(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	feature_ax1: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Feature axis 1')],
	feature_ax2: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Feature axis 2')],
	**kwargs
) ‑> edgeimpulse_api.models.anomaly_trained_features_response.AnomalyTrainedFeaturesResponse
Trained features Get a sample of trained features, this extracts a number of samples and their features.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
feature_ax1Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Feature axis 1')]
feature_ax2Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Feature axis 2')]
**kwargs
Returns
edgeimpulse_api.models.anomaly_trained_features_response.AnomalyTrainedFeaturesResponse

anomaly_trained_features_per_sample

edgeimpulse_api.api.learn_api.LearnApi.anomaly_trained_features_per_sample(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	sample_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Sample ID')],
	**kwargs
) ‑> edgeimpulse_api.models.anomaly_trained_features_response.AnomalyTrainedFeaturesResponse
Trained features for sample Get trained features for a single sample. This runs both the DSP prerequisites and the anomaly classifier.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
sample_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Sample ID')]
**kwargs
Returns
edgeimpulse_api.models.anomaly_trained_features_response.AnomalyTrainedFeaturesResponse

download_keras_data

edgeimpulse_api.api.learn_api.LearnApi.download_keras_data(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> str
Download Keras data export Download the data of an exported Keras block - needs to be exported via ‘exportKerasBlockData’ first
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
str

download_keras_export

edgeimpulse_api.api.learn_api.LearnApi.download_keras_export(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> str
Download Keras export Download an exported Keras block - needs to be exported via ‘exportKerasBlock’ first
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
str

download_learn_model

edgeimpulse_api.api.learn_api.LearnApi.download_learn_model(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	model_download_id: Annotated[str, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Model download ID, which can be obtained from the project information')],
	**kwargs
) ‑> str
Download trained model Download a trained model for a learning block. Depending on the block this can be a TensorFlow model, or the cluster centroids.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
model_download_idAnnotated[str, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Model download ID, which can be obtained from the project information')]
**kwargs
Returns
str

download_pretrained_model

edgeimpulse_api.api.learn_api.LearnApi.download_pretrained_model(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	pretrained_model_download_type: Annotated[str, Strict(strict=True)],
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	**kwargs
) ‑> str
Download pretrained model Download a pretrained model file
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
pretrained_model_download_typeAnnotated[str, Strict(strict=True)]
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
**kwargs
Returns
str

get_anomaly

edgeimpulse_api.api.learn_api.LearnApi.get_anomaly(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.anomaly_config_response.AnomalyConfigResponse
Anomaly information Get information about an anomaly block, such as its dependencies. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.anomaly_config_response.AnomalyConfigResponse

get_anomaly_metadata

edgeimpulse_api.api.learn_api.LearnApi.get_anomaly_metadata(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.anomaly_model_metadata_response.AnomalyModelMetadataResponse
Anomaly metadata Get metadata about a trained anomaly block. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.anomaly_model_metadata_response.AnomalyModelMetadataResponse

get_gmm_metadata

edgeimpulse_api.api.learn_api.LearnApi.get_gmm_metadata(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.anomaly_gmm_metadata_response.AnomalyGmmMetadataResponse
Anomaly GMM metadata Get raw model metadata of the Gaussian mixture model (GMM) for a trained anomaly block. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.anomaly_gmm_metadata_response.AnomalyGmmMetadataResponse

get_keras

edgeimpulse_api.api.learn_api.LearnApi.get_keras(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.keras_response.KerasResponse
Keras information Get information about a Keras block, such as its dependencies. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.keras_response.KerasResponse

get_keras_data_explorer_features

edgeimpulse_api.api.learn_api.LearnApi.get_keras_data_explorer_features(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.get_data_explorer_features_response.GetDataExplorerFeaturesResponse
Get data explorer features t-SNE2 output of the raw dataset using embeddings from this Keras block
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.get_data_explorer_features_response.GetDataExplorerFeaturesResponse

get_keras_metadata

edgeimpulse_api.api.learn_api.LearnApi.get_keras_metadata(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	exclude_labels: Annotated[Annotated[bool, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='If set to "true", the "labels" field is left empty (which can be big on e.g. regression projects).')] = None,
	**kwargs
) ‑> edgeimpulse_api.models.keras_model_metadata_response.KerasModelMetadataResponse
Keras metadata Get metadata about a trained Keras block. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
exclude_labelsAnnotated[Annotated[bool, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='If set to "true", the "labels" field is left empty (which can be big on e.g. regression projects).')] = None
**kwargs
Returns
edgeimpulse_api.models.keras_model_metadata_response.KerasModelMetadataResponse

get_learn_x_data

edgeimpulse_api.api.learn_api.LearnApi.get_learn_x_data(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> str
Download data Download the processed data for this learning block. This is data already processed by the signal processing blocks.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
str

get_learn_y_data

edgeimpulse_api.api.learn_api.LearnApi.get_learn_y_data(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> str
Download labels Download the labels for this learning block. This is data already processed by the signal processing blocks. Not all blocks support this function. If so, a GenericApiResponse is returned with an error message.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
str

get_pretrained_model_info

edgeimpulse_api.api.learn_api.LearnApi.get_pretrained_model_info(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	**kwargs
) ‑> edgeimpulse_api.models.get_pretrained_model_response.GetPretrainedModelResponse
Get pretrained model Receive info back about the earlier uploaded pretrained model (via uploadPretrainedModel) input/output tensors. If you want to deploy a pretrained model from the API, see startDeployPretrainedModelJob.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
**kwargs
Returns
edgeimpulse_api.models.get_pretrained_model_response.GetPretrainedModelResponse

profile_pretrained_model

edgeimpulse_api.api.learn_api.LearnApi.profile_pretrained_model(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	**kwargs
) ‑> edgeimpulse_api.models.start_job_response.StartJobResponse
Profile pretrained model Returns the latency, RAM and ROM used for the pretrained model - upload first via uploadPretrainedModel. This is using the project’s selected latency device. 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
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
**kwargs
Returns
edgeimpulse_api.models.start_job_response.StartJobResponse

save_pretrained_model_parameters

edgeimpulse_api.api.learn_api.LearnApi.save_pretrained_model_parameters(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	save_pretrained_model_request: edgeimpulse_api.models.save_pretrained_model_request.SavePretrainedModelRequest,
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	**kwargs
) ‑> edgeimpulse_api.models.generic_api_response.GenericApiResponse
Save parameters for pretrained model Save input / model configuration for a pretrained model. This overrides the current impulse. If you want to deploy a pretrained model from the API, see startDeployPretrainedModelJob.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
save_pretrained_model_requestedgeimpulse_api.models.save_pretrained_model_request.SavePretrainedModelRequest
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
**kwargs
Returns
edgeimpulse_api.models.generic_api_response.GenericApiResponse

set_anomaly

edgeimpulse_api.api.learn_api.LearnApi.set_anomaly(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	set_anomaly_parameter_request: edgeimpulse_api.models.set_anomaly_parameter_request.SetAnomalyParameterRequest,
	**kwargs
) ‑> edgeimpulse_api.models.generic_api_response.GenericApiResponse
Anomaly settings Configure the anomaly block, such as its minimum confidence score. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
set_anomaly_parameter_requestedgeimpulse_api.models.set_anomaly_parameter_request.SetAnomalyParameterRequest
**kwargs
Returns
edgeimpulse_api.models.generic_api_response.GenericApiResponse

set_keras

edgeimpulse_api.api.learn_api.LearnApi.set_keras(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	set_keras_parameter_request: edgeimpulse_api.models.set_keras_parameter_request.SetKerasParameterRequest,
	**kwargs
) ‑> edgeimpulse_api.models.generic_api_response.GenericApiResponse
Keras settings Configure the Keras block, such as its minimum confidence score. Use the impulse blocks to find the learnId.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
set_keras_parameter_requestedgeimpulse_api.models.set_keras_parameter_request.SetKerasParameterRequest
**kwargs
Returns
edgeimpulse_api.models.generic_api_response.GenericApiResponse

start_anomaly_profile_job

edgeimpulse_api.api.learn_api.LearnApi.start_anomaly_profile_job(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.generic_api_response.GenericApiResponse
Start a profile job for an anomaly learn block Starts an asynchronous profiling job, if there’s no profiling information for the currently selected latency device. Afterwards, re-fetch model metadata to get the profiling job IDs.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.generic_api_response.GenericApiResponse

start_keras_profile_job

edgeimpulse_api.api.learn_api.LearnApi.start_keras_profile_job(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	learn_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Learn Block ID, use the impulse functions to retrieve the ID')],
	**kwargs
) ‑> edgeimpulse_api.models.generic_api_response.GenericApiResponse
Start a profile job for a Keras learn block Starts an asynchronous profiling job, if there’s no profiling information for the currently selected latency device. Afterwards, re-fetch model metadata to get the profiling job IDs.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
learn_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Learn Block ID, use the impulse functions to retrieve the ID')]
**kwargs
Returns
edgeimpulse_api.models.generic_api_response.GenericApiResponse

test_pretrained_model

edgeimpulse_api.api.learn_api.LearnApi.test_pretrained_model(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	test_pretrained_model_request: edgeimpulse_api.models.test_pretrained_model_request.TestPretrainedModelRequest,
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	**kwargs
) ‑> edgeimpulse_api.models.test_pretrained_model_response.TestPretrainedModelResponse
Test pretrained model Test out a pretrained model (using raw features) - upload first via uploadPretrainedModel. If you want to deploy a pretrained model from the API, see startDeployPretrainedModelJob.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
test_pretrained_model_requestedgeimpulse_api.models.test_pretrained_model_request.TestPretrainedModelRequest
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
**kwargs
Returns
edgeimpulse_api.models.test_pretrained_model_response.TestPretrainedModelResponse

test_pretrained_model_images

edgeimpulse_api.api.learn_api.LearnApi.test_pretrained_model_images(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	test_pretrained_model_images_request: edgeimpulse_api.models.test_pretrained_model_images_request.TestPretrainedModelImagesRequest,
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	**kwargs
) ‑> edgeimpulse_api.models.test_pretrained_model_response.TestPretrainedModelResponse
Test pretrained model using image data Test out a pretrained model (using image data) - upload first via uploadPretrainedModel. If you want to deploy a pretrained model from the API, see startDeployPretrainedModelJob. This will transform raw image data (e.g. RGB to grayscale, resize) before classifying. To classify raw features, see testPretrainedModel.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
test_pretrained_model_images_requestedgeimpulse_api.models.test_pretrained_model_images_request.TestPretrainedModelImagesRequest
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
**kwargs
Returns
edgeimpulse_api.models.test_pretrained_model_response.TestPretrainedModelResponse

upload_pretrained_model

edgeimpulse_api.api.learn_api.LearnApi.upload_pretrained_model(
	self,
	project_id: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=Truedescription='Project ID')],
	model_file: Annotated[str, Strict(strict=True)],
	model_file_name: Annotated[str, Strict(strict=True)],
	model_file_type: Annotated[str, Strict(strict=True)],
	impulse_id: Annotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='Impulse ID. If this is unset then the default impulse is used.')] = None,
	representative_features: Annotated[str, Strict(strict=True)] | None = None,
	device: Annotated[Annotated[str, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=Truedescription='MCU used for calculating latency, query `latencyDevices` in `listProject` for a list of supported devices (and use the \\"mcu\\" property here). If this is kept empty then we\'ll show an overview of multiple devices.')] = None,
	override_input_shape: Annotated[List[Annotated[int, Strict(strict=True)]] | None, FieldInfo(annotation=NoneType, required=Truedescription="Optional for ONNX files: overrides the input shape of the model. This is highly suggested if the model has dynamic dimensions. If this field is not set, then all dynamic dimensions will be set to '1'.")] = None,
	**kwargs
) ‑> edgeimpulse_api.models.start_job_response.StartJobResponse
Upload a pretrained model Upload a pretrained model and receive info back about the input/output tensors. If you want to deploy a pretrained model from the API, see startDeployPretrainedModelJob.
Parameters
self
project_idAnnotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, description='Project ID')]
model_fileAnnotated[str, Strict(strict=True)]
model_file_nameAnnotated[str, Strict(strict=True)]
model_file_typeAnnotated[str, Strict(strict=True)]
impulse_idAnnotated[Annotated[int, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='Impulse ID. If this is unset then the default impulse is used.')] = None
representative_featuresAnnotated[str, Strict(strict=True)] | None = None
deviceAnnotated[Annotated[str, Strict(strict=True)] | None, FieldInfo(annotation=NoneType, required=True, description='MCU used for calculating latency, query latencyDevices in listProject for a list of supported devices (and use the \\"mcu\\" property here). If this is kept empty then we\'ll show an overview of multiple devices.')] = None
override_input_shapeAnnotated[List[Annotated[int, Strict(strict=True)]] | None, FieldInfo(annotation=NoneType, required=True, description="Optional for ONNX files
**kwargs
Returns
edgeimpulse_api.models.start_job_response.StartJobResponse