Gafas inteligentes con IA para personas ciegas o con discapacidad visual β Google Gemini Hackathon
English Summary β’ DescripciΓ³n β’ Arquitectura β’ Quick Start β’ DemostraciΓ³n β’ Contribuir
KODA is an open-source AI smart glasses system designed for individuals who are blind or have severe visual impairments, developed for the Google Gemini Hackathon.
The system harnesses Google Gemini 2.5 Flash, YOLOv8, and Tesseract OCR to deliver real-time scene descriptions, read visible text, guide step-by-step navigation, and respond to conversational voice questions with native Spanish support via bone-conduction headphones in
- Continuous Scene Narration: Automatic environment description every 1β2 seconds with adaptive frame similarity filtering to minimize auditory fatigue.
- OCR Text Reading: Fast extraction and vocalization of street signs, room doors, warning labels, and text in the wild.
- Hierarchical Hazard Preemption: Immediate audio interruption for critical warnings (e.g.
STOP,PELIGROsigns or oncoming vehicles). - Conversational Push-to-Talk (PTT): Users can hold a button to ask open-ended questions ("What is in front of me?", "What does this sign say?").
- Campus & Indoor Navigation: Step-by-step turn guidance with offline mock land-marking or Google Maps Platform.
- Native Spanish First: Designed and optimized for natural Spanish conversation (
es-CO/es-US-Neural2-B). - Zero-Cloud Video Requirement: Supports pre-recorded video loops for deterministic testing, debugging, and offline demonstrations.
Proyecto para la Gemini Hackathon de Google: Gafas inteligentes con IA para personas ciegas o con discapacidad visual. Usan Gemini 2.5 Flash para describir escenas, leer texto, guiar navegaciΓ³n y responder por voz en tiempo real, con soporte principal en espaΓ±ol.
KODA es una plataforma de asistencia visual inteligente que procesa video continuo desde una cΓ‘mara corporal o montada en gafas, detecta obstΓ‘culos y peligros inmediatos, extrae texto visible en el entorno (seΓ±alΓ©tica, puertas, avisos), consulta modelos de lenguaje multimodal de ΓΊltima generaciΓ³n y transmite descripciones en voz natural respetando la carga cognitiva del usuario.
Objetivo fundamental: Permitir que una persona con discapacidad visual comprenda su entorno fΓsico, anticipe riesgos y navegue espacios complejos con total confianza.
π Campus Universidad de La Sabana, ChΓa, Colombia
Para conocer la bitΓ‘cora tΓ©cnica de la demostraciΓ³n en vivo, consulta docs/DEMO.md.
flowchart TD
subgraph INPUT ["1. CAPTURA Y ENTRADA"]
CAM[CΓ‘mara Webcam / Video MP4] --> |Frame JPEG| FP[Filtrado Adaptativo de Movimiento]
MIC[MicrΓ³fono Streaming] --> |Audio PCM| STT[Google Cloud STT / PTT]
end
subgraph PROCESSING ["2. PROCESAMIENTO LOCAL"]
FP --> YOLO[YOLOv8 Nano<br/>DetecciΓ³n de Objetos y Distancia]
FP --> OCR[Tesseract OCR<br/>ExtracciΓ³n de Texto en EspaΓ±ol]
YOLO --> HR[Reglas de Prioridad de Peligros]
OCR --> HR
end
subgraph CLOUD ["3. INTELIGENCIA MULTIMODAL"]
FP --> |Frame + Contexto OCR| GEMINI[Google Gemini 2.5 Flash]
STT --> |Pregunta del usuario| GEMINI
GEMINI --> |DescripciΓ³n concisa 1-2 oraciones| TTS[Google Cloud TTS Neural2]
end
subgraph OUTPUT ["4. SALIDA Y EXPERIENCIA"]
HR --> |Alerta CrΓtica: STOP / VehΓculo| AP[Audio Player Prioritario]
TTS --> |Voz en EspaΓ±ol| AP
AP --> AUDIO[Auriculares de ConducciΓ³n Γsea]
FP --> UI[Ventana OpenCV: Bounding Boxes + SubtΓtulos]
end
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. ENTRADA β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β CΓ‘mara / Video MP4 (OpenCV) βββΊ Filtro de Similitud β
β MicrΓ³fono (PyAudio + Google STT / Push-to-Talk) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. PROCESAMIENTO LOCAL β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββ βββββββββββββββββββββββββββββ β
β β YOLOv8n (VehΓculos, β β Tesseract OCR (EspaΓ±ol) β β
β β personas, obstΓ‘culos) β β SeΓ±ales: STOP, PELIGRO β β
β βββββββββββββββββββββββββ βββββββββββββββββββββββββββββ β
β β β β
β ββββββββββββββββ¬βββββββββββββββ β
β βΌ β
β Pipeline de ClasificaciΓ³n de Peligros β
β (CrΓtico: Prioridad 0 | Alto: 1 | Normal: 2) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. INTELIGENCIA MULTIMODAL β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Google Gemini 2.5 Flash API β
β - Imagen comprimida + texto OCR + historial de escena β
β - Prompts optimizados para baja latencia (300-800 ms) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. SALIDA Y AUDIO β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Google Cloud Text-to-Speech (Neural2 en EspaΓ±ol) β
β AudioPlayer con gestiΓ³n de colas e interrupciΓ³n inmediata β
β Ventana visual OpenCV (Bordes Verde/Rojo + SubtΓtulos) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Para que la asistencia sea segura y natural en tiempo real, el presupuesto de latencia de extremo a extremo es
| Etapa del Pipeline | MΓnimo | TΓpico | MΓ‘ximo | % del Total |
|---|---|---|---|---|
| Captura y filtrado de frame | 30 ms | 50 ms | 100 ms | ~4% |
| OCR Tesseract (paralelo) | 80 ms | 150 ms | 300 ms | ~13% |
| Inferencia local YOLOv8n | 20 ms | 40 ms | 80 ms | ~4% |
| Ida y vuelta de red (API Gemini) | 100 ms | 150 ms | 300 ms | ~13% |
| Inferencia Gemini 2.5 Flash | 300 ms | 500 ms | 800 ms | ~45% |
| SΓntesis Google Cloud TTS Neural2 | 50 ms | 100 ms | 200 ms | ~9% |
| Buffer y reproducciΓ³n de audio | 80 ms | 100 ms | 150 ms | ~9% |
| TOTAL EXTREMO A EXTREMO (E2E) | 660 ms | 1090 ms | 1930 ms | 100% |
- Python 3.11+
- Tesseract OCR con datos de idioma espaΓ±ol (
spa.traineddata) - PortAudio (para captura de micrΓ³fono)
- CΓ‘mara web o archivo de video MP4
- ConexiΓ³n a internet (para llamadas API de Google)
Ubuntu / Debian:
sudo apt update sudo apt install -y tesseract-ocr tesseract-ocr-spa libportaudio2 portaudio19-dev libgl1
macOS (Homebrew):
brew install tesseract tesseract-lang portaudio
Windows:
- Instalar ejecutable desde UB-Mannheim Tesseract OCR.
- Descargar
spa.traineddatadesde tessdata_best y copiarlo aC:\Program Files\Tesseract-OCR\tessdata\.
# Clonar repositorio git clone https://github.com/maosuarez/KodaVision.git cd KodaVision # Crear y activar entorno virtual python3 -m venv .venv source .venv/bin/activate # En Windows: .venv\Scripts\activate # Instalar dependencias pip install -r requirements.txt
Copia la plantilla .env.example:
cp .env.example .env
Edita .env con tus credenciales:
# Google Gemini API Key (obtener en https://aistudio.google.com/) GEMINI_API_KEY=tu_gemini_api_key_aqui # Google Cloud Service Account JSON (para Cloud TTS & STT) GOOGLE_APPLICATION_CREDENTIALS=creds/service-account.json GOOGLE_CLOUD_PROJECT=tu-proyecto-gcp # ConfiguraciΓ³n de voz TTS_LANGUAGE_CODE=es-US TTS_VOICE_NAME=es-US-Neural2-B # Opcional: Ruta a video pregrabado (dejar vacΓo para webcam en vivo) VIDEO_PATH=
python main.py
# Configurar VIDEO_PATH en .env o pasarlo en lΓnea de comando: VIDEO_PATH="demo/video_demo.mp4" python main.py
- MantΓ©n presionada la tecla Enter (o botΓ³n asignado) para formular preguntas como:
- "ΒΏQuΓ© hay delante de mΓ?"
- "ΒΏQuΓ© dice el letrero de la derecha?"
- "ΒΏCΓ³mo llego al Bloque G?"
KodaVision/
βββ main.py # Orquestador principal y ciclo de vida
βββ requirements.txt # Dependencias Python
βββ pyproject.toml # ConfiguraciΓ³n y empaquetado del proyecto
βββ .env.example # Plantilla de variables de entorno
βββ AGENTS.md # GuΓa universal para agentes de IA
βββ CLAUDE.md # Referencia para Claude Code
βββ CONTRIBUTING.md # GuΓa de contribuciΓ³n para la comunidad
βββ CODE_OF_CONDUCT.md # CΓ³digo de conducta
βββ SECURITY.md # PolΓtica de seguridad y reporte de fallos
βββ LICENSE # Licencia MIT
βββ context.md # EspecificaciΓ³n tΓ©cnica del prototipo
βββ mock.md # DocumentaciΓ³n del subsistema de navegaciΓ³n mock
β
βββ .github/
β βββ workflows/ci.yml # IntegraciΓ³n continua (GitHub Actions)
β βββ ISSUE_TEMPLATE/ # Plantillas para issues de GitHub
β βββ PULL_REQUEST_TEMPLATE.md # Plantilla para Pull Requests
β
βββ docs/
β βββ DEMO.md # GuiΓ³n tΓ©cnico de la demo en vivo
β βββ CHANGELOG_USER.md # Historial de cambios funcionales
β βββ demo_image.png # Imagen de demostraciΓ³n
β
βββ modules/
β βββ __init__.py
β βββ config.py # Carga y validaciΓ³n de variables de entorno
β βββ prompts.py # Prompts especializados para Gemini 2.5 Flash
β βββ navigation.py # NavegaciΓ³n paso a paso (Mock + Maps API)
β βββ push_to_talk.py # Cliente de interacciΓ³n por voz Push-to-Talk
β β
β βββ input/
β β βββ __init__.py
β β βββ camera.py # Captura de video OpenCV (cΓ‘mara o archivo)
β β βββ ocr.py # ExtracciΓ³n de texto OCR con Tesseract
β β βββ stt_client.py # Reconocimiento de voz en streaming con Google STT
β β
β βββ processing/
β β βββ __init__.py
β β βββ pipeline.py # Pipeline multihilo de procesamiento de frames
β β βββ hazard_detector.py # FusiΓ³n de detecciΓ³n de objetos YOLO y OCR
β β βββ hazard_rules.py # Reglas de criticidad y prioridad de alertas
β β
β βββ output/
β βββ __init__.py
β βββ gemini_client.py # Conector con la API de Google Gemini
β βββ tts_client.py # SΓntesis de voz con Google Cloud TTS Neural2
β βββ audio.py # Reproductor de audio con cola de prioridad
β
βββ tests/
βββ README.md # GuΓa para ejecuciΓ³n de pruebas
βββ test_hazard_rules.py # Tests unitarios para reglas de peligro
βββ test_audio_priority.py # Tests de gestiΓ³n de audio y colas
Ejecuta la suite de pruebas unitarias con pytest:
pytest -v
Para mΓ‘s detalles, consulta tests/README.md.
Para una experiencia real con usuarios con discapacidad visual:
- Auriculares de conducciΓ³n Γ³sea: Permiten escuchar las descripciones de voz de KODA sin tapar el canal auditivo, manteniendo la percepciΓ³n acΓΊstica del entorno.
- CΓ‘mara corporal / clip para gafas: CΓ‘mara gran angular 1080p montada a la altura del pecho o en el marco de unas gafas.
-
Dispositivo de cΓ³mputo portΓ‘til: Laptop o Single Board Computer con CPU moderna para ejecutar YOLO localmente en
$< 40$ ms.
- Pipeline multimodal en tiempo real ($< 1.5$s E2E).
- DetecciΓ³n de peligros y priorizaciΓ³n de audio con interrupciΓ³n.
- NavegaciΓ³n contextual en campus universitario (modo mock).
- IntegraciΓ³n con modelos de visiΓ³n locales on-device (Edge TPU / MediaPipe / ONNX).
- Soporte para audio espacial 3D segΓΊn la posiciΓ³n del obstΓ‘culo en el frame.
- AplicaciΓ³n mΓ³vil nativa en Flutter con WebRTC.
- LocalizaciΓ³n precisa en interiores con balizas Bluetooth (BLE Beacons).
Β‘Las contribuciones son muy bienvenidas! Por favor, lee nuestra GuΓa de ContribuciΓ³n y nuestro CΓ³digo de Conducta antes de enviar un Pull Request.
AVISO IMPORTANTE: KODA es un proyecto de investigaciΓ³n y prototipo de asistencia en desarrollo abierto. No sustituye las ayudas de movilidad tradicionales certificadas (como el bastΓ³n blanco o los perros guΓa). En entornos reales, los usuarios siempre deben emplear sus mΓ©todos habituales de orientaciΓ³n y seguridad.
Este proyecto estΓ‘ distribuido bajo la licencia MIT. Para mΓ‘s detalles, consulta el archivo LICENSE.
