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
- 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 (
.npyand.ndjson). - Includes a Godot app for human testing on the web or Chromebook.
git clone https://github.com/beluga-studios/doodle-cnn.git
cd doodle-recognition-ai/main/Make sure you have Python 3.9+ and pip. Then run:
pip install -r requirements.txtIf you donโt have a requirements.txt, use:
pip install tensorflow numpy matplotlib ndjsonIf you're using ndjson vector files:
pip install ndjsonRun this and in about 5 minutes you should see results if it worked:
python tests/MNIST_cnn.pyFirst 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.pyFor the Godot human test:
python human-test/download_vectors.py.py 10 # Change 10 to how much images you want from each categoryTo train the model:
python main/doodle_cnn.py- The model is saved as
doodle_model.h5.
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.
For Chromebook or web testing, open the human-test/ folder in Godot (v4.x).
- If you havent already, run this:
python human-test/download_vectors.py.py 10 # Change 10 to how much images you want from each categoryand make sure .ndjson files are inside res://images/.
- Run the project (
โ+Bon Mac) to begin testing. - Shows a vector image, lets user guess, and tracks accuracy.
- Write down what accuracy they got.
MIT License. Feel free to use and modify for your experiments or projects!
Beluga Studios โ experimental games and AI tools