Skip to main content

Getting Started with MediaPipe on reTerminal

MediaPipe is a an open-source framework from Google for building multimodal (eg. video, audio, any time series data), cross platform (i.e Android, iOS, web, edge devices) applied ML pipelines. It is performance optimized with end-to-end ondevice inference in mind. Mediapipe is currently under active development and includes multiple demos, that can be run out-of-the box after installing Mediapipe on reTerminal.

Hardware preparation

Software Preparation

We recommend installing the Bullesye or Bookworm version of Raspberry Pi 64 bit OS from their official website. If you prefer to install a new Raspbian OS, please follow the steps outlined in this guide.

note

In earlier OS versions, Python libraries could be directly installed system-wide using pip, the Python package installer. However, in Bookworm release, a shift has occurred. To mitigate potential issues during installation, it is now necessary to install packages via pip into a Python virtual environment using venv.

Execute these commands one by one, and you will end up with a virtual environment.

mkdir my_project
cd my_project
python -m venv --system-site-packages env
source env/bin/activate

ML solutions in MediaPipe

Begin by cloning the GitHub repository to your reTerminal device using the following command:

git clone https://github.com/Seeed-Studio/Seeed_Python_ReTerminal

Navigate to the folder that contains the required resources. In this directory, you will find four topics that we will be covering.

Face Detection

  • Step 1 For our first topic, we will be installing dependencies for face detection. Move to the face detection section using the following commands

    cd Seeed_Python_ReTerminal/samples/mediapipe_picam/face_detector/raspberry_pi
  • Step 2 Run the setup script to install the necessary dependencies

    sh setup.sh
  • Step 3 Once the setup is complete, you can execute the source file to initiate face detection

    python3 detect.py

Face Landmarker

  • Step 1 Install dependencies

    cd Seeed_Python_ReTerminal/samples/mediapipe_picam/face_landmarker/raspberry_pi
  • Step 2 Run the setup script to install the necessary dependencies

    sh setup.sh
  • Step 3 Once the setup is complete, you can execute the source file to initiate face landmaker.

    python3 detect.py

Hand Landmarker

  • Step 1 Install dependencies

    cd Seeed_Python_ReTerminal/samples/mediapipe_picam/hand_landmarker/raspberry_pi
  • Step 2 Run the setup script to install the necessary dependencies

    sh setup.sh
  • Step 3 Once the setup is complete, you can execute the source file to initiate hand landmaker.

    python3 detect.py

Pose Landmarker

  • Step 1 Install dependencies

    cd Seeed_Python_ReTerminal/samples/mediapipe_picam/pose_landmarker/raspberry_pi
  • Step 2 Run the setup script to install the necessary dependencies

    sh setup.sh
  • Step 3 Once the setup is complete, you can execute the source file to initiate pose landmaker.

    python3 detect.py

Resources

Tech support

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...