Computer Vision (TensorFlow Lite)
program that can find patterns or make decisions from a previously unseen dataset.
Main steps
1 - Video/Roboflow: Gather images for dataset
2 - Colab: Train Custom Model
3 - Export Model
4 - Set up Pi
5 - Run on Pi
1 - Video/Roboflow: Gather images for dataset
Logo | Description |
---|---|
We can film a video of the item we want to detect and then upload to Roboflow. On the Roboflow website, we can extract frames every X seconds to create a .jpg file each interval. Then we can begin labeling each image on Roboflow. |
Roboflow is a website where you upload images, label them, and export a zip file (images & .xml files).
Useful to share dataset and have 3 people label at the same time
1.1 - Unlabeled Images to Labeled Images
Unlabled | Labeled (Desired Outcome) |
---|---|
2 - Colab: Train Custom Model
WARNING: This Colab began having issues in May 2023.
Logo | Description |
---|---|
-The following website uses Python -here we set up libraries - collections of pre-written code that you can use to perform specific tasks -Prepare the dataset -Train the model -Evaluate the model performance with validation data -Export the model as .tflite file |
Open up this pre-made online coding website called Google Colab
3 - Export Model
We can export the custom model after training as a .tflite file which will be uploaded to the Raspberry Pi and then can be used for Object Detection. Demo here
4 - Set up Pi
Original Tensorflow Video - 2 yrs ago | November 2023 - Recent Video |
---|---|
Installation
Original Tensorflow Video - 2 yrs ago | November 2023 - Recent Video |
---|---|
NOTE: (2:54) -click top left -preferences -raspberry pi configuration -tabs: interfaces -enable camera -reboot | NOTE: -click top left -preferences -raspberry pi configuration -tabs: interfaces -enable camera -reboot |
5 - Run on Pi
Original Tensorflow Video - 2 yrs ago |
---|
source tflite/bin/activate |
cd examples/lite/examples/object_detection/raspberry_pi/ |
cp ~/Downloads/android.tflite . |
python detect.py |
python detect.py --model android.tflite |
Sources
[1] Tensorflow Videob (The Colab they have doesn't work with newer Python versions)
Last updated