Core AI SDK Toolchain
AidLite SDK (AI Inference Acceleration)
AidLite SDK is APLUX's unified AI inference framework, encapsulating the Qualcomm QNN backend to achieve CPU/GPU/NPU heterogeneous acceleration, with a unified Python/C++ API.
Installation & Verification
bash
# 1. Download the corresponding AidLite SDK package from the Documentation Center's "Resource Download Center"
# 2. Upload to the /home/aidlux directory on the A8550MA1
# 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 versionCore Acceleration Types
| Acceleration Type | Description | Applicable Scenarios |
|---|---|---|
| TYPE_CPU | CPU general acceleration | Debugging, lightweight models |
| TYPE_GPU | GPU general acceleration | Image processing, floating-point models |
| TYPE_DSP | Qualcomm DSP/NPU acceleration | Quantized 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("Model loading failed")
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 configuration
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("Inference engine initialization failed")
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 result shape:", outputs[0].shape)AidStream SDK (Streaming Media Processing)
AidStream SDK is a pipeline-based streaming media processing toolkit that supports hardware-accelerated video encoding/decoding, streaming (push/pull), and storage, designed specifically for AI video analytics applications.
Core Features
- Supports multiple input sources including RTSP (H.264/H.265), files, USB/MIPI cameras
- Supports hardware-accelerated video encoding/decoding to reduce CPU usage
- Seamlessly integrates with AidLite SDK for end-to-end acceleration: video capture → preprocessing → AI inference → result output
Simple Pipeline Example
python
import aidstream
# Create a pipeline: USB camera capture → H.264 encoding → 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 the pipeline
pipeline.start()AidCV SDK (Computer Vision Acceleration)
AidCV SDK is a GPU/NPU-accelerated computer vision library that provides an API fully compatible with OpenCV, optimized specifically for Ubuntu systems.
Key Advantages
- Fully OpenCV-compatible API — migrate existing code seamlessly
- GPU/NPU-accelerated image preprocessing operations (resize, crop, color conversion, etc.)
- 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 image 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)