A guide showing how to train TensorFlow Lite object detection models and run them on Android, the Raspberry Pi, and more! TensorFlow Lite is an optimized framework for deploying lightweight deep learning models on resource-constrained edge devices. TensorFlow Lite models have faster inference time and require less processing power, so they can be used to obtain faster performance in realtime applications. This guide provides step-by-step instructions for how train a custom TensorFlow Object Detection model, convert it into an optimized format that can be used by TensorFlow Lite, and run it on Android phones or the Raspberry Pi. The guide is broken into three major portions. Each portion will have its own dedicated README file in this repository. This repository also contains Python code for running the newly converted TensorFlow Lite model to perform detection on images, videos, or webcam feeds.
Attention readers: We invite you to access the corresponding Python code and iPython notebook for this article on GitHub. Image classification can perform some pretty amazing feats, but a large drawback of many image classification applications is that the model can only detect one class per image. With an object detection model, not only can you classify multiple classes in one image, but you can specify exactly where that object is in an image with a bounding box framing the object. The TensorFlow Models GitHub repository has a large variety of pre-trained models for various machine learning tasks, and one excellent resource is their object detection API. The object detection API makes it extremely easy to train your own object detection model for a large variety of different applications.
In my previous blog, we have seen how the off-the-shelf Object Detection is applied in Enterprise context in conjunction with SAP Leonardo Machine Learning Foundation. Now we will have a close look at how to implement custom object detection with tensorflow for serving intelligent solutions, especially how to train a custom object detector with custom dataset, and provision as RESTful API running on SAP Cloud Platform, Cloud Foundry, which can be consumed by your intelligent solution through loosely-coupled HTTP(s). The TensorFlow Object Detection API is an open source framework built on top of TensorFlow that makes it easy to construct, train and deploy object detection models. For more detail, you may refer to its official document. In order to train your own object detector, you need to prepare the dataset for training, including the images with the target objects, and labelling the object in the images.
I used TensorFlow and a Raspberry Pi to create a pet detector camera that watches the door and texts me when my cat wants to be let inside! This video explains how the code works, so you can use it as an example for your own object detection application. Get a Raspberry Pi: https://amzn.to/2Iki3fb If you have questions, I usually respond more quickly on Twitter, so send me a tweet @EdjeElectronics!
Researchers have been studying the possibilities of giving machines the ability to distinguish and identify objects through vision for years now. This particular domain, called Computer Vision or CV, has a wide range of modern-day applications. From being used by autonomous cars for object detection on roads to complex facial and body language recognitions that can identify possible crimes or criminal activities, CV has numerous uses in today's world. There is no denying the fact that Object Detection is also one of the coolest applications of Computer Vision. Modern-day CV tools can easily implement object detection on images or even on live stream videos.