sima.mini_pipeline_base

Attributes

logger

Classes

MLSoCSession

A class for interacting with the MLSoC for model inference.

Functions

process_pipeline_tar(tar_file,Β pipeline,Β modelname)

Extracts a tar.gz file, processes it, and moves specific files to a target directory.

Module Contents

sima.mini_pipeline_base.logger[source]
sima.mini_pipeline_base.process_pipeline_tar(tar_file, pipeline, modelname)[source]

Extracts a tar.gz file, processes it, and moves specific files to a target directory.

Parameters:
  • tar_file (str) – Path to the tar.gz file.

  • pipeline (str) – Name of the application

  • modelname (str) – Name of the MLSocSession:Model

Raises:
  • FileNotFoundError – If the tar.gz file is not found.

  • ValueError – If required files (.lm or .elf, and a valid .json) are not found in the archive.

  • RuntimeError – If any error occurs during extraction or file processing.

class sima.mini_pipeline_base.MLSoCSession(model_file: str, pipeline: str, frame_width: int, frame_height: int, session_name: str = 'model1', ev_preproc=True)[source]

A class for interacting with the MLSoC for model inference.

pipeline[source]
session_name = 'model1'[source]
session_id = '_________Pipeline: Uninferable| Model: model1_________'[source]
ev_preproc = True[source]
parser_obj[source]
model_file[source]
tensor_shapes[source]
create_plugin(plugin_class)[source]
configure(model_external_params) bool[source]

Configures EV74, MLA components with external model parameters

Parameters:

model_external_params (dict) – A dictionary containing external parameters for configuring the model and related components.

a65_preprocess(in_frame: numpy.ndarray) numpy.ndarray[source]
preprocess(in_frame: numpy.ndarray) numpy.ndarray[source]

Preprocesses the input frame for model inference based on the EV74 configuration

Parameters:

in_frame (np.ndarray) – The input frame as a NumPy array.

Returns:

The preprocessed frame ready for model inference.

Return type:

np.ndarray

run_model(frame: numpy.ndarray) numpy.ndarray | List[numpy.ndarray][source]

Runs the model inference (Preprocess, MLA, and Postprocess) on a given frame.

For the following models, the output is from SimaBoxDecode:

  • centernet

  • yolo

  • detr

  • effdet

Parameters:

frame (np.ndarray) – Input frame as a NumPy array.

Returns:

The output tensor after running the model and applying the appropriate postprocessing.
  • For the models mentioned above, the output is from SimaBoxDecode containing bounding boxes.

  • For other models, the output is from Detess Dequant.

Return type:

np.ndarray

set_log_level(level: spy.logger.LogLevel)[source]
get_configs()[source]
get_inference_resolution()[source]
release()[source]