otx.api.usecases.adapters.model_adapter#

This module define a module to adapt model weights from a data source.

Classes

ExportableCodeAdapter(data_source)

Adapter intended to lazily fetch raw exportable code data from a given data source.

IDataSource()

Class that holds a combination of both a repo and a filename which can be used to fetch data.

ModelAdapter(data_source)

The ModelAdapter is an adapter is intended to lazily fetch its binary data from a given data source.

class otx.api.usecases.adapters.model_adapter.ExportableCodeAdapter(data_source: IDataSource | bytes)[source]#

Bases: ModelAdapter

Adapter intended to lazily fetch raw exportable code data from a given data source.

class otx.api.usecases.adapters.model_adapter.IDataSource[source]#

Bases: object

Class that holds a combination of both a repo and a filename which can be used to fetch data.

abstract property data#

Returns the data of the source.

class otx.api.usecases.adapters.model_adapter.ModelAdapter(data_source: IDataSource | bytes)[source]#

Bases: object

The ModelAdapter is an adapter is intended to lazily fetch its binary data from a given data source.

property data#

Returns the data of the Model.

property data_source#

Returns the data source of the adapter.

property from_file_storage: bool#

Returns if the ModelAdapters data comes from the file storage or not.

This is used in the model repo to know if the data of the model should be saved or not.