Skip to content

Commit cdd9a38

Browse files
committed
Initial release: GemYum - On-device AI Nutrition Tracking
Kaggle Gemma Sprint 2025 Competition Submission Features: - On-device Gemma 3n model for food recognition - Comprehensive nutrition database (700+ foods) - Glycemic index tracking for diabetes management - Privacy-first design with no cloud dependencies - Health Connect integration - GPU-accelerated inference Technical Stack: - Android (Kotlin) - TensorFlow Lite - Jetpack Compose - SQLite database This submission demonstrates practical edge AI applications in health and wellness, running large language models entirely on-device for privacy and offline capability.
0 parents  commit cdd9a38

138 files changed

Lines changed: 20971 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copy this to .env and configure for your environment
2+
3+
# Build Configuration
4+
BUILD_TYPE=debug
5+
ENABLE_PROGUARD=false
6+
7+
# Model Configuration
8+
MODEL_PATH=models/
9+
USE_BUNDLED_MODELS=false
10+
11+
# Database
12+
DB_PATH=app/src/main/assets/databases/nutrients.db
13+
BUILD_DB_FROM_SOURCE=true
14+
15+
# Optional: Add your own API keys here
16+
# USDA_API_KEY=your_key_here
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Build and Deploy Nutrition Database
2+
3+
on:
4+
push:
5+
paths:
6+
- 'scripts/build_comprehensive_nutrients_db.py'
7+
- '.github/workflows/build-nutrition-database.yml'
8+
workflow_dispatch:
9+
inputs:
10+
force_rebuild:
11+
description: 'Force rebuild even if no changes'
12+
required: false
13+
default: false
14+
type: boolean
15+
16+
jobs:
17+
build-database:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install requests
33+
34+
- name: Build nutrition database
35+
run: |
36+
cd scripts
37+
python build_comprehensive_nutrients_db.py --output-dir ../build/databases
38+
39+
- name: Upload database artifacts
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: nutrition-databases
43+
path: |
44+
build/databases/*.db
45+
build/databases/*.db.gz
46+
build/databases/*.json
47+
retention-days: 30
48+
49+
- name: Calculate checksums
50+
run: |
51+
cd build/databases
52+
sha256sum *.db *.db.gz > checksums.txt
53+
cat checksums.txt
54+
55+
# Deploy to your CDN/hosting service
56+
# Example using AWS S3:
57+
- name: Configure AWS credentials
58+
if: github.ref == 'refs/heads/main'
59+
uses: aws-actions/configure-aws-credentials@v2
60+
with:
61+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
62+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
63+
aws-region: us-east-1
64+
65+
- name: Deploy to S3
66+
if: github.ref == 'refs/heads/main'
67+
run: |
68+
aws s3 sync build/databases/ s3://your-bucket/gemmunch/ \
69+
--exclude "*" \
70+
--include "*.db.gz" \
71+
--include "*.json" \
72+
--include "checksums.txt" \
73+
--cache-control "max-age=86400"
74+
75+
# Alternative: Deploy to GitHub Releases
76+
- name: Create Release
77+
if: github.ref == 'refs/heads/main'
78+
uses: actions/create-release@v1
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
with:
82+
tag_name: db-v${{ github.run_number }}
83+
release_name: Nutrition Database v${{ github.run_number }}
84+
body: |
85+
Automated nutrition database build.
86+
87+
## Files
88+
- `nutrients.db.gz` - Full database (compressed)
89+
- `nutrients_lite.db.gz` - Lite database (compressed)
90+
- `nutrients_manifest.json` - Version manifest
91+
- `checksums.txt` - SHA256 checksums
92+
draft: false
93+
prerelease: false
94+
95+
- name: Upload Release Assets
96+
if: github.ref == 'refs/heads/main'
97+
uses: actions/upload-release-asset@v1
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
with:
101+
upload_url: ${{ steps.create_release.outputs.upload_url }}
102+
asset_path: ./build/databases/nutrients.db.gz
103+
asset_name: nutrients.db.gz
104+
asset_content_type: application/gzip

.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Built application files
2+
*.apk
3+
*.aar
4+
*.ap_
5+
*.aab
6+
7+
# Files for the ART/Dalvik VM
8+
*.dex
9+
10+
# Java class files
11+
*.class
12+
13+
# Generated files
14+
bin/
15+
gen/
16+
out/
17+
release/
18+
19+
# Gradle files
20+
.gradle/
21+
build/
22+
23+
# Local configuration files (NEVER commit these!)
24+
local.properties
25+
gradle.properties
26+
!gradle.properties.template
27+
28+
# Proguard folder
29+
proguard/
30+
31+
# Log Files
32+
*.log
33+
34+
# Android Studio Navigation editor temp files
35+
.navigation/
36+
37+
# Android Studio captures folder
38+
captures/
39+
40+
# IntelliJ
41+
*.iml
42+
.idea/
43+
*.iws
44+
45+
# Keystore files
46+
*.jks
47+
*.keystore
48+
49+
# External native build folder
50+
.externalNativeBuild
51+
.cxx/
52+
53+
# Google Services (if using Firebase)
54+
google-services.json
55+
56+
# Freeline
57+
freeline.py
58+
freeline/
59+
freeline_project_description.json
60+
61+
# fastlane
62+
fastlane/report.xml
63+
fastlane/Preview.html
64+
fastlane/screenshots
65+
fastlane/test_output
66+
fastlane/readme.md
67+
68+
# Python
69+
__pycache__/
70+
*.py[cod]
71+
*$py.class
72+
*.so
73+
.Python
74+
env/
75+
venv/
76+
.venv
77+
78+
# Database files
79+
*.db
80+
*.sqlite
81+
*.db-journal
82+
83+
# API Keys and secrets
84+
secrets.properties
85+
apikeys.properties
86+
*.env
87+
!.env.example
88+
89+
# MacOS
90+
.DS_Store
91+
92+
# Test artifacts
93+
test_results/
94+
test_images/current_screen.png
95+
test_images/manual_test_logs.txt
96+
ui_dump*.xml
97+
98+
# Temporary files
99+
*.tmp
100+
*.temp
101+
*~
102+
*.swp
103+
*.bak
104+
*.backup
105+
106+
# Model files (too large)
107+
*.tflite
108+
*.bin
109+
*.onnx
110+
models/gemma*
111+
models/*/
112+
113+
# Large model files (don't commit to repo)
114+
*.task
115+
gemma-3n-*.task
116+
bundled_models/
117+
GemYum-v1.0-offline-package/
118+
GemYum-v1.0-offline-package.zip
119+
GemYum-v1.0-release.apk
120+
GemYum-v1.0-sideload.apk
121+
122+
# Keep the nutrients database (it's essential and small)
123+
!app/src/main/assets/databases/nutrients.db
124+
125+
# Private notes and planning
126+
ProjectPlanning/
127+
ClaudeDevelopmentNotes.md
128+
2025-*.txt
129+
VIDEO_SCRIPT.md
130+
PROBLEM_STATEMENT.md
131+
DEMO_FLOW.md
132+
SUBMISSION_CHECKLIST.md
133+
PACKAGE_CONTENTS.md
134+
135+
# Scripts data (can be regenerated)
136+
scripts/nutrition_data/
137+
scripts/__pycache__/
138+
scripts/*.db
139+
scripts/*.db-journal
140+
scripts/*.db.gz
141+
!scripts/build_ultimate_nutrients_db.py

0 commit comments

Comments
 (0)