【Efinix Ti60】TinyML+Vision: YOLO人臉辨識
2025年3月18日...大约 2 分鐘
【Efinix Ti60】TinyML+Vision: YOLO人臉辨識
本專案範例可在官方 TinyML repo中的tinyml_vision\Ti60F225_yolo_person_detect_demo
找到。
(1) 接線
需要的材料:
- 螢幕
- Mini-DSI Panel
- Mini-DSI Panel Connector Daughter Card
- Dual MIPI to DSI Converter Daughter Card + 排線
- 相機
- Raspberry Pi v2 Camera Module
- Dual Raspberry Pi Camera Connector Daughter Card

(2) Verilog Workflow(Efinity)
- Generate SapphireSoc IP
- Run synthesis, placement, routing, generate bitstream
詳細
詳細請參考TinyML Hello World
(3) Firmware(Efinity RISC-V)
- 以 RISC-V 開啟本文專案底下的
\embedded_sw\SapphireSoc
workspace 路徑 - 在
File
->Import...
中,選擇Efinix Projects
->Efinix Makefile Project
- BSP location 選擇
\embedded_sw\SapphireSoc\bsp
- 選擇
standalone
底下的evsoc_tinyml_ypd
專案
詳細
1~4 步驟詳細請參考TinyML Hello World
注意
因官方提供的相機為 v2 版,需先自行將main.cc
的相機版本變數改為 2
#define PICAM_VERSION 2 // <--原本為3
#include <stdlib.h>
#include <stdint.h>
#include "riscv.h"
#include "soc.h"
#include "bsp.h"
使用 TinyML Generator 生成轉換模型檔
選擇 yolo_person_detect.tflite
(optional) 開啟
CONV_DEPTHW_MODE
的STANDARD
選項yolo_person_detect.tflite轉換 注意
經測試,yolo_person_detect.tflite 僅可開啟
CONV_DEPTHW_MODE
模式,否則將造成模型無法載入或辨識成功率下降將
output
路徑下完成轉換的.c
,.h
,.v
檔案,直接覆蓋evsoc_tinyml_ypd\model
路徑的檔案Build
evsoc_tinyml_ypd
專案(可按Run
測試)
(4) 合併軟硬體 Image
請準備好以下 bitstream 檔案
outflow
下的edge_vision_soc.hex
-> (2)完成\embedded_sw\SapphireSoc\standalone\evsoc_tinyml_ypd\build
下的evsoc_tinyml_ypd.bin
-> (3)完成
在 Efinity 中,開啟 Programmer
點選 Combine Multiple Image Files 按鈕
Combine Multiple Image Files按鈕位置 在彈出的視窗中,依下列選項設定
- Mode: Generic Image Combination
- Output File: 自行設定輸出檔案名稱,並以
.hex
結尾 - Output Directory: 預設為
outflow
路徑 - 點選右方 Add Image 按鈕,並依序加入
edge_vision_soc.hex
及evsoc_tinyml_ypd.bin
注意
Firmware 的 image 必須選擇
.bin
檔案 - 設定 Flash Address
edge_vision_soc.hex
: 0x00000000evsoc_tinyml_ypd.bin
: 0x00380000
- 點選 Apply,合併後的檔案將生成於 Output Directory

- 回到 Programmer,Image File 選擇剛剛生成的合併 image(預設會自動選擇),點 Start Program
Demo
What do you think?
- 0
- 0
- 0
- 0
- 0
- 0
Powered by Waline v3.2.6
Preview: