All Projects → googlecreativelab → Teachable Machine Boilerplate

googlecreativelab / Teachable Machine Boilerplate

Licence: apache-2.0
Boilerplate code for Teachable Machine

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Teachable Machine Boilerplate

Docker Django
A complete docker package for deploying django which is easy to understand and deploy anywhere.
Stars: ✭ 378 (-15.81%)
Mutual labels:  boilerplate
React Social Network
Simple React Social Network
Stars: ✭ 409 (-8.91%)
Mutual labels:  boilerplate
Tads Boilerplate
Terraform + Ansible + Docker Swarm boilerplate = DevOps on 🔥🔥🔥 | Infrastructure as Code
Stars: ✭ 424 (-5.57%)
Mutual labels:  boilerplate
Generator Babel Boilerplate
A Yeoman generator to author libraries in ES2015 (and beyond!) for Node and the browser.
Stars: ✭ 380 (-15.37%)
Mutual labels:  boilerplate
Graphql Dataloader Boilerplate
Very simple boilerplate using GraphQL and DataLoader
Stars: ✭ 405 (-9.8%)
Mutual labels:  boilerplate
Flasksaas
A great starting point to build your SaaS in Flask & Python, with Stripe subscription billing 🚀
Stars: ✭ 412 (-8.24%)
Mutual labels:  boilerplate
Superplate
Performance-oriented frontend application creator with popular tools.
Stars: ✭ 368 (-18.04%)
Mutual labels:  boilerplate
Bash Boilerplate
A collection of Bash scripts for creating safe and useful command line programs.
Stars: ✭ 447 (-0.45%)
Mutual labels:  boilerplate
Webpack Boilerplate
A minimal webpack 5 boilerplate with only Babel, SASS and lodash (optional) on board
Stars: ✭ 404 (-10.02%)
Mutual labels:  boilerplate
Electron React Typescript
Electron boilerplate with React, Redux, and TypeScript
Stars: ✭ 423 (-5.79%)
Mutual labels:  boilerplate
Express Rest Api Boilerplate
Express REST API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 384 (-14.48%)
Mutual labels:  boilerplate
Motherplate
A bare bones responsive SCSS boilerplate for web designers
Stars: ✭ 392 (-12.69%)
Mutual labels:  boilerplate
Wordpress Plugin Boilerplate Powered
Wordpress Plugin Boilerplate but Powered with examples and a generator!
Stars: ✭ 413 (-8.02%)
Mutual labels:  boilerplate
React Mobx Typescript Boilerplate
A bare minimum frontend boilerplate with React 16.7, Typescript 3.2 and Webpack 4
Stars: ✭ 378 (-15.81%)
Mutual labels:  boilerplate
Koa Boiler
Koa 2.7 boilerplate for a production-ready Node.js app with async/await.
Stars: ✭ 426 (-5.12%)
Mutual labels:  boilerplate
Go Project Blueprint
Blueprint/Boilerplate For Golang Projects
Stars: ✭ 376 (-16.26%)
Mutual labels:  boilerplate
Cucumber Boilerplate
Boilerplate project to run WebdriverIO tests with Cucumber
Stars: ✭ 411 (-8.46%)
Mutual labels:  boilerplate
React Starter Kit
React Starter Kit — front-end starter kit using React, Relay, GraphQL, and JAM stack architecture
Stars: ✭ 21,060 (+4590.42%)
Mutual labels:  boilerplate
Create Graphql
Command-line utility to build production-ready servers with GraphQL.
Stars: ✭ 441 (-1.78%)
Mutual labels:  boilerplate
Koa Rest Api Boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (-6.46%)
Mutual labels:  boilerplate

Teachable Machine Boilerplate

This is a small boilerplate project that demonstrates how to use tensorflow.js to create projects like Teachable Machine. The code shows how you can create a KNN classifier that can be trained live in the browser on a webcam image. It is intentionally kept very simple so it can provide a starting point for new projects.

Behind the scenes, the image from the webcam is being processed by an activation of MobileNet. This network is trained to recognize all sorts of classes from the imagenet dataset, and is optimized to be really small, making it useable in the browser. Instead of reading the prediction values from the MobileNet network, we instead take the second to last layer in the neural network and feed it into a KNN (k-nearest neighbors) classifier that allows you to train your own classes.

The benefit of using the MobileNet model instead of feeding the pixel values directly into the KNN classifier is that we use the high level abstractions that the neural network has learned in order to recognize the Imagenet classes. This allows us with very few samples to train a classifier that can recognize things like smiles vs frown, or small movements in your body. This technique is called Transfer Learning.

Tensorflow has a built in model for doing this. It's called the KNN Classifier, and this boilerplate code shows how to easily use it.

Use code

To use the code, first install the Javascript dependencies by running

npm install

Then start the local budo web server by running

npm start

This will start a web server on localhost:9966. Try and allow permission to your webcam, and add some examples by holding down the buttons.

Quick Reference - KNN Classifier

A quick overview of the most important function calls in the tensorflow.js KNN Classifier.

  • knnClassifier.create(): Returns a KNNImageClassifier.

  • .addExample(example, classIndex): Adds an example to the specific class training set.

  • .clearClass(classIndex): Clears a specific class for training data.

  • .predictClass(image): Runs the prediction on the image, and returns an object with a top class index and confidence score.

See the full implementation here

Quick Reference - MobileNet

A quick overview of the most important function calls we use from the tensorflow.js model MobileNet.

  • .load(): Loads and returns a model object.

  • .infer(image, endpoint): Get an intermediate activation or logit as Tensorflow.js tensors. Takes an image and the optional endpoint to predict through.

See the full implementation here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].