Project Info
Inspiration
U.S. Colleges and Universities produce over 22 million pounds of food waste annually, with the average student producing 142 pounds of food waste per year. This is substantial waste, and with studies showing that 30-40% of students experience food insecurity, it is simply unacceptable to let all of this high-quality food go to complete waste. Furthermore, that 22 million pounds also contributes to methane emissions on the order of 55 million additional pounds of greenhouse gases. We believe that this issue can be addressed.
What it does
Savor is an AI-powered plate waste analytics and supply optimization platform that transforms any camera into a food waste management system. Our product identifies the quantity and makeup of food waste by college students. We leverage a camera mounted above the food deposit zone, which segments the plate into its constituent food groups. We approximate the quantity of each different food left on the plate before it is deposited into the trash can. This gives us a viable reading on the precise amount of waste being produced and specifically which foods are producing the most waste, so that a university can adjust its budgeting accordingly. Waste information is then processed in our cloud analytics engine, providing critical long-term tracking information, recommended budgeting updates in accordance with individual waste statistics for all food types, and providing rewards for students who minimize their food waste. How it works in flow: Waste Recognition: When students scrape their plates at the waste station, our camera captures the plate. The image is sent to our detection layer, a QWEN computer vision model hosted on Modal running on GPU infrastructure, which identifies and quantifies wasted items in real-time with 95%+ accuracy. We input menu context via OpenAI API to understand what specific dishes are being wasted, then store everything in our database. Waste Analytics Dashboard: Every data point feeds into our cloud analytics engine, generating charts and catalog rankings of the most wasted items. Dining managers get instant visibility into waste trends by time, day, and dish-visualized in an intuitive dashboard. Smart Procurement Engine: Our linear regression model learns waste patterns and predicts optimal order quantities for each menu item. The system ranks dishes by waste probability and suggests precise purchasing adjustments. Managers can approve orders with one click or use our voice-enabled Savor agent to reorder hands-free. Provides Incentives for Students to Reduce Waste: We offer rewards to students in the form of cashback if they do not produce any waste! Essentially, when students purchase a meal in the dining hall, they are essentially putting up a deposit, which will get repaid in accordance with how much waste they create in that dining hall session. Features Detects food waste from live camera frames using OpenAI vision analysis. Prevents duplicate detections using SSIM + cooldown checks. Stores events in SQLite and generates aggregate stats. Streams live camera and scanner overlays (MJPEG endpoints). Tracks student credit scans with barcode/OCR and leaderboard ranking. Incentivizes students to waste less by rewarding them for consistently cleaning their plates. Syncs Stanford dining hall menus (all halls, all meals, 3-day window with fallback) into JSON. Produces historical waste inventory datasets for dashboard charts. Generates smart-shopping recommendations using linear regression predictions. Includes an ordering chat assistant endpoint. Supports Whisper transcription and Google TTS for voice experiences. Tech Stack Backend: FastAPI, Uvicorn, SQLite, OpenCV, OpenAI SDK, httpx, BeautifulSoup. Frontend: React 19 + Vite, Recharts, Three.js/react-three-fiber. Data: JSON inventory files + SQLite event/credits tables. What we Learned Tech & Development framework: Real-time AI systems need explicit fallback paths (timeouts, forced cadence, restart logic) to handle edge cases gracefully. UX clarity matters as much as model quality for operational adoption; beautiful ML means nothing if operators can't onboard and integrate it. Sustainability understanding: After talking to TreeHacks mentors, we realized how our solution can serve both B2B (dining institutions) and B2C (dining hall customers). This exactly reminded us how we should better reduce food waste from both the demand and supply side, as institutions need procurement optimization and students need behavioral incentives. Team collaboration: We understand the importance of working as a team, not just physically sitting together side by side, but granting enough trust and responsibility to work towards the same goal. What it Enables Savor prevents waste through carefully designed incentive structures. By giving dining halls the power to forecast demand accurately, control portions based on real data, and implement just-in-time shopping planning. It enables: Cost reduction through optimized purchasing and reduced over-preparation Sustainability impact with measurable waste reduction tied to institutional goals Behavioral change through student incentives that make sustainability rewarding for students Data-driven operations replacing guesswork with actionable analytics Unlike expensive hardware solutions that cost $100K+, Savor is a lightweight, camera-only SaaS platform that's flexible, easy to deploy, and affordable for any institution.
Challenges we ran into
Camera backend instability and frame-grab failures on Windows- getting reliable real-time plate captures proved harder than expected Preventing false duplicates while still producing near-live updates without overwhelming the system Keeping AI calls fast enough for operational use while controlling noisy triggers that could spike costs Ensuring smooth mode transitions between credits scanning and food-waste analysis without breaking the detection pipeline Designing dense dashboards that fit high-value information in one screen without clutter balancing data richness with visual clarity
What's next
Vision modules for people to deploy at their own homes Pilot deployment at Stanford dining halls to validate real-world performance Expand ML model to recognize more food types and handle edge cases Develop a mobile app for users to track their personal waste reduction and earnings Build deeper integrations with food service procurement systems Outreach and partner with additional universities and institutional dining providers Add predictive features for menu planning based on historical trends and external factors (weather, events, etc.)
Savor
Savor is a real-time food waste intelligence platform for dining operations. It combines camera-based waste detection, inventory/menu sync, historical analytics, student credits tracking, and an ordering assistant into one full-stack application.
What It Does
- Detects food waste from live camera frames using OpenAI vision analysis.
- Prevents duplicate detections using SSIM + cooldown checks.
- Stores events in SQLite and generates aggregate stats.
- Streams live camera and scanner overlays (MJPEG endpoints).
- Tracks student credit scans with barcode/OCR and leaderboard ranking.
- Syncs Stanford dining hall menus (all halls, all meals, 3-day window with fallback) into JSON.
- Produces historical waste inventory datasets for dashboard charts.
- Generates smart-shopping recommendations using linear regression predictions.
- Includes an ordering chat assistant endpoint.
- Supports Whisper transcription and Google TTS for voice experiences.
Tech Stack
- Backend: FastAPI, Uvicorn, SQLite, OpenCV, OpenAI SDK, httpx, BeautifulSoup.
- Frontend: React 19 + Vite, Recharts, Three.js/react-three-fiber.
- Data: JSON inventory files + SQLite event/credits tables.
Repository Layout
savor/
backend/
main.py # FastAPI app and background loops
analyzer.py # GPT-based plate and card analysis
stanford_inventory.py # Stanford menu sync + caching
database.py # SQLite queries + historical inventory builder
config.py # Central environment config
requirements.txt # Python dependencies
frontend/
src/App.jsx # Main UI routes/pages
src/api.js # Backend API wrappers
package.json # Frontend scripts/deps
README.md # Single project documentation source
Frontend Pages
/Live Tracking/dashboardDashboard/reportsReports/creditsCredits/smart-shoppingSmart Commerce/menuMenu Operations/inventoryInventory
Backend API
Camera and system
GET /api/video_feedPOST /api/camera/startPOST /api/camera/stopPOST /api/system/reactivateGET /api/status
Waste and inventory analytics
GET /api/eventsGET /api/statsGET /api/inventory-historyGET /api/inventoryPOST /api/inventory/refreshGET /api/smart-shopping
Credits scanner
GET /api/credits/statusPOST /api/credits/scanner/startPOST /api/credits/scanner/stopGET /api/credits/video_feedGET /api/credits/leaderboard
Ordering and voice
POST /api/order-chatPOST /api/order-chat/greetingPOST /api/transcribePOST /api/tts
Environment Variables
Create a root .env file (same level as this README).
Required
OPENAI_API_KEY- required for vision analysis and transcription endpoint.
Optional (backend behavior)
CAMERA_INDEX(default0)CAMERA_BACKEND(defaultdshowon Windows,defaultotherwise; usedshowto avoid MSMF grab warnings)CAPTURE_INTERVAL(default3.0)ANALYSIS_FORCE_INTERVAL_SECONDS(default8.0; forces periodic analysis even without large scene change)ANALYSIS_REQUEST_TIMEOUT_SECONDS(default22.0; max wait per OpenAI vision call)SSIM_THRESHOLD(default0.85)COOLDOWN_SECONDS(default10)GOOGLE_TTS_API_KEY(required only if using/api/tts)
Optional (Stanford menu sync)
STANFORD_DINING_MENU_URL(defaulthttps://rdeapps.stanford.edu/dininghallmenu/)STANFORD_DINING_HALL(defaultWilbur)STANFORD_DINING_MEAL(defaultLunch)STANFORD_DINING_DAY_OFFSET(default0)
Legacy (currently unused by menu sync)
BRIGHTDATA_API_KEYBRIGHTDATA_BROWSER_WSS
Local Development
1) Backend
cd backend
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000
2) Frontend
cd frontend
npm install
npm run dev
Vite runs on http://localhost:5173 and calls backend http://localhost:8000 through /api/*.
Data and Outputs
backend/vision_bin.db- waste events + student credits.backend/food_inventory.json- aggregate inventory summary.backend/food_inventory_historical.json- chart-friendly historical dataset.backend/stanford_inventory.json- latest Stanford menu sync payload.
Notes
- Inventory sync now uses direct HTTP form postbacks (no browser automation required).
/api/inventory/refreshforces a live menu sync and bypasses cache.- If Stanford does not expose full past dates, sync includes fallback window metadata in JSON.
- Backend startup auto-seeds demo rows if
backend/vision_bin.dbhas zerowaste_events, so analytics pages never start from a fully empty DB.
Analysis
View
Metric
- 16
- 3
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- Tailwind CSSIn code
- SQLClaimed
- TypeScriptClaimed
8 of 10 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
396 KB
Source files
27
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Deanbarrow10/savor
53 files · 49.5 MB · @ 4ad633c
Structure
Interface
9 files · 17%Screens, components and styles rendered to the user.
Application logic
19 files · 36%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- JavaScript38%
- Python38%
- CSS12%
- HTML10%
- Markdown1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
frontend/package.json
npm · 16- @react-three/fiber
- react
- react-dom
- recharts
- three
- +11 more
backend/requirements.txt
pypi · 10- beautifulsoup4
- fastapi
- httpx
- openai
- opencv-python
- Pillow
- python-dotenv
- python-multipart
- scikit-image
- uvicorn[standard]
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.