Choose the better drawing to find out the best drawings in the QuickDraw dataset. It is running at https://andri.io/quickdrawbattle/.
Made with:
- Python 3.7
- Flask
- Flask-SQLAlchemy and PostgreSQL
- quickdraw
- VanillaJS
Google collected over 50 million drawings with the game Quick, Draw!. They released the dataset for everyone to use, but most of the drawings are either incomplete or just bad. Let's sort out the best ones together and create a dataset of good drawings!
You are given 2 random drawings of a random category and you choose which is better. The drawings are then sorted based on the votes and we can see the best ones!
Since there are so many drawings, it would take a long time for even one drawing to be voted on twice and we would probably never get usable results. For that reason, there are a maximum of 25 drawings up for battle per category. They will be replaced once they have been voted on 20 times. Some categories have more than 25 drawings right now, because there used to be no limit.
The score is calculated using a lower bound of Wilson score confidence interval for a Bernoulli parameter. During score calculation, every drawing gets one invisible win, so the score of drawings with no wins is not 0 and they can be compared. The scores are also normalized to a range from 0 to 1. Table of all possible scores.
You can see the results on the ranking page. To get usable data, you can GET them from /api/get_ranking. You probably want to get the key_ids from here and find the strokes from the full dataset. You can also get the strokes from here if you enable the strokes parameter, but they are in lists of coordinate pairs instead of 2 lists of x and y.
Parameters:
- category - which category the drawings will be from
- order - use "ascending" to get ascending order
- strokes - use "true" to get strokes in lists of strokes which are lists of coordinate pairs
- limit - how many drawings to return, default 25, max 1000
- offset - how many drawings to skip
- votemin - the minimum amount of votes for a drawing
Example requests:
- Get all sea turtles with at least 5 votes: /api/get_ranking?category=sea turtle&votemin=5
- Get 100 drawings with strokes: /api/get_ranking?limit=100&strokes=true
- Skip the first 100 drawings and get 100 drawings: /api/get_ranking?offset=100&limit=100
- Clone this repo.
- Set up postgresql and change the database uri in
app.cfg
. mkdir quickdraw_dataset_bin
gsutil -m cp "gs://quickdraw_dataset/full/binary/*.bin" quickdraw_dataset_bin
(warning, downloads 5+ GiB of quickdrawings)- If you don't have
gsutil
, install it usingcurl https://sdk.cloud.google.com | bash
or read here. - If you have the dataset somewhere else, change the
dataset_dir
value inconfig.ini
.
- If you don't have
python3 -m venv quickdrawbattleenv
source quickdrawbattleenv/bin/activate
pip3 install -r requirements.txt
python3 dbinit.py
python3 app.py
, serve with uwsgi and nginx (guide).