Giter VIP home page Giter VIP logo

doodlenet's Introduction

DoodleNet

This is a series of experiments I did about Doodle Classifier(a Convolutional Neural Network) using tensorflow.js and tensorflow. The data I used is from Quickdraw dataset.

Here are a list of the projects -

  1. Train a doodle classifier with tf.js
  2. Train a doodle classifier with 345 classes
  3. KNN doodle classifier

Credits: Big thanks to @zaidalyafeai's sketcher google colab for training.

1. Train a doodle classifier with tf.js

I trained a doodle classifier with 3 classes(bowtie, lollipop, rainbow) in the browser using tfjs' layers API and tf.js-vis. The code is based on tf.js Example - Training MNIST.

Try a live demo here.

Once you open the webpage, wait until the page load the data, train the model, evaluate the model. It will download two files: myDoodleNet.json and myDoodleNet.weights.bin. To test this model your self, you can load these two files back, and click on 'load model' button, then draw sth on the canvas, hit 'Guess' button to let model start guessing the drawing.

2. Train a doodle classifier with 345 classes

It's trained on all 345 categories from Quickdraw dataset, 50k images per class. It's trained with tensorflow, and ported to tf.js in the browser. Here is the training notebook.

This notebook is heavily based on @zaidalyafeai's Sketcher notebook on 100 classes. I expanded the data to 345 classes and added a few layers to improve the accurary on 345 classes.

I used spell.run's remote GPU machine with big RAM to load all the data and train the model.

Try a live demo here.

3. KNN doodle classifier: Customizable doodle classes

Based on the previous doodle classifier of 345 classes, I added KNN classifier to it, so people can customize their own doodle classes.

Try a live demo here.

You can draw 10+ circles and add them to class A, and draw 10+ lines and add them to class B, then let the model to guess your new drawing. You can define any other classes, it doesn't need to be circles or squares.

Get started

To run each examples locally, open your terminal, type in the following commands:

$ git clone https://github.com/yining1023/doodleNet.git
$ cd doodleNet
$ python -m SimpleHTTPServer     # $ python3 -m http.server (if you are using python 3)

Go to localhost:8000/demo in your browser, you will see a directory list like this:

  • DoodleClassifier_345/
  • DoodleClassifier_KNN/
  • TrainDoodleClassifier/

Click into each example to see the demo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.