How shreyas-sv1/nutrivision-ai works
AI Fitness Analyzer accepts food photos for classification and nutrition estimates, and body-view photos plus demographics for body-fat and composition analysis. The React app exposes food analysis and a history dashboard; FastAPI routes coordinate model inference, nutrition lookup, and body-fat persistence. README-documented capabilities are included, but frontend API wiring and dashboard data sources are not fully evidenced by the sampled excerpts, so those links are limited.
Main entry points: food_routes.py Food endpoints · App.jsx App routes · FoodUpload.jsx Food upload · main.py FastAPI app
Components 17
Web app
- App routes
frontend/src/App.jsx - Food upload
frontend/src/components/FoodUpload.jsx - History dashboard
frontend/src/components/Dashboard.jsx - API client
frontend/src/api.js
API layer
- FastAPI app
backend/app/main.py - Food endpoints
backend/app/routes/food_routes.py - Body-fat endpoint
backend/app/routes/bodyfat_routes.py
Food analysis
- Food classifier
backend/app/models/food_model.py - Classifier weights
ml_models/food_classifier/food_classifier.pth - Nutrition lookup
backend/app/services/nutrition_service.py - Nutrition records
backend/app/data/nutrition_db.json
Body analysis
- Body-fat analysis
backend/app/services/bodyfat_service.py - Regression weights
ml_models/bodyfat_regression/bodyfat_model.pkl - Pose landmarks
ml_models/pose_landmarker_heavy.task
Data and history
- Database access
backend/app/database/db.py - Prediction store
Other components
- User
Connections 18
- User → App routes: uses
- App routes → Food upload: routes to
- App routes → History dashboard: routes to
- Food upload → API client: requests analysis
- API client → FastAPI app: sends API requests
- FastAPI app → Food endpoints: dispatches food
- FastAPI app → Body-fat endpoint: dispatches body-fat
- Food endpoints → Food classifier: runs inference
- Food classifier → Classifier weights: loads weights
- Food endpoints → Nutrition lookup: looks up nutrients
- Nutrition lookup → Nutrition records: reads
- Food endpoints → API client: returns estimates
- Body-fat endpoint → Body-fat analysis: requests analysis
- Body-fat analysis → Regression weights: loads model
- Body-fat analysis → Pose landmarks: detects landmarks
- Body-fat endpoint → Database access: saves prediction
- Database access → Prediction store: writes body-fat record
- Food upload → History dashboard: records local history