Computer Visioning with a Raspberry Pi
Curious to see whether or not a raspberry pi would be able to handle TensorFlow, I tried it on the newest Raspberry Pi 4 B.
The Computer Visioning (CV) industry is about teaching computers to interpret images at a level close to the way humans see and process images. For example, a computer can be taught to recognize signs of melanoma by labeling the indicators of skin cancer in a large number of photos. Those photos are run through a deep learning neural network. It can also do more simple tasks like recognize vehicle models such as a Honda Civic.
Google released a very accessible computer visioning system called TensorFlow and there are pre-taught systems available too. I stumbled upon this technology while researching people/footfall counting mechanisms for my startup and was amazed that Google provided this technology for free. I needed to train the device with Object Detection specifically so I loaded one of the pre-trained systems onto a Raspberry Pi 4 to test it out.
The pre-trained quantized model I used was the SSD MobileNet v2 Lite which is able to identify ninety classes of objects ranging from bananas, bottles, cats, and of course — people.
Fixing Photography | Data Driven Investor
Tom ZImberoff studied music at the University of Southern California before pivoting to photography. As a…
Tensor Flow is known to be quite slow on a laptop with a decent processor so I wasn’t really sure how it would work out with the Raspberry Pi. I was hoping that since the Raspberry Pi would be dedicated to running TensorFlow that it would be able to handle the load.
The process of creating the directories and loading the files took roughly a week and it wasn’t the smoothest process. Downloading openCV took awhile but I thought that was the easiest way to go about it. The picamera image quality is not too bad, I would say it’s similar to the iPhone 4 camera quality.
So let’s take a look at some of the pictures I took running TensorFlow:
This is an image I took the first day that I was able to get it to run. It had crashed 15+ times prior to this day and I was getting very frustrated. As you can see in the image, the device detected me as a person and my iPhone as a cell phone.
In the corner of this image you can see my Raspberry Pi all set up with the camera and all. I will say that it has been extremely difficult to find a case that allows you to attach both the camera and a cooling fine. I can use one or the other and it would be great if I could use the fan while running TensorFlow because it gets hot.
I tried out the raspberry pi at the office to test out different distances and see how TensorFlow handles it. It actually did a really good job detected objects from a distance. The table there is labeled as “dining table” because the pre-trained library possibly taught it to recognize all tables that way. Who’s to say that’s not a dining table though?
In conclusion, the Raspberry Pi 4 B was fully capable of running Object Detection. This is pretty impressive considering that it is priced at around $50 US dollars. If you are interested in trying this out yourself I would recommend using one to get started. There are so many instructions that teach you step by step how to load it all on so don’t be discouraged!
I actually do not come from a Technology background and am pursuing a degree in Biology. So if I can do it, you can too!