How iago-sepini/desenha_ai works
Desenha AI recognizes a child’s drawing from a camera, explains it through an LLM and speech, and can reproduce its outline on a CNC. The main loop also supports voice control, free-play and timed drawing challenges, plus a state-driven animated face. The README describes these as parallel recognition outputs; the sampled manager code confirms the SVG generation and LLM path. Some integrations—especially CNC execution and voice-to-face wiring—are documented but not fully visible in the sampled runtime excerpts.
Main entry points: main.py Application loop · manager.py Game manager · watcher.py Drawing watcher · llm.py Groq assistant
Components 22
Drawing recognition
- Drawing watcher
vision/watcher.py - Camera setup
vision/config_camera.py - Drawing detector
vision/detector.py - Class names
vision/classes_quickdraw.py - Model training
vision/treinar.py - SVG exporter
vision/svg_export.py
Interaction and state
- Application loop
main.py - Game manager
ui/manager.py - Shared state
server/state.py - Animated face
ui/face.py - CNC confirmation
ui/dialogs.py - Voice commands
voice/listener.py - Whisper listener
voice/listener_Whisper.py
AI and speech
- Prompt rules
ai/prompts.py - Groq assistant
ai/llm.py - Piper synthesis
voice/tts.py - Speech playback
voice/speaker.py - Text utilities
voice/text_utils.py
Physical output
- CNC controller
firmware/cnc.py
Runtime support
- Runtime config
config.py - Answer cache
data/cache/respostas.json
Other components
- Visitor
Connections 23
- Visitor → Application loop: interacts with
README.md - Application loop → Drawing watcher: starts
main.py - Drawing watcher → Camera setup: opens camera
vision/watcher.py - Drawing watcher → Drawing detector: detects drawings
vision/watcher.py - Model training → Class names: uses categories
vision/treinar.py - Drawing watcher → Game manager: reports drawing
main.py - Game manager → SVG exporter: exports outline
ui/manager.py - Game manager → Groq assistant: requests description
ui/manager.py - Groq assistant → Prompt rules: builds prompt
ai/llm.py - Application loop → Voice commands: starts listener
main.py - Voice commands → Application loop: sends commands
README.md - Application loop → Speech playback: sets up playback
main.py - Speech playback → Piper synthesis: synthesizes speech
voice/speaker.py - Speech playback → Text utilities: uses utilities
voice/speaker.py - Application loop → Shared state: creates state
main.py - Animated face → Shared state: reads state
ui/face.py - Game manager → Shared state: updates state
ui/manager.py - Application loop → Animated face: starts display
main.py - Application loop → Game manager: creates manager
main.py - Application loop → CNC confirmation: imports dialog
main.py - SVG exporter → CNC controller: sends outline
README.md - Application loop → Runtime config: loads settings
main.py - Groq assistant → Answer cache: reads and writes
ai/llm.py