📚 Course contents

AI & Computer Vision, lesson 22 of 52

Model to the Browser: TensorFlow.js

intermediate24 min readFull course

Introduction

Your models so far live in Python on your laptop. Today you'll put one inside a web page, so anyone can open it on their own phone or laptop, with nothing to install. You'll teach a classifier live by showing it examples through the webcam, then load the model you trained yourself, and the video never leaves the device.

By the end of this lesson you'll be able to:

  • Explain what "running a model in the browser" means and why it is useful
  • Serve a web page locally and give it camera permission
  • Teach a classifier in the browser using MobileNet features and nearest neighbours
  • Export a Keras model to TensorFlow.js format and load it in a page
  • Name the limits: model size, speed, camera security rules, browser support
  • Explain the privacy advantage: the video never leaves the device
Model to the Browser: TensorFlow.js | Electronics Simplified