Skip to content

Core AI SDK Toolchain

AidLite SDK (AI Inference Acceleration)

AidLite SDK is APLUX's unified AI inference framework. It wraps the Qualcomm QNN backend, supports heterogeneous CPU/GPU/NPU acceleration, and provides unified Python/C++ APIs.

Installation and Verification

bash
# 1. Download the corresponding AidLite SDK package from the "Resource Download Center"
# 2. Upload it to /home/aidlux on A8625MY1
# 3. Extract and install
tar -xzf aidlite-sdk-ubuntu22.04-qnn236.tar.gz
cd aidlite-sdk
sudo ./install.sh
# 4. Verify installation
python3 -c "import aidlite; print(aidlite.get_library_version())"  # C++ library version
python3 -c "import aidlite; print(aidlite.get_py_library_version())"  # Python library version

Core Acceleration Types

Acceleration TypeDescriptionTypical Scenario
TYPE_CPUGeneric CPU accelerationDebugging, lightweight models
TYPE_GPUGeneric GPU accelerationImage processing, floating-point models
TYPE_DSPQualcomm DSP/NPU accelerationQuantized models, high-performance inference (recommended)

Standard Inference Workflow (Python Example)

python
import aidlite
import cv2
import numpy as np

# 1. Create model instance
model = aidlite.Model.create_instance(model_path="./yolov5s.qnn236.bin")
if model is None:
    print("Failed to load model")
    exit(-1)

# 2. Set model properties
input_shapes = [[1, 640, 640, 3]]
output_shapes = [[1, 25200, 85]]
model.set_model_properties(
    input_shapes=input_shapes,
    input_data_type=aidlite.DataType.TYPE_FLOAT32,
    output_shapes=output_shapes,
    output_data_type=aidlite.DataType.TYPE_FLOAT32
)

# 3. Create runtime config
config = aidlite.Config.create_instance()
config.accelerate_type = aidlite.AccelerateType.TYPE_DSP  # Use NPU acceleration
config.framework_type = aidlite.FrameworkType.TYPE_QNN
config.number_of_threads = 4

# 4. Initialize inference engine
ret = model.init(config)
if ret != 0:
    print("Failed to initialize inference engine")
    exit(-1)

# 5. Run inference
img = cv2.imread("test.jpg")
img = cv2.resize(img, (640, 640))
img = img.astype(np.float32) / 255.0
input_data = np.expand_dims(img, axis=0)

outputs = model.run(input_data)
print("Inference output shape:", outputs[0].shape)

AidStream SDK (Streaming Media Processing)

AidStream SDK is a pipeline-based streaming toolkit supporting hardware-accelerated video encode/decode, streaming in/out, and storage, designed for AI video analytics.

Core Features

  • Supports multiple input sources such as RTSP (H.264/H.265), files, and USB/MIPI cameras
  • Supports hardware-accelerated video encode/decode to reduce CPU usage
  • Seamlessly integrates with AidLite SDK for full-chain acceleration from video capture to preprocessing, AI inference, and output

Simple Pipeline Example

python
import aidstream

# Create pipeline: USB camera capture -> H.264 encode -> RTSP streaming
pipeline = aidstream.Pipeline()
pipeline.add_source("usb_cam", device="/dev/video0", resolution="1280x720", fps=30)
pipeline.add_filter("h264_encoder", hardware_accel=True)
pipeline.add_sink("rtsp_sink", url="rtsp://0.0.0.0:8554/live")

# Start pipeline
pipeline.start()

AidCV SDK (Image Processing Acceleration)

AidCV SDK is a GPU/NPU-accelerated computer vision library with fully OpenCV-compatible APIs, optimized for Ubuntu.

Core Advantages

  • Fully compatible with OpenCV interfaces, enabling seamless migration of existing code
  • Supports GPU/NPU-accelerated preprocessing operations (resize, crop, color conversion, and more)
  • Native support for image rendering on Ubuntu desktop

Simple Example

python
import aidcv2 as cv2
import numpy as np

# Read image
img = cv2.imread("test.jpg")

# GPU-accelerated resize
img_resized = cv2.resize(img, (640, 640))

# GPU-accelerated color conversion
img_rgb = cv2.cvtColor(img_resized, cv2.COLOR_BGR2RGB)

# Display image
cv2.imshow("Result", img_rgb)
cv2.waitKey(0)