With web browsers packing more and more features every year, it was only a matter of time before they could run deep learning models. Running models in the browser has many advantages:
- The user does not have anything to install.
- The computing is done on the user's machine (mobile or computer).
- The model can sometimes make use of the device's GPU.
The library to run in the browser is called TensorFlow.js (refer to the documentation at https://github.com/tensorflow/tfjs). We will implement our face expression classification application using it.
While TensorFlow cannot take advantage of non-NVIDIA GPUs, TensorFlow.js can use GPUs on almost any device. GPU support in the browser was first implemented to display graphical animations through WebGL (a computer graphics API for web applications, based on OpenGL). Since it involves matrix calculus, it was then repurposed to run deep learning operations.