← 返回文档

君正平台 (T33)

君正 T33 Magik NPU

君正 T33 芯片集成了 Magik NPU,理论算力约 0.6 TOPS。soundSDK 通过 Magik 的 Uranus C API 进行 NPU 加速推理。

关键特性

项目
详情
CPU
MIPS32 (R2) @ 1.2GHz
NPU
Magik(Uranus C API)
NPU 模型格式
`.mgk`(通过 magik-transform-tools 转换)
音频采集
IMP SDK(`IMP_AI_*`)
采集类型字符串
`"imp"`
引擎类型字符串
`"magik"`
交叉编译器
`mips-linux-uclibc-gcc-5.4.0`
Magik SDK
v3.2(Uranus C API)

模型准备流程

# 第 1 步:导出 ONNX 模型(Windows)
python export_model_onnx.py \
    --model path/to/model.h5 \
    --output cry_detect.onnx

# 第 2 步:ONNX → .mgk 转换(在有 Magik 工具链的 Linux 上执行)
magik-transform-tools \
    --input cry_detect.onnx \
    --output cry_detect_model.mgk \
    --config magik_t33.cfg

编译

cd c/t33
./build.sh

编译链接以下库:

• `liburanus_core.a` — NPU 核心推理引擎

• `liburanus_tensor.a` — 张量操作

• `liburanus_extend.a` — 扩展算子

• `libaie.a` — AI Engine 硬件驱动

部署到目标板

君正 T33 开发板需要在 PC 端启动 HTTP 服务器,然后在开发板上使用 wget 获取文件:

# PC 端:启动 HTTP 服务器
python c/t33/http_server.py

# T33 开发板:下载文件
wget http://192.168.0.xxx:8000/cry_detect -O /mnt/sda0/cry_detect
wget http://192.168.0.xxx:8000/cry_detect_model.mgk -O /mnt/sda0/cry_detect_model.mgk

# 运行
cd /mnt/sda0
chmod +x cry_detect
./cry_detect -f test.wav -e magik -w cry_detect_model.mgk

SD 卡路径

T33 开发板的 SD 卡挂载在 /mnt/sda0/。请将测试文件和模型放置在此目录。