Raspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from Scratch

Raspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from Scratch

Previous Issue: The AI HAT+ occupies all GPIO pins, and I have already purchased the TOUCH Display 2. What should I do?

Last time we discussed that the Display 2 uses a 32-bit system. This time, to use the AI HAT+ extension, I re-flashed the OS to a 64-bit system because the AI HAT+ 26 TOPS only supports 64-bit. If set up correctly, the screen will display.

Additionally, the AI HAT+ will occupy all GPIO pins. If you connect the TOUCH Display 2 with the official second-generation power supply, you will face issues. At this point, I recommend purchasing the following accessories to expand the pins. Of course, you can also buy a USB power supply for the display, which costs about 20 dollars, and that will solve the problem.

Raspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from Scratch

Option 1: (Designed by Elpop in the UK, delivery cannot reach the domestic area)

Raspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from Scratch

Option 2: GPIO Expansion (many options available on Taobao, choose freely)

Raspberry Pi AI HAT+ (26 TOPS) Frequently Asked Questions

Question 1: What is the main purpose of the Raspberry Pi AI HAT+ (26 TOPS)?

Answer:

The Raspberry Pi AI HAT+ (26 TOPS) is primarily used to provide high-performance, energy-efficient edge AI inference acceleration capabilities for the Raspberry Pi 5. Its core function is to offload compute-intensive neural network inference tasks from the Raspberry Pi 5’s CPU to a dedicated NPU using the onboard Hailo-8 AI accelerator. This enables low-latency, low-power real-time AI processing on edge devices. It is particularly suitable for computer vision applications, such as object detection, image segmentation, and pose estimation. Typical application areas include process control, security monitoring, smart homes, robotics, and scenarios requiring real-time processing of complex AI visual tasks.

Question 2: What are the differences between the 13 TOPS and 26 TOPS versions of the Raspberry Pi AI HAT+?

Answer:

The main differences between the two versions lie in processing power and price:

  • The 26 TOPS version is equipped with the Hailo-8 chip, providing 26 TOPS of AI inference performance.
  • The 13 TOPS version is equipped with the Hailo-8L chip, providing 13 TOPS of AI inference performance (about 50% of the 26 TOPS version).
  • The 26 TOPS version can handle larger-scale neural network models, run inference tasks faster, and more effectively run multiple networks or concurrently process multiple AI tasks.
  • In terms of price, the 26 TOPS version is generally more expensive than the 13 TOPS version (reference price around $110 and above, compared to about $70 for the 13 TOPS version).
  • Both versions are physically similar in size and interfaces, adhering to the HAT+ specification.

Question 3: What are the hardware and software requirements for using the Raspberry Pi AI HAT+?

Answer:

Hardware Requirements:

  • Must use the Raspberry Pi 5 motherboard (not compatible with Raspberry Pi 4 or earlier models).
  • It is recommended to use the 8GB RAM version of the Raspberry Pi 5 for a smoother experience.
  • It is strongly recommended to use the official Raspberry Pi 27W USB-C power adapter, especially when connecting high-power peripherals like the AI HAT+.
  • It is advisable to use an active cooler for the Raspberry Pi.
  • To run the official demo, the official Raspberry Pi camera (such as Camera Module 3 or High Quality Camera) is required.

Software Requirements:

  • Must install the 64-bit version of Raspberry Pi OS Bookworm (older versions or 32-bit versions are not supported).
  • Need to install the Hailo software stack (can be installed via sudo apt install hailo-all command). Note that this can easily result in errors, so remember to switch the mirror to domestic sources like Tsinghua or Alibaba (consult your own large model for more accurate answers than mine).
  • PCIe Gen 3.0 must be enabled for optimal performance.

Question 4: What types of AI models and frameworks does the AI HAT+ support?

Answer:

The AI HAT+ supports various AI frameworks and model types:

Supported AI Frameworks:

  • TensorFlow
  • TensorFlow Lite
  • PyTorch
  • Keras
  • ONNX

Supported Model Types:

  • Object Detection (Yolov5, Yolov6, Yolov8, YoloX)
  • Instance/Semantic Segmentation
  • Pose Estimation
  • Face/Pedestrian Detection

Hailo provides a tool called Dataflow Compiler to convert models trained using these frameworks into a format that can be efficiently executed on the Hailo NPU.

It is important to note that the AI HAT+ primarily focuses on computer vision tasks and is not suitable for accelerating large language models (LLMs). Its hardware architecture is optimized for parallel computation common in visual tasks, rather than the sequential processing required by Transformer models in LLMs.

Question 5: How to verify that the AI HAT+ is installed successfully and run basic tests?

Answer:

After installation, you can verify whether the AI HAT+ is correctly installed and functioning by following these steps:

  1. Hardware Check:
  • Run hailortcli fw-control identify command to check the status of the Hailo NPU.
  • Use dmesg | grep -i hailo to check the kernel log for loading information about the Hailo device.
  • Camera Verification (if the official Raspberry Pi camera is connected):
    • Run rpicam-hello -t 10s command, which should open a camera preview window for 10 seconds.
  • Run AI Demos:
    • Object Detection (Yolov5 Person/Face):rpicam-hello –post-process-file /usr/share/hailo/postprocesses/configs/yolov5_personface.json -t 0
    • Object Detection (Yolov8):rpicam-hello –post-process-file /usr/share/hailo/postprocesses/configs/hailo_yolov8_inference.json -t 0
    • Image Segmentation (Yolov5):rpicam-hello –post-process-file /usr/share/hailo/postprocesses/configs/hailo_yolov5_segmentation.json -t 0
    • Pose Estimation (Yolov8):rpicam-hello –post-process-file /usr/share/hailo/postprocesses/configs/hailo_yolov8_pose.json -t 0

    Successfully running these commands (the screen displays the camera’s real-time image with detection boxes, segmentation masks, or pose keypoints overlaid) indicates that the AI HAT+ has been correctly installed, configured, and is capable of performing AI inference tasks.

    To clarify the above issues, I sought Google’s in-depth research and combined it with Raycast AI to create a webpagehttps://zx274j08qa.app.yourware.so/, below are screenshots of the webpage. Interested parties can take a look. I am also a novice, and any errors are welcome to be pointed out, but please don’t blame me, haha.Raspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from ScratchRaspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from Scratch

    https://zx274j08qa.app.yourware.so/

    The above is my website link, which contains very detailed content based on the official documentation of the Raspberry Pi AI HAT. (After all, the support of Google’s in-depth research is still useful.) Those in need can take it. If you like it, feel free to like, bookmark, and share. Your support is the motivation for Fox’s continuous updates!

    Raspberry Pi AI HAT+: Unleashing AI Superpowers with 26 TOPS from Scratch

    Leave a Comment