How movenb3at/snap-pocket works
SnapPocket is a Flask-based AI photobooth: a browser captures a photo, selects a transformation, polls queued processing, then finalizes and delivers a framed or unframed image by QR/download. It also provides coin controls and a protected admin dashboard. The README documents local YOLO/OpenCV filters, Stable Diffusion, folder monitoring, and Cloudflare access; the sampled backend excerpt confirms some processing and coin/finalization behavior, but not route wiring or most integrations, so those links are omitted rather than inferred.
Main entry points: index.html Capture UI · app.py Flask API · public Final images · download.html Photo download
Components 20
Capture and delivery
- Capture UI
templates/index.html - UI motion
static/pocket-motion.js - Photo download
templates/download.html
Application services
- Flask API
app.py - Device coin state
app.py - Queued processing
app.py - Task status
app.py - Finalize and QR
app.py
Image processing
- Captured images
temp - Local filters
app.py - YOLO weights
models/mosaic - Photo framing
app.py - Transform previews
static/preview - Final images
public - QR images
static/qr
Operations and access
- Admin dashboard
templates/admin.html - Folder monitoring
app.py
Other components
- Camera guest
- Stable Diffusion
- Cloudflare tunnel
Connections 21
- Camera guest → Capture UI: captures with
README.md - Capture UI → Flask API: uploads to
README.md - Flask API → Device coin state: tracks balances
app.py - Flask API → Captured images: stores capture
- Flask API → Queued processing: queues work
README.md - Queued processing → Stable Diffusion: runs img2img
README.md - Queued processing → Local filters: runs local filters
README.md - Local filters → YOLO weights: loads face weights
README.md - Queued processing → Transform previews: writes previews
README.md - Capture UI → Task status: polls task
README.md - Task status → Capture UI: returns state
README.md - Capture UI → Finalize and QR: requests finalization
README.md - Finalize and QR → Photo framing: applies optional frame
app.py - Finalize and QR → Final images: writes image
README.md - Finalize and QR → QR images: generates QR
README.md - Final images → Photo download: serves attachment
README.md - Camera guest → Photo download: scans QR
README.md - Admin dashboard → Flask API: manages devices
README.md - Flask API → Folder monitoring: monitors folders
README.md - Camera guest → Cloudflare tunnel: accesses remotely
- Capture UI → UI motion: animates controls