sima.mini_pipeline_baseο
Attributesο
Classesο
A class for interacting with the MLSoC for model inference. |
Functionsο
|
Extracts a tar.gz file, processes it, and moves specific files to a target directory. |
Module Contentsο
- 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.
- 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.
- 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