Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2024-08 到 2024-10 的 Raspberry Pi新產品介紹(Pico 2, m...

2024-08 到 2024-10 的 Raspberry Pi新產品介紹(Pico 2, microSD, Bumper, AI Camera, AI HAT+)

台灣樹莓派

March 17, 2025
Tweet

More Decks by 台灣樹莓派

Other Decks in Technology

Transcript

  1. 姓名標示 — 非商業性 — 相同方式分享 CC (Creative Commons) 姓名標示 —

    你必須給予 適當表彰、提供指向本授權 條款的連結,以及 指出(本作品的原始版本)是否已 被變更。你可以任何合理方式為前述表彰,但不得以 任何方式暗示授權人為你或你的使用方式背書。 非商業性 — 你不得將本素材進行商業目的之使 用。 相同方式分享 — 若你重混、轉換本素材,或依本 素材建立新素材,你必須依本素材的授權條款來 散布你的貢獻物。
  2. • COSCUP , MakerConf, PyCon, HKOSCon 講者 • 投影片 •

    https://speakerdeck.com/piepie_tw • 程式碼 • https://github.com/piepie-tw • 台灣樹莓派網站 : • https://piepie.com.tw/ • Facebook: • https://www.facebook.com/RaspberryPi.Taiwan 分享 x 教學
  3. 6 • Raspberry Pi Pico 2 • Raspberry Pi microSD

    • Raspberry Pi Bumper • Raspberry Pi AI Camera • Raspberry Pi AI HAT+ 大綱
  4. 8 • 自 2021 年以來已銷售 4 百萬台 Pico 1 Raspberry

    Pi Pico 2 https://www.jeffgeerling.com/blog/2024/raspberry-pi-pico-2-rp2350-adds-more-pio-risc-v-cores
  5. 10 • 和 Pico 1 相同的 form factor • 兩倍板載

    flash(2 ➡️ 4)MB • 使用 RP2350 晶片 • 更快的處理器時脈 (133 ➡️ 150)MHz • 兩倍的記憶體 (264 ➡️ 520)KByte • 更多的 PIO(2 ➡️ 3) • SHA256 硬體加速 • 支援 Arm Trust Zone • 更低的功耗 (100 ➡️ 57)µA • 增加 RISC-V Hazard3 核心 Raspberry Pi Pico 2 特色
  6. 20 • Sensor: Sony IMX500 Intelligent Vision Sensor • Resolution:

    12.3MP (4056 × 3040 pixels) • Input tensor maximum size: 640(H) × 640(V) • FOV: 66x52 degree • F1.79 focal ratio • 整合 RP2040 管理神經網路韌體 • 適合所有型號的 Pi Raspberry Pi AI Camera 規格 https://www.raspberrypi.com/products/ai-camera/
  7. 21 • Raspberry Pi AI Camera (IMX500) Model Zoo 有現成

    Segmentation, Classification, Detection, Pose Estimation 模型 • 可重新訓練自定義資料集 , 使用 IMX500 Converter 轉換 TensorFlow 或 PyTorch Raspberry Pi AI Camera 特色 https://developer.aitrios.sony-semicon.com/en/raspberrypi-ai-camera/documentation/imx500-converter
  8. 22 • # 安裝必要軟體 • $ sudo apt update &&

    sudo apt full-upgrade • $ sudo apt install imx500-all • 支援libcamera, rpicam-apps 和Picamera2 • # 物件偵測 • $ rpicam-hello -t 0s --post-process-file /usr/share/rpi- camera-assets/imx500_mobilenet_ssd.json • # Picamera2 • $ python imx500_object_detection_demo.py --model ssd_mobilenetv2.rpk 使用 Raspberry Pi AI Camera https://www.raspberrypi.com/products/ai-camera/
  9. 23 • 2014 年提出 ,HAT=Hardware Attached on Top • 65x56mm

    大小 ,4 個安裝孔 , 有 40P GPIO 接頭 • I2C EEPROM 保留 2 支腳 (ID_SD 和 ID_SC) HAT 和 HAT+ https://www.raspberrypi.com/news/introducing-raspberry-pi-hats/
  10. 24 • 2023 年重新定義規格 , 重大改變包括 : • 預設 5V

    供電 ,3.3V 不供電 • 更簡單的 EEPROM 內容 • 可堆疊設計規範 • 新的 HAT+ 標示 HAT 和 HAT+ https://datasheets.raspberrypi.com/hat/hat-plus-specification.pdf
  11. 25 • 從 AI Kit 到 AI HAT+ • 原本

    AI Kit 包含 M.2 HAT+ 和 Hailo-8L NPU 模組 ( 不分售 ), 現在整合在同一個 HAT+ • M.2 2242 樣式 Raspberry Pi AI HAT+
  12. • Hailo 在 2017 年由以色列國防單位成員創立 • 專注於人工智慧的晶片製造商 • 產品包含 AI

    accelerators 和 AI vision processors • AI HAT+(13 TOPS/26 TOPS) 都是台灣製造 • Hailo-8 和 Hailo-8L 是不同產品 • Hailo-8L 算力為 13 TOPS, 低功耗適合邊緣加速 • Hailo-8 算力為 26 TOPS, 具有更高性能
  13. • 軟硬體環境 :Pi 5 + Bookworm 64-bit • $ sudo

    apt-get update • $ sudo apt-get full-upgrade • $ sudo apt-get install hailo-all 開始使用 AI HAT+
  14. • $ cd ~ • $ git clone https://github.com/hailo-ai/hailo- rpi5-examples.git

    • $ cd hailo-rpi5-examples • $ source setup_env.sh • (venv)$ pip install -r requirements.txt • (venv)$ ./download_resources.sh • (venv)$ ./compile_postprocess.sh 下載 Hailo 範例程式
  15. • 使用 rpicam-apps ( 通常做測試使用 ) • 使用 GStreamer (

    通常配合 C/C++) • 使用 Picamera2 ( 通常配合 Python) 如何使用 AI HAT+ 開發 ?
  16. • 一個 Docker 包含四個 Hailo 核心軟體 • 1. Hailo Model

    Zoo • 2. Hailo Applications (TAPPAS High- Performance Application Toolkit) • 3. Hailo Runtime(Hailo RT) • 4. Dataflow Compiler(DFC) Hailo 一體式方案簡化 AI 開發流程 https://hailo.ai/blog/how-software-can-streamline-customer-experience-in-edge-ai/
  17. • 提供多種 pre-trained 模型 , 開箱即用 • 支援 TensorFlow 或是

    ONNX 格式 Hailo Model Zoo https://hailo.ai/blog/how-software-can-streamline-customer-experience-in-edge-ai/
  18. • GStreamer 是一個跨平台的多媒體框架 , 可串接 各種多媒體應用包括視訊和音訊 • GStreamer 使用管道 (Pipeline)

    方式對每一個 元素 (Element) 或插件 (Plugins) 進行串聯 GStreamer Framework https://github.com/hailo-ai/tappas/blob/master/docs/terminology.rst
  19. • 將客製化模型或是 Model Zoo 整合到視覺管道 利用 HailoRT 和 GStreamer 框架

    https://hailo.ai/blog/how-software-can-streamline-customer-experience-in-edge-ai/
  20. • $ gst-launch-1.0 filesrc location="resources/detection0.mp4" ! qtdemux ! avdec_h264 !

    videoconvert ! hailonet hef-path="resources/yolov6n.hef" ! hailofilter so- path="resources/libyolo_hailortpp_postproc ess.so" ! hailooverlay ! videoconvert ! fpsdisplaysink GStreamer Framework
  21. 45 • 1. 取得跌倒資料集 (Kaggle, roboflow…) • 2. Amazon EC2

    或是 Google Colab 重新訓練 • 3. 佈署模型在邊緣裝置 ( 例如 Pi5) • 4. 使用 AI Kit • 4.1 將原模型 export 成 ONNX 模型 • 4.2 建立環境 , 使用 SDK 重新編譯模型 • 5. 將模型重新佈署到邊緣裝置 訓練自己的 YOLO 資料集實際步驟
  22. 47 • $ docker run --name "hailo_yolov8" -it --gpus all

    --ipc=host -v /home/ubuntu/datasets:/workspace/datasets yolov8:v0 • # time yolo detect train data=/path/to/data.yaml model=yolov8s.pt name=retrain_yolov8s epochs=5 batch=16 (real 13m44.734s) 在 Amazon EC2 用 Docker 訓練 https://github.com/hailo-ai/hailo-rpi5-examples/blob/main/doc/retraining-example.md
  23. 49 • # cd /workspace/ultralytics • # yolo export model=/workspace/ultralytics/runs/detect/r

    etrain_yolov8n/weights/best.pt imgsz=640 format=onnx opset=11 匯出成 ONNX 格式 https://github.com/hailo-ai/hailo-rpi5-examples/blob/main/doc/retraining-example.md
  24. 51 • $ pip install hailo_dataflow_compiler-py3-none- linux_x86_64.whl • $ pip

    install hailo_model_zoo-py3-none-any.whl • $ time hailomz compile --hw-arch hailo8l --ckpt best.onnx --calib-path ~/path/to/images --yaml yolov8n.yaml --classes 1 (real 16m7.818s) 建立環境 , 使用 SDK 重新編譯模型 https://github.com/hailo-ai/hailo-rpi5-examples/blob/main/doc/retraining-example.md
  25. 54 • AMI: Deep Learning Base OSS Nvidia Driver GPU

    AMI (Ubuntu 22.04) (x64) • type: g4dn.2xlarge Amazon EC2 價格
  26. • Raspberry Pi AI Kit 官方文件 • https://reurl.cc/bV8ER6 • Hailo

    Raspberry Pi 5 Examples • https://github.com/hailo-ai/hailo-rpi5-examples • Hailo TAPPAS • https://github.com/hailo-ai/tappas • Hailo TAPPAS User Guide • https://reurl.cc/jWZG7L 更多說明
  27. • Hailo AI Software Suite User Guide • Hailo TAPPAS

    User Guide • HailoRT User Guide • Hailo Dataflow Compiler User Guide • Hailo Model Zoo User Guide • Hailo Integration Tool User Guide 更多 Hailo 文件
  28. • @Raspberry Pi 贊助 Raspberry Pi Beginner's Guide • @Raspberry

    Pi 贊助 27W 電源供應器 • @Raspberry Pi 贊助 Active Cooler for Raspberry Pi 5 • @RICELEE 提供一片 Pico 2 抽獎 • @ 台灣樹莓派提供一組 Raspberry Pi AI HAT+ 抽獎 • @ 樹莓派愛好者提供一組 Android 智慧電視盒抽獎 • @Creative5 贊助 USB 小禮物 感謝乾爹們~