Skip to content

frameworks.ultralytics.services.model.exporter

exporter

Classes:

Name Description
UltralyticsModelExporter

Exporter class for Ultralytics models.

UltralyticsModelExporter(model)

Bases: ModelExporter

Exporter class for Ultralytics models.

This class handles the export process for models trained using the Ultralytics framework. It supports exporting to formats such as ONNX and relocating the exported model to a specified path.

Parameters:

Name Type Description Default

model

UltralyticsModel

The model instance containing metadata and paths required for export.

required

Methods:

Name Description
export_model

Exports the model to the specified format and moves the file to a target directory.

save_model_to_experiment

Save exported model to a Picsellia experiment.

save_model_to_model_version

Save exported model to a Picsellia model version.

Attributes:

Name Type Description
model UltralyticsModel

model = model instance-attribute

export_model(exported_model_destination_path, export_format, hyperparameters)

Exports the model to the specified format and moves the file to a target directory.

Parameters:

Name Type Description Default
exported_model_destination_path
str

Path to save the exported model.

required
export_format
str

Export format (e.g., 'onnx').

required
hyperparameters
UltralyticsHyperParameters

Export configuration including image size.

required

save_model_to_experiment(experiment, exported_weights_path, exported_weights_name)

Save exported model to a Picsellia experiment.

Parameters:

Name Type Description Default
experiment
Experiment

Target experiment.

required
exported_weights_path
str

Path to exported weights directory.

required
exported_weights_name
str

File name to use in Picsellia.

required

save_model_to_model_version(model_version, exported_weights_path, exported_weights_name)

Save exported model to a Picsellia model version.

Parameters:

Name Type Description Default
model_version
ModelVersion

Target model version.

required
exported_weights_path
str

Path to exported weights directory.

required
exported_weights_name
str

File name to use in Picsellia.

required