A low-cost smart glasses and mobile app framework providing real-time guidance for visually impaired individuals in daily life.
Python
0
36 commits
updated Sep 14, 2026
A lightweight, high-performance multimodal AI system designed for smart glasses to assist visually impaired individuals with voice interaction, visual question answering, and autonomous navigation assistance.
| Feature | Model Stack | Operational Mode | Description |
|---|---|---|---|
| Function 0 — Voice Control | PhoWhisper-tiny ONNX + Android SpeechRecognizer fallback | On-Demand | Speech-to-text voice command recognition & feature activation |
| Function 1 — Visual QA Chatbot | SmolVLM2 ONNX + Android TTS | One-Shot | Offline multimodal Q&A on captured environment images via spoken questions |
| Function 2 — Photo Capture | ESP32-S3 camera / phone camera fallback | One-Shot | Capture and save a local JPEG image, then return to IDLE |
| Function 3 — Navigation / Obstacle Awareness | YOLO26s ONNX + ZipDepth ONNX + Android TTS | Continuous (4s/frame) | Real-time object detection, relative depth warning, and optional destination-aware guidance |
| FastAPI Backend Server | FastAPI + Uvicorn | Dev / Reference | REST API wrapper for local workstation testing; not required for the offline Android runtime |
| Mobile App (React Native) | ONNX Runtime Android + Native Kotlin modules | Standalone Offline | On-device inference, BLE control, voice UI, and smart-glasses state machine |
BSmart/
├── backend/ # Python FastAPI Backend & AI Pipelines
│ ├── server.py # FastAPI REST server for workstation/reference testing
│ ├── pipelines/ # Core multimodal processing pipelines
│ │ ├── voice_control.py # Voice command recognition & activation
│ │ ├── visual_qa.py # Visual QA multimodal chatbot pipeline
│ │ └── autopilot.py # Reference obstacle detection & depth guidance
│ ├── scripts/ # Utility, setup & diagnostic scripts
│ │ ├── check_glass.py # 11/11 Sanity & inference verifier
│ │ ├── download_models.py # Pretrained AI models downloader
│ │ ├── setup_glass.sh
│ │ ├── start_backend.bat
│ │ └── start_backend.sh
│ └── requirements.txt # Python dependencies
│
├── mobile_app/ # React Native mobile application
│ ├── android/ # Android project with ONNX Runtime and native Kotlin modules
│ ├── src/ # UI components, state machine & inference services
│ └── scripts/ # Icon generation & dependency patches
│
├── firmware/ # Smart Glasses ESP32-S3 hardware code
├── ai_core/ # ONNX model export & packaging scripts
├── assets/ # App icons (icon.svg) & sound clips (Open_f1..f4.mp3)
├── docs/ # Architecture & documentation
├── test/ # Test photos & audio clips
└── start_backend.bat # One-click Windows backend server startup
# Clone the repository
git clone https://github.com/GiaPhaZZZ/BSmart.git
cd BSmart
# Activate Virtual Environment (WSL / Ubuntu / Windows)
source ./glass/bin/activate # or ./glass/glass/bin/activate
Download all required baseline weights (yolo26s.pt, PhoWhisper, EnViT5, SmolVLM2, Piper vi_VN):
python backend/scripts/download_models.py
Convert speech & translation models to CTranslate2 INT8 format for real-time CPU performance:
# Convert PhoWhisper ASR
ct2-transformers-converter --model vinai/PhoWhisper-tiny --output_dir models/phowhisper-ct2-int8 --quantization int8
# Convert EnViT5 Translation
ct2-transformers-converter --model VietAI/envit5-translation --output_dir models/envit5-ct2-int8 --quantization int8
Run the diagnostic script to verify that all libraries and models load correctly:
python backend/scripts/check_glass.py
Expected Output: 11/11 checks passed with no errors.
Start the backend server to serve the Mobile App and Smart Glasses:
# On Windows
start_backend.bat
# On Linux / WSL / Terminal
python backend/server.py
Server runs at: http://0.0.0.0:8000
GET /health200 OK
{
"status": "ok",
"service": "BSmart AI Backend",
"models": {
"phowhisper_int8": true,
"envit5_int8": true,
"yolo26s": true
}
}
POST /navigatemultipart/form-data (image: JPEG/PNG file)200 OK
{
"warning": "Lưu ý, phát hiện car ở phía trước.",
"detected_objects": ["car"]
}
POST /transcribemultipart/form-data (audio: WAV/MP3 file)200 OK
{
"text": "mở tính năng 1.",
"matched_feature": 1,
"matched_keywords": ["tính năng 1"]
}
POST /qamultipart/form-data (image: file, audio: optional file, question: optional text)200 OK
{
"question": "Phía trước có gì?",
"answer": "Một con phố với hàng cây và những toà nhà dưới bầu trời trong xanh."
}
Export lightweight models to Android assets:
python ai_core/package_models.py
cd mobile_app/android
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/BSmart.apk
cd mobile_app
npx react-native build-android --mode=release
Output APK location: mobile_app/android/app/build/outputs/apk/release/app-release.apk
filesDir/onnx_models/<model filename>.ByteArrays, to avoid heap spikes when loading large models such as smolvlm2_decoder.onnx.releaseObjectDetectionModels(), releaseVlmModels(), and releaseAsrModels().android:largeHeap="true" is not used as the primary memory fix.Voice command matching is accent-insensitive and supports common ASR variants:
| Feature | Accepted examples |
|---|---|
| Feature 1 — QA | 1, số 1, một, số một, tính năng 1, tính năng một, tính năng số 1, tính năng số một, hỏi đáp, gpt |
| Feature 2 — Capture | 2, số 2, hai, số hai, tính năng 2, tính năng hai, tính năng số 2, tính năng số hai, tính năng hay, tính năng số hay, chụp ảnh |
| Feature 3 — Navigation | 3, số 3, ba, số ba, tính năng 3, tính năng ba, tính năng số 3, tính năng số ba, tìm đường, dẫn đường |
BSmart includes a one-click flashing script that automatically detects the ESP32-S3 COM port, builds from current source when release artifacts are missing or stale, and flashes validated binaries (bootloader.bin, partitions.bin, and firmware.bin).
# Make sure the ESP32 is connected via USB, then run at project folder:
python flash_firmware.py
# Select the port explicitly when more than one ESP32 adapter is present
python flash_firmware.py --port COM7
# Always rebuild from source before flashing
python flash_firmware.py --rebuild
The generated release/firmware/manifest.json records source metadata and SHA-256 hashes for all three binaries. A failed build never falls back to older artifacts.
Note: The script automatically installs required dependencies (esptool, pyserial) if they are missing.
# Function 0: Voice Command Test
python backend/pipelines/voice_control.py --audio test/audio/mo_tinh_nang.mp3
# Function 1: Visual QA Chatbot Test
python backend/pipelines/visual_qa.py --image test/photo/road.jpg --audio test/audio/mieu_ta_khung_canh.mp3 --out out.wav
# Function 3 reference: Autopilot Navigation Test
python backend/pipelines/autopilot.py --image test/photo/road.jpg --audio guide.wav
A low-cost smart glasses and mobile app framework providing real-time guidance for visually impaired individuals in daily life.
Python
0
36 commits
updated Sep 14, 2026
A lightweight, high-performance multimodal AI system designed for smart glasses to assist visually impaired individuals with voice interaction, visual question answering, and autonomous navigation assistance.
| Feature | Model Stack | Operational Mode | Description |
|---|---|---|---|
| Function 0 — Voice Control | PhoWhisper-tiny ONNX + Android SpeechRecognizer fallback | On-Demand | Speech-to-text voice command recognition & feature activation |
| Function 1 — Visual QA Chatbot | SmolVLM2 ONNX + Android TTS | One-Shot | Offline multimodal Q&A on captured environment images via spoken questions |
| Function 2 — Photo Capture | ESP32-S3 camera / phone camera fallback | One-Shot | Capture and save a local JPEG image, then return to IDLE |
| Function 3 — Navigation / Obstacle Awareness | YOLO26s ONNX + ZipDepth ONNX + Android TTS | Continuous (4s/frame) | Real-time object detection, relative depth warning, and optional destination-aware guidance |
| FastAPI Backend Server | FastAPI + Uvicorn | Dev / Reference | REST API wrapper for local workstation testing; not required for the offline Android runtime |
| Mobile App (React Native) | ONNX Runtime Android + Native Kotlin modules | Standalone Offline | On-device inference, BLE control, voice UI, and smart-glasses state machine |
BSmart/
├── backend/ # Python FastAPI Backend & AI Pipelines
│ ├── server.py # FastAPI REST server for workstation/reference testing
│ ├── pipelines/ # Core multimodal processing pipelines
│ │ ├── voice_control.py # Voice command recognition & activation
│ │ ├── visual_qa.py # Visual QA multimodal chatbot pipeline
│ │ └── autopilot.py # Reference obstacle detection & depth guidance
│ ├── scripts/ # Utility, setup & diagnostic scripts
│ │ ├── check_glass.py # 11/11 Sanity & inference verifier
│ │ ├── download_models.py # Pretrained AI models downloader
│ │ ├── setup_glass.sh
│ │ ├── start_backend.bat
│ │ └── start_backend.sh
│ └── requirements.txt # Python dependencies
│
├── mobile_app/ # React Native mobile application
│ ├── android/ # Android project with ONNX Runtime and native Kotlin modules
│ ├── src/ # UI components, state machine & inference services
│ └── scripts/ # Icon generation & dependency patches
│
├── firmware/ # Smart Glasses ESP32-S3 hardware code
├── ai_core/ # ONNX model export & packaging scripts
├── assets/ # App icons (icon.svg) & sound clips (Open_f1..f4.mp3)
├── docs/ # Architecture & documentation
├── test/ # Test photos & audio clips
└── start_backend.bat # One-click Windows backend server startup
# Clone the repository
git clone https://github.com/GiaPhaZZZ/BSmart.git
cd BSmart
# Activate Virtual Environment (WSL / Ubuntu / Windows)
source ./glass/bin/activate # or ./glass/glass/bin/activate
Download all required baseline weights (yolo26s.pt, PhoWhisper, EnViT5, SmolVLM2, Piper vi_VN):
python backend/scripts/download_models.py
Convert speech & translation models to CTranslate2 INT8 format for real-time CPU performance:
# Convert PhoWhisper ASR
ct2-transformers-converter --model vinai/PhoWhisper-tiny --output_dir models/phowhisper-ct2-int8 --quantization int8
# Convert EnViT5 Translation
ct2-transformers-converter --model VietAI/envit5-translation --output_dir models/envit5-ct2-int8 --quantization int8
Run the diagnostic script to verify that all libraries and models load correctly:
python backend/scripts/check_glass.py
Expected Output: 11/11 checks passed with no errors.
Start the backend server to serve the Mobile App and Smart Glasses:
# On Windows
start_backend.bat
# On Linux / WSL / Terminal
python backend/server.py
Server runs at: http://0.0.0.0:8000
GET /health200 OK
{
"status": "ok",
"service": "BSmart AI Backend",
"models": {
"phowhisper_int8": true,
"envit5_int8": true,
"yolo26s": true
}
}
POST /navigatemultipart/form-data (image: JPEG/PNG file)200 OK
{
"warning": "Lưu ý, phát hiện car ở phía trước.",
"detected_objects": ["car"]
}
POST /transcribemultipart/form-data (audio: WAV/MP3 file)200 OK
{
"text": "mở tính năng 1.",
"matched_feature": 1,
"matched_keywords": ["tính năng 1"]
}
POST /qamultipart/form-data (image: file, audio: optional file, question: optional text)200 OK
{
"question": "Phía trước có gì?",
"answer": "Một con phố với hàng cây và những toà nhà dưới bầu trời trong xanh."
}
Export lightweight models to Android assets:
python ai_core/package_models.py
cd mobile_app/android
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/BSmart.apk
cd mobile_app
npx react-native build-android --mode=release
Output APK location: mobile_app/android/app/build/outputs/apk/release/app-release.apk
filesDir/onnx_models/<model filename>.ByteArrays, to avoid heap spikes when loading large models such as smolvlm2_decoder.onnx.releaseObjectDetectionModels(), releaseVlmModels(), and releaseAsrModels().android:largeHeap="true" is not used as the primary memory fix.Voice command matching is accent-insensitive and supports common ASR variants:
| Feature | Accepted examples |
|---|---|
| Feature 1 — QA | 1, số 1, một, số một, tính năng 1, tính năng một, tính năng số 1, tính năng số một, hỏi đáp, gpt |
| Feature 2 — Capture | 2, số 2, hai, số hai, tính năng 2, tính năng hai, tính năng số 2, tính năng số hai, tính năng hay, tính năng số hay, chụp ảnh |
| Feature 3 — Navigation | 3, số 3, ba, số ba, tính năng 3, tính năng ba, tính năng số 3, tính năng số ba, tìm đường, dẫn đường |
BSmart includes a one-click flashing script that automatically detects the ESP32-S3 COM port, builds from current source when release artifacts are missing or stale, and flashes validated binaries (bootloader.bin, partitions.bin, and firmware.bin).
# Make sure the ESP32 is connected via USB, then run at project folder:
python flash_firmware.py
# Select the port explicitly when more than one ESP32 adapter is present
python flash_firmware.py --port COM7
# Always rebuild from source before flashing
python flash_firmware.py --rebuild
The generated release/firmware/manifest.json records source metadata and SHA-256 hashes for all three binaries. A failed build never falls back to older artifacts.
Note: The script automatically installs required dependencies (esptool, pyserial) if they are missing.
# Function 0: Voice Command Test
python backend/pipelines/voice_control.py --audio test/audio/mo_tinh_nang.mp3
# Function 1: Visual QA Chatbot Test
python backend/pipelines/visual_qa.py --image test/photo/road.jpg --audio test/audio/mieu_ta_khung_canh.mp3 --out out.wav
# Function 3 reference: Autopilot Navigation Test
python backend/pipelines/autopilot.py --image test/photo/road.jpg --audio guide.wav