WebCam ImageNet Recognition
The demo loads the model converted to TensorFlow.js format,
which is hosted at Google Cloud Storage
weights_manifest.json can be obtained
The demo runs on reasonably new Chrome, Safari and Firefox (not on Edge nor IE). It runs on Mobile Safari and Android Chrome with good amount of device's GPU memory (i.e. iPhone 6 and later, Galaxy S7, Pixel 2 XL, etc.). It can take very long time to startup as the pre-trained model is quite large. It fails recognition when seemingly an out-of-GPU-memory situation (see Issues #2 and #3).
You can try it out at: https://tfjs-mobilenet-webcam.netlify.com/
Building and Running
The following commands will start a web server on
and open a browser page with the demo.
cd tfjs-mobilenet-webcam yarn # Installs dependencies. yarn start # Starts a web server and opens a page. Also watches for changes.
public directory holds the deployable files.
Although it supposed to distinguish 1000 categories, the categories that ImageNet classifies don't include that many usual everyday items. It may be a bit hard to find many recognizable things around you. Things like 'cellphone', 'water bottle' and 'remote control' usually work well.