ThirdEye (also known as VLMemory) is a comprehensive object detection and tracking system that combines Vision Language Models (VLM), YOLO object detection, and a persistent database to track and remember objects in real-time. Designed for household robotics and lost object tracking applications.
Project Links:
- Devpost Project - AI ATL 2025 Hackathon Submission
- Real-time Object Detection: Uses YOLO models for fast object detection from webcam feed
- Vision Language Model (VLM) Integration: MLX-optimized VLM models for Apple Silicon with complex instruction following
- Google Gemini Support: Alternative VLM processing using Google Gemini Live API
- Persistent Object Database: SQLite database with VLM memory capabilities for tracking objects over time
- REST API: FastAPI backend for frontend integration
- WebSocket Support: Real-time image streaming from mobile devices
- Apple Silicon Optimized: Native MLX support for M1/M2/M3 chips with GPU acceleration
ThirdEye/
├── vlm/ # Vision Language Model implementations
│ ├── index_vlm_mlx_native.py # MLX-optimized VLM (recommended for Apple Silicon)
│ ├── gemini_live_camera.py # Google Gemini Live API integration
│ └── vlm_gui.py # Modern GUI for object detection
├── database/ # Database and API
│ ├── database.py # ObjectDatabase class with VLM memory
│ ├── api.py # FastAPI REST API server
│ └── findobj.py # Object search utilities
├── prompts/ # VLM prompt templates
│ ├── newItem.prompt # Prompt for detecting new objects
│ └── existingItem.prompt # Prompt for identifying existing objects
├── archive/ # Legacy Node.js implementations
└── thirdeye.db # SQLite database (created on first run)
- Python 3.8 or higher
- Node.js v18 or higher (for legacy Node.js components)
- A webcam connected to your computer
- Apple Silicon Mac (M1/M2/M3) recommended for MLX acceleration
-
Install Python dependencies:
pip install -r requirements.txt
-
Install Node.js dependencies (optional, for legacy components):
npm install
-
macOS users: Install
imagesnap(required for webcam access):brew install imagesnap
-
Set up environment variables:
Create a .env file in the project root:
GOOGLE_AI_API_KEY=your_google_ai_api_key_hereFor Apple Silicon (MLX-optimized):
python vlm/index_vlm_mlx_native.pyFor Google Gemini:
python vlm/gemini_live_camera.pyStart the FastAPI server:
python database/api.pyThe API will be available at http://localhost:8000
API documentation available at http://localhost:8000/docs
npm start- Frame Capture: Continuously captures frames from webcam or WebSocket stream
- YOLO Detection: Fast object detection using YOLO models (YOLOv8/YOLO11)
- VLM Processing: Vision Language Model analyzes detected objects with detailed attributes:
- Object name, shape, material, brand, color, orientation
- Spatial location and relationships to other objects
- Database Storage: Objects are stored with embeddings and metadata for future retrieval
- Memory System: VLM-powered memory system can identify previously seen objects
The ObjectDatabase stores objects with:
- Basic attributes: name, shape, material, brand, color, orientation
- Spatial information: local position description, global coordinates (latitude/longitude)
- VLM descriptions: Rich natural language descriptions
- Embeddings: Vector embeddings for semantic search
- Timestamps: When objects were first seen and last updated
GET /objects- List all tracked objectsGET /objects/{object_id}- Get specific object detailsPOST /objects- Add new object from imagePOST /objects/search- Semantic search for objectsGET /objects/find- Find objects by attributesPOST /objects/{object_id}/update- Update object information
- YOLOv8x: High accuracy, slower inference
- YOLO11n: Fast, lightweight (default)
- YOLO11m: Balanced performance
Models are automatically downloaded on first run.
MLX-Optimized (Apple Silicon):
mlx-community/Qwen2-VL-2B-Instruct-4bit- Recommended, 2B params, 4-bit quantized- Supports complex instruction following unlike basic BLIP models
Google Gemini:
gemini-2.5-flash-native-audio-preview-09-2025- Via Google Gemini Live API
The application automatically detects Apple Silicon (M1/M2/M3) and uses GPU acceleration:
- MLX Framework: Native MLX models for maximum performance
- Metal/CoreML: Automatic GPU acceleration via ONNX Runtime
- Benefits:
- Faster inference times
- Lower CPU usage
- Better power efficiency
- No configuration needed
ThirdEye can receive images from mobile devices via WebSocket:
- Start the WebSocket server in
ThirdEyeSensorLink/(see ThirdEyeSensorLink README) - Set
USE_WEBSOCKET_IMAGE = Truein the VLM script - Images will be streamed in real-time from the mobile device
This project is part of a larger system with the following components:
- aiatl-frontend - Next.js React frontend for the web interface
- ThirdEyeSensorLink - WebSocket server for receiving camera and IMU data from mobile devices
Make sure to set up and run these components as needed for the full system functionality.
- Python 3.8+
- Node.js v18+ (for legacy components)
- Webcam or WebSocket image source
- Internet connection (for first-time model downloads)
- Google AI API key (for Gemini integration)
- Models are downloaded on first run (may take several minutes)
- Models run locally after initial download
- Database file (
thirdeye.db) is created automatically - Make sure your webcam is not being used by another application
-
Install imagesnap: Required for webcam access
brew install imagesnap
-
Grant camera permissions:
- System Preferences > Security & Privacy > Privacy > Camera
- Grant permissions to Terminal/Python
-
MLX-VLM not found:
pip install mlx-vlm
- Ensure webcam is connected and not in use by another application
- Try specifying a different camera index in the code
- Check camera permissions in System Preferences
- Ensure port 8000 is not in use
- Check that the database file exists and is writable
- Verify all Python dependencies are installed
- Reduce
image_widthandimage_heightin performance config - Increase
frame_skipto process fewer frames - Use smaller YOLO model (YOLO11n instead of YOLOv8x)
- Ensure MLX acceleration is active on Apple Silicon
See LICENSE file for details.