Skip to content

Beluga-Studios/DoodleCNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DoodleCNN

doodle recognation code that uses the Quick, Draw! Dataset to geuss doodles. its for a science fair

This is a human vs AI guessing game based on hand-drawn doodles from the Quick, Draw! dataset. It tests whether humans or AI are better at recognizing simple sketches.

Note: This only works on Mac


๐Ÿ“ฆ Features

  • Trains a Convolutional Neural Network (CNN) on selected categories.
  • Saves the trained model for reuse.
  • Includes a human test mode to guess drawings and compare against the AI.
  • Scripts to download both raster and vector-based QuickDraw data (.npy and .ndjson).
  • Includes a Godot app for human testing on the web or Chromebook.

๐Ÿ”ง Setup Instructions

1. Clone the Repository

git clone https://github.com/beluga-studios/doodle-cnn.git
cd doodle-recognition-ai/main/

2. Install Python Dependencies

Make sure you have Python 3.9+ and pip. Then run:

pip install -r requirements.txt

If you donโ€™t have a requirements.txt, use:

pip install tensorflow numpy matplotlib ndjson

If you're using ndjson vector files:

pip install ndjson

4. Test with MNIST dataset

Run this and in about 5 minutes you should see results if it worked:

python tests/MNIST_cnn.py

4. Download Data

First go to categories.txt and delete all the categories you dont want. we suggest only keeping a few unless you want to wait 15 hours. DO NOT EDIT THE FILE AFTER YOU HAVE STARTED RUNNING THE SCRIPTS

You can download .npy (bitmap, for the AI) or .ndjson (vector, for the Godot human test) data files from the QuickDraw dataset. To download selected categories

For the AI:

python main/download_npy_categories.py

For the Godot human test:

python human-test/download_vectors.py.py 10 # Change 10 to how much images you want from each category

๐Ÿค– Training the AI

To train the model:

python main/doodle_cnn.py
  • The model is saved as doodle_model.h5.

๐Ÿง  Predict Using Trained Model

To test an image from the dataset and compare against AI:

python main/predict_uploaded_image.py
  • Loads a 28x28 grayscale image and shows AI's top guesses.

๐Ÿ•น๏ธ Human Testing in Godot

For Chromebook or web testing, open the human-test/ folder in Godot (v4.x).

Godot App Setup

  • If you havent already, run this:
python human-test/download_vectors.py.py 10 # Change 10 to how much images you want from each category

and make sure .ndjson files are inside res://images/.

  • Run the project (โŒ˜+B on Mac) to begin testing.
  • Shows a vector image, lets user guess, and tracks accuracy.
  • Write down what accuracy they got.

๐Ÿ“œ License

MIT License. Feel free to use and modify for your experiments or projects!


โœ๏ธ Made by

Beluga Studios โ€” experimental games and AI tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages