Get Compressed Models

get_compressed_models(self, model_id: str) → List[netspresso.compressor.core.model.CompressedModel]

Get the list of compressed models for a given model ID.

Parameters

model_id (str) – The ID of the model.

Raises

e – If an error occurs while getting the compressed model list.

Returns

The list of compressed models for a given model ID.

Return type

List[CompressedModel]

Details of Returns

class CompressedModel(model_id: str, model_name: str, task: str, framework: str, model_size: float, flops: float, trainable_parameters: float, non_trainable_parameters: float, number_of_layers: int, input_shapes: List[netspresso.compressor.core.model.InputShape] = <factory>, compression_id: str = '', original_model_id: str = '')[source]

Bases: netspresso.compressor.core.model.Model

Represents a compressed model.

compression_id

The ID of the compression.

Type

str

original_model_id

The ID of the uploaded model.

Type

str

Example

from netspresso.compressor import ModelCompressor


compressor = ModelCompressor(email="YOUR_EMAIL", password="YOUR_PASSWORD")
compressed_models = compressor.get_compressed_models(model_id="YOUR_UPLOADED_MODEL_ID")

Output

>>> compressed_models
[CompressedModel(
    model_id="8cbd8b0c-68ca-42ae-b84b-921e7462ba88",
    model_name="YOUR_COMPRESSED_MODEL_NAME",
    task="image_classification",
    framework="tensorflow_keras",
    input_shapes=[InputShape(batch=1, channel=3, dimension=[32, 32])],
    model_size=2.9439,
    flops=24.1811,
    trainable_parameters=0.6933,
    non_trainable_parameters=0.01,
    number_of_layers=0,
    compression_id="ce584e7f-b76e-43cc-83fe-d140fe476a58",
    original_model_id="YOUR_UPLOADED_MODEL_ID"
)]