Image classification (persons, animals, other) on raspberry pi from pi-camera (with cycle while) using custom model .h5 (output to terminal) using TensorFlow
Short summary:
In this article, I will explain how to create image classification (persons, animals, other) on raspberry pi from pi-camera (with cycle while) using custom model .h5 (output to terminal). All code is located here.
Note before you start:
So, Let’s start :)
Hardware preparation:
Software preparation:
1 Create a neural network model to predict 3 classes persons, animals, others.
I have already done it in the article below. So in this article, you do NOT NEED to DO IT.
2 So, let's implement our model to image classification (persons, animals, other) on raspberry pi from pi-camera (with cycle while) using custom model .h5 (output to terminal)
For that, you need to run the next code:
#install Tensorflow Lite
pip3 install https://github.com/google-coral/pycoral/releases/download/release-frogfish/tflite_runtime-2.5.0-cp37-cp37m-linux_armv7l.whl#clone repo with my code
git clone https://github.com/oleksandr-g-rock/classify_picamera_with_while_cusom_model.git#go to direcory
cd classify_picamera_with_while_cusom_model#copy h5 custom model
wget https://github.com/oleksandr-g-rock/create-image-classification-for-recognizing-persons-animals-others/raw/main/animall_person_other_v2_fine_tuned.h5#run script
python3 classify_picamera_with_while.py
3 You should see something like that.
Result:
In this article, we created image classification (persons, animals, other) on raspberry pi from pi-camera (with cycle while) using custom model .h5 (output to terminal). All code is located here.