我们使用一些必要的Cookie来确保网站正常运行。

我们使用可选的 Cookie,具体详情请参阅我们的Cookie政策,用于记住您的设置并了解您如何使用我们的网站。

如何在 Raspberry Pi 5 上设置 Raspberry Pi AI Kit

本指南将帮助你在 Raspberry Pi 5 上设置 Raspberry Pi AI Kit。这将使你能够运行rpicam-apps camera demos using the Hailo AI neural network accelerator.

The image shows a Raspberry Pi 5 with an attached Raspberry Pi M.2 HAT+ board. The Raspberry Pi 5 is the base component, identifiable by its HDMI ports, USB ports, and Ethernet port visible at the bottom right. The M.2 HAT+ board is mounted on top of the Raspberry Pi using four standoffs, which elevate it above the main board. The M.2 HAT+ board has an M.2 module installed, which is secured in place and connected to the HAT+ board. The setup appears to be compact and well-organized, with the M.2 module's connector edge visible and fitted into the HAT+ board. The ribbon cable is connected to the HAT+ board, indicating that it might be used for additional connectivity or power. This configuration is used to enhance the capabilities of the Raspberry Pi 5 by adding support for M.2 devices, which could include high-speed storage solutions or other peripherals, thus expanding the functionality and performance of the Raspberry Pi system.

如果在开始之前你需要安装 AI Kit 方面的帮助,这篇指南 操作。提供了该过程的分步图片。

先决条件

本指南需要以下物品:

硬件设置

1.按照以下说明将摄像头连接到你的 Raspberry Pi 5 主板:安装 Raspberry Pi 摄像头。你可以跳过重新为 Raspberry Pi 接通电源这一步,因为下一步你需要断开 Raspberry Pi 的电源。

2.按照安装说明将你的 AI Kit 硬件连接到 Raspberry Pi 5。

3.按照说明启用 PCIe Gen 3.0. 此步骤为可选步骤,但强烈建议执行以便让您的 AI Kit 发挥最佳性能。

4.安装使用 AI Kit 所需的依赖项。在终端窗口中运行以下命令:

$ sudo apt install hailo-all

此命令将安装以下依赖项:

  • Hailo 内核设备驱动程序和固件
  • HailoRT 中间件软件
  • Hailo Tappas 核心后处理库
  • 树莓派 Pico W 开发板rpicam-apps Hailo post-processing software demo stages

5.最后,使用以下命令重启您的 Raspberry Pisudo reboot for these settings to take effect.

6.为确保一切正常运行,请运行以下命令:

$ hailortcli fw-control identify

如果您看到类似以下的输出,则说明您已成功安装 AI Kit 及其软件依赖项:

Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.17.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB234500054
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP

此外,您还可以运行dmesg | grep -i hailo to check the kernel logs, which should yield output similar to the following:

[    3.049657] hailo: Init module. driver version 4.17.0
[    3.051983] hailo 0000:01:00.0: Probing on: 1e60:2864...
[    3.051989] hailo 0000:01:00.0: Probing: Allocate memory for device extension, 11600
[    3.052006] hailo 0000:01:00.0: enabling device (0000 -> 0002)
[    3.052011] hailo 0000:01:00.0: Probing: Device enabled
[    3.052028] hailo 0000:01:00.0: Probing: mapped bar 0 - 000000000d8baaf1 16384
[    3.052034] hailo 0000:01:00.0: Probing: mapped bar 2 - 000000009eeaa33c 4096
[    3.052039] hailo 0000:01:00.0: Probing: mapped bar 4 - 00000000b9b3d17d 16384
[    3.052044] hailo 0000:01:00.0: Probing: Force setting max_desc_page_size to 4096 (recommended value is 16384)
[    3.052052] hailo 0000:01:00.0: Probing: Enabled 64 bit dma
[    3.052055] hailo 0000:01:00.0: Probing: Using userspace allocated vdma buffers
[    3.052059] hailo 0000:01:00.0: Disabling ASPM L0s
[    3.052070] hailo 0000:01:00.0: Successfully disabled ASPM L0s
[    3.221043] hailo 0000:01:00.0: Firmware was loaded successfully
[    3.231845] hailo 0000:01:00.0: Probing: Added board 1e60-2864, /dev/hailo0

7.为确保摄像头正常工作,请运行以下命令:

$ rpicam-hello -t 10s

此命令会启动摄像头,并显示预览窗口十秒钟。确认一切均已正确安装后,就可以运行一些演示.

该我们网站上的文档部分提供了大量此类指南、数据表和其他有用信息。

您还可以访问我们的论坛从我们的工程师以及更广泛的 Raspberry Pi 社区获取具体问题的解答。

7条评论

Daniel avatar

安装非常简单,AI 识别效果很好,虽然有点慢,但仍然令人印象深刻。

Gordon77 avatar

运行良好。遗憾的是目前 HAT 似乎供货不足。
有关于 Picamera2 集成的消息吗?

Tom avatar

现在有可能在上面加载并运行 Llama 之类的常见模型了吗?

Timbolonius avatar

能做到这个挺酷的,但应用场景有哪些呢?

gus3 avatar

拜托。当年 Raspberry Pi model B(2012-02-29,我记得很清楚)的众多构想,可不只是为这个“项目”找“应用场景”。Eben 等人已经看到这个小小的“项目”发展成了远超预期的东西。

Gordon77 avatar

目前主要用途似乎是用摄像头进行识别,但我相信随着时间推移,可选的用途会越来越多。
我用它来录制花园里野生动物的视频,不过也可以用作能识别人物的安防摄像头……
https://github.com/Gordon999/Pi_Hailo_Wildlife

hendrik avatar

我想用带 hdmi 输入和 hdmi 输出以及 wifi 屏幕共享输出的 raspberry pi5 来搭建
用 python 或 hailo 或者需要用什么来检测人、动物和汽车,并且尽可能统计某个场所内有多少人
希望有人能帮帮我
我住在荷兰南荷兰省,不过任何能帮我实现这个的人都很棒

评论已关闭