sima.operationsο
Attributesο
Classesο
Generic enumeration. |
|
A class for rendering bounding boxes on images using ARM A65 Core. |
|
Functionsο
|
|
|
Set the log level for the PePPi component. |
|
Resize image to the specified width and height using EV74 kernel. |
|
Convert the color space of an image using the EV74's Transform Color Conversion kernel. |
|
Module Contentsο
- sima.operations.loggerο
- class sima.operations.ColorConversionCodesο
Generic enumeration.
Derive from this class to define new enumerations.
- COLOR_BGRTORGB = 'SIMA_COLOR_BGRTORGB'ο
- COLOR_RGBTOBGR = 'SIMA_COLOR_RGBTOBGR'ο
- COLOR_BGRTOGRAY = 'SIMA_COLOR_BGRTOGRAY'ο
- COLOR_RGBTOGRAY = 'SIMA_COLOR_RGBTOGRAY'ο
- COLOR_IYUVTOBGR = 'SIMA_COLOR_IYUVTOBGR'ο
- COLOR_IYUVTONV12 = 'SIMA_COLOR_IYUVTONV12'ο
- COLOR_NV12TOBGR = 'SIMA_COLOR_NV12TOBGR'ο
- COLOR_BGRTONV12 = 'SIMA_COLOR_BGRTONV12'ο
- COLOR_RGBTONV12 = 'SIMA_COLOR_RGBTONV12'ο
- COLOR_NV12TORGB = 'SIMA_COLOR_NV12TORGB'ο
- class sima.operations.SimaOperation(name: str, configuration: dict)ο
- configurationο
- nameο
- configure(config: dict) Noneο
- abstract run(tensor: numpy.ndarray) numpy.ndarrayο
Abstract method for executing the operation.
- class sima.operations.SimaOperationCVU(name: str, configuration: dict)ο
- offset = Noneο
- cvu_obj = Noneο
- configure(config: dict) Noneο
Configure CVU-specific settings.
- run(tensor: numpy.ndarray) numpy.ndarrayο
Abstract method for executing the operation.
- class sima.operations.SimaGenericPreproc(parser_obj)ο
- run(tensor: numpy.ndarray) numpy.ndarrayο
Run the CVU operation.
- class sima.operations.SimaQuantTess(parser_obj)ο
- run(tensor: numpy.ndarray) numpy.ndarrayο
Run the CVU operation.
- class sima.operations.SimaDetessDequant(parser_obj)ο
- tensor_shapesο
- reshape_ev_buffer(tensor: numpy.ndarray) List[numpy.ndarray]ο
Reshape flattened EV buffer to list of tensors
- run(tensor: numpy.ndarray) numpy.ndarrayο
Abstract method for executing the operation.
- class sima.operations.SimaModelRunner(parser_obj)ο
- parser_objο
- configure(config: dict) Noneο
- run(tensor: numpy.ndarray) numpy.ndarrayο
Abstract method for executing the operation.
- class sima.operations.SimaBoxRenderο
A class for rendering bounding boxes on images using ARM A65 Core.
- apu_obj = Noneο
- classmethod render(image: numpy.ndarray, boxes: spy.defines.BoundingBox, frame_width: int, frame_height: int, labelfile: str) numpy.ndarrayο
Renders bounding boxes and labels on the given image.
- Parameters:
image (np.ndarray) β Input image.
boxes (list[BoundingBox]) β List of bounding boxes with attributes (_x, _y, _w, _h, _class_id).
frame_height (int) β Height of the frame.
frame_width (int) β Width of the frame.
label_map_file (str) β Path to the label map file (used only for first-time initialization).
- Returns:
Image with rendered bounding boxes and labels.
- Return type:
np.ndarray
- class sima.operations.SimaBoxDecode(parser_obj)ο
- parser_objο
- apu_objο
- configure(config: dict) Noneο
- run(tensor: numpy.ndarray) numpy.ndarrayο
Abstract method for executing the operation.
- sima.operations.get_json(config, name)ο
- sima.operations.set_log_level(level: spy.logger.LogLevel)ο
Set the log level for the PePPi component.
This function configures the verbosity of logging for PePPi, controlling which log messages are recorded. Logs are written to the file located at:
/var/log/simaai_peppi.log.- Parameters:
level (LogLevel) β The desired logging level (e.g., DEBUG, INFO, WARNING, ERROR).
- sima.operations.resize(image, target_width, target_height) numpy.ndarrayο
Resize image to the specified width and height using EV74 kernel.
- Parameters:
image (numpy.ndarray) β The input image as a NumPy array.
target_width (int) β The desired width of the resized image.
target_height (int) β The desired height of the resized image.
- Returns:
The resized image as a NumPy array.
- Return type:
numpy.ndarray
- sima.operations.cvtColor(image, width: int, height: int, color_type: ColorConversionCodes) numpy.ndarrayο
Convert the color space of an image using the EV74βs Transform Color Conversion kernel.
This operation is optimized for performance and leverages hardware acceleration for color conversion.
- Parameters:
image (numpy.ndarray) β The input image as a NumPy array.
width (int) β The width of the image.
height (int) β The height of the image.
color_type (ColorConversionCodes) β The color conversion code indicating the desired color transformation.
- Available color conversion options:
sima.COLOR_BGRTORGB
sima.COLOR_RGBTOBGR
sima.COLOR_BGRTOGRAY
sima.COLOR_RGBTOGRAY
sima.COLOR_IYUVTOBGR
sima.COLOR_IYUVTONV12
sima.COLOR_NV12TOBGR
sima.COLOR_BGRTONV12
sima.COLOR_RGBTONV12
sima.COLOR_NV12TORGB
- Returns:
The image with the converted color space.
- Return type:
numpy.ndarray
- sima.operations.nv12_to_bgr(nv12_data, width, height)ο