To run the tensorflow lite model on your raspberry pi, do follow the below steps:
- Raspberry Pi
- PI Camera Module
Clone the repo onto your raspberry pi machine
git clone https://github.com/AnuragAnalog/TF-Object-Detection-on-PI
cd TF-Object-Detection-on-PI
Run the download.sh file to download all the required packages which are necessary to run opencv
./download.sh
If you want to install tensorflow instead of tflite_runtime, you can comment the last four lines in the script.
wget https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
After downloading the model, you need to unzip it, use the below command for that to unzip and store it in a directory called model
unzip coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip -d model
I have written two varaints of the program, one which takes input from your wecam feed and the other which takes input from a video file.
For video.py I have added a sample video file
To run the webcam version
./webcam.py --model_dir=model
To run the video version
./video.py --model_dir=model
- Object Detection on Webcam
- Object Detection on Video
- Object Detection on Image
- Add more links to pre-trained models
- Object Detection using Custom models
I have took atmost care in making this hassle free, but still if you face any issues, feel free to create issues.