QuickDraw

Dec 27, 2020 | Data Science

GitHub stars
GitHub forks
GitHub license

Introduction

Welcome to the world of QuickDraw! This innovative online game, developed by Google, allows users to express their creativity and skills in a fun way. With my Python source code, you’re able to:

  • Run an app that enables you to draw in front of a camera (using your laptop’s webcam, by default).
  • Run an app that allows you to draw on a canvas.

Camera App

To jumpstart your drawing experience, you will need:

  • A pen or any object that is blue, red, or green in color.

Here’s how the camera app works:

  • When the colored pen (or object) appears in front of the camera, it is highlighted with a yellow circle.
  • Press the space button to start drawing.
  • Press the space button again to stop drawing.

Below is a demo showing how the camera app works:


Camera app demo

Drawing App

The script and demo for the drawing app will be released soon, so stay tuned!

Dataset

The dataset used for training my model can be found at Quick Draw dataset. In this version, I selected 20 files corresponding to 20 different categories.

Categories

Below is a table showing the 20 categories my model includes:

apple book bowtie candle
cloud cup door envelope
eyeglasses guitar hammer hat
ice cream leaf scissors star
t-shirt pants lightning tree

Trained Models

You can access my trained model at trained_models/whole_model_quickdraw.

Training

To successfully train your model, follow these steps:

  • Download the npz files corresponding to the 20 classes and store them in the data folder.
  • If you wish to train your model with different categories, simply change the constant CLASSES in the src/config.py file.
  • Run the command: python3 train.py.

Experiments

For each class, I took the first 10,000 images and split them into training and test sets in an 8:2 ratio. The performance of the model is represented in the training/testing loss and accuracy curves below:

Requirements

Before you get started, ensure you have the following packages installed:

  • python 3.6
  • cv2
  • pytorch
  • numpy

Troubleshooting

If you encounter any issues while running QuickDraw:

  • Ensure your webcam is functional and that it can detect the pen correctly.
  • Verify that you have all the required packages installed. You can check this via your terminal or command prompt.
  • If the training script doesn’t run, double-check that the data folder contains the necessary npz files.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox