Member-only story
Building Realtime Object Detection WebApp with Tensorflow.js and Angular
TENSORFLOW.JS
Tensorflow.js is an open-source library enabling us to define, train and run machine learning models in the browser, using Javascript. For more information about Tensorflow.js, check out its official webpage. I will use Tensorflow.js library in Angular to build a Web App which detects multiple objects on webcam video feed.
COCO-SSD MODEL
First, we have to select the pre-trained model which we are going to use for object detection. Tensorflow.js provides several pre-trained models for classification, pose estimation, speech recognition and object detection purposes. Check out all the Tensoflow.js pre-trained models for more information.
COCO-SSD model, which is a pre-trained object detection model that aims to localize and identify multiple objects in an image, is the one that we will use for object detection. Original ssd_mobilenet_v2_coco model size is 187.8 MB and can be downloaded from tensorflow model zoo. Compared to original model, Tensorflow.js version of the model is very lightweight and optimized for browser execution. The default object detection model for Tensorflow.js COCO-SSD is ‘lite_mobilenet_v2’ which is very very small in size, under 1MB, and fastest in inference speed. If you would like better…