PrototypeHackathon AI game backend / 2025
Problem
A drawing game needs fast sketch recognition and scoring that reflects time and prediction quality.
Solution
Build two FastAPI routes: one decodes base64 sketches, preprocesses them into 28x28 grayscale inputs, and calls a CNN; the other builds a 61-value observation and calls a PPO model.
Key Features
FastAPI app with routed sketch prediction and score endpoints
Base64 sketch decoding from the Flutter canvas export flow
Image preprocessing pipeline: grayscale conversion, drawing-area crop, aspect-preserving resize, and 28x28 padding
CNN sketch guess model trained on a Quick, Draw-style class subset with top prediction output
Gymnasium environment and PPO scoring model using timing, similarity sequence, and previous-score context
Flutter mobile surfaces for onboarding, mode selection, drawing, prediction, Firebase-backed sessions, and chat/game flow
Next.js landing repository that gives the prototype a product-facing presentation layer
Architecture Map
Mermaid
flowchart LR Player["Mobile player"] --> Mobile["Flutter Drawzy app"] Mobile --> Canvas["Sketch canvas and game modes"] Canvas --> GuessRoute["FastAPI predict sketch route"] GuessRoute --> ImagePrep["Decode base64, crop, resize, pad"] ImagePrep --> GuessModel["CNN sketch guess model"] GuessModel --> Predictions["Class label and top five guesses"] Mobile --> ScoreRoute["FastAPI score route"] ScoreRoute --> Observation["Similarity timeline plus previous score"] Observation --> ScoreModel["PPO scoring model"] ScoreModel --> RoundScore["Round score"] Mobile --> Firebase["Firebase app services"] Landing["Next.js landing page"] --> Mobile