sima.operations

Attributes

logger

Classes

ColorConversionCodes

Generic enumeration.

SimaOperation

SimaOperationCVU

SimaGenericPreproc

SimaQuantTess

SimaDetessDequant

SimaModelRunner

SimaBoxRender

A class for rendering bounding boxes on images using ARM A65 Core.

SimaBoxDecode

Functions

get_json(config,Β name)

set_log_level(level)

Set the log level for the PePPi component.

resize(β†’Β numpy.ndarray)

Resize image to the specified width and height using EV74 kernel.

cvtColor(β†’Β numpy.ndarray)

Convert the color space of an image using the EV74's Transform Color Conversion kernel.

Module Contents

sima.operations.logger[source]
class sima.operations.ColorConversionCodes[source]

Generic enumeration.

Derive from this class to define new enumerations.

COLOR_BGRTORGB = 'SIMA_COLOR_BGRTORGB'[source]
COLOR_RGBTOBGR = 'SIMA_COLOR_RGBTOBGR'[source]
COLOR_BGRTOGRAY = 'SIMA_COLOR_BGRTOGRAY'[source]
COLOR_RGBTOGRAY = 'SIMA_COLOR_RGBTOGRAY'[source]
COLOR_IYUVTOBGR = 'SIMA_COLOR_IYUVTOBGR'[source]
COLOR_IYUVTONV12 = 'SIMA_COLOR_IYUVTONV12'[source]
COLOR_NV12TOBGR = 'SIMA_COLOR_NV12TOBGR'[source]
COLOR_BGRTONV12 = 'SIMA_COLOR_BGRTONV12'[source]
COLOR_RGBTONV12 = 'SIMA_COLOR_RGBTONV12'[source]
COLOR_NV12TORGB = 'SIMA_COLOR_NV12TORGB'[source]
class sima.operations.SimaOperation(name: str, configuration: dict)[source]
configuration[source]
name[source]
configure(config: dict) None[source]
abstract run(tensor: numpy.ndarray) numpy.ndarray[source]

Abstract method for executing the operation.

class sima.operations.SimaOperationCVU(name: str, configuration: dict)[source]
offset = None[source]
cvu_obj = None[source]
configure(config: dict) None[source]

Configure CVU-specific settings.

run(tensor: numpy.ndarray) numpy.ndarray[source]

Abstract method for executing the operation.

class sima.operations.SimaGenericPreproc(parser_obj)[source]
run(tensor: numpy.ndarray) numpy.ndarray[source]

Run the CVU operation.

class sima.operations.SimaQuantTess(parser_obj)[source]
run(tensor: numpy.ndarray) numpy.ndarray[source]

Run the CVU operation.

class sima.operations.SimaDetessDequant(parser_obj)[source]
tensor_shapes[source]
reshape_ev_buffer(tensor: numpy.ndarray) List[numpy.ndarray][source]

Reshape flattened EV buffer to list of tensors

run(tensor: numpy.ndarray) numpy.ndarray[source]

Abstract method for executing the operation.

class sima.operations.SimaModelRunner(parser_obj)[source]
parser_obj[source]
configure(config: dict) None[source]
run(tensor: numpy.ndarray) numpy.ndarray[source]

Abstract method for executing the operation.

class sima.operations.SimaBoxRender[source]

A class for rendering bounding boxes on images using ARM A65 Core.

apu_obj = None[source]
classmethod render(image: numpy.ndarray, boxes: spy.defines.BoundingBox, frame_width: int, frame_height: int, labelfile: str) numpy.ndarray[source]

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)[source]
parser_obj[source]
apu_obj[source]
configure(config: dict) None[source]
run(tensor: numpy.ndarray) numpy.ndarray[source]

Abstract method for executing the operation.

sima.operations.get_json(config, name)[source]
sima.operations.set_log_level(level: spy.logger.LogLevel)[source]

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[source]

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[source]

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