Implementation of Google Coral's Teachable Machine for Raspberry Pi Zero 2 W with Coral USB Accelerator.
This project is an implementation of the Teachable Machine example by Google Coral on a Raspberry Pi Zero 2 W with the Coral USB Accelerator.
-
Hardware:
- Raspberry Pi Zero 2 W
- Raspberry Pi Camera Module v2
- Coral USB Accelerator
-
Software:
- Operating System: Raspbian GNU/Linux 10 (buster)
- Python Version: 3.7 (default in Raspbian Buster)
-
Update the system:
sudo apt-get update sudo apt-get upgrade
-
Install Edge TPU runtime:
Add the Coral package repository and install the Edge TPU runtime:
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo apt-get update sudo apt-get install libedgetpu1-std
-
Install PyCoral library:
Install the PyCoral library, which is required for communication with the Coral USB Accelerator:
sudo apt-get install python3-pycoral
-
Clone the project repository:
Clone the original Teachable Machine repository from Google Coral:
git clone https://github.com/google-coral/project-teachable.git cd project-teachable -
Install dependencies:
Install the required Python dependencies:
bash install_requirements.sh
-
Connect the Coral USB Accelerator:
Plug the Coral USB Accelerator into the Raspberry Pi Zero 2 W.
-
Start Teachable Machine:
Run the following script to start the Teachable Machine:
bash run.sh
-
Train classes:
- Key 1: Trains Class 1 with the current camera image.
- Key 2: Trains Class 2 with the current camera image.
- Key 3: Trains Class 3 with the current camera image.
- Key 4: Trains Class 4 with the current camera image.
- Key Q: Exits the program.
Point the camera at an object and press the corresponding key to assign it to a class. Repeat this process for different objects and classes. Once trained, the system will classify detected objects in real-time.
- Python Version: Ensure you are using Python 3.7, as newer versions may not be compatible.
- Operating System: This project has been tested on Raspbian Buster. Other versions or distributions may cause compatibility issues.
- Performance: The Raspberry Pi Zero 2 W has limited resources. For better performance, a more powerful Raspberry Pi is recommended.
- Original Project: https://github.com/google-coral/project-teachable
- Coral Documentation: https://coral.ai/docs/accelerator/get-started/
