This system combines computer vision, speech recognition, and OpenAI's vision models to create an AI assistant that can see, understand, and take actions based on user queries.
EchoVision uses a chain-of-thought reasoning approach with action chaining to perform complex tasks. The system:
- Captures images from a camera
- Listens for user queries (voice or text)
- Performs reasoning to determine necessary actions
- Executes actions in sequence (API calls)
- Provides final responses
- Camera Process: Captures frames from a camera stream and stores them in a buffer
- Buffer: Holds recent frames in memory for processing
- Agent Process: Handles user queries, processes images, and manages the action chain
- Reasoning Module: Uses OpenAI's vision model to determine what actions to take
- API Functions: Simulated functions for location, navigation, and nearby place searches
The system implements a multi-step reasoning and action process:
- User provides a query (e.g., "give me directions to the nearest chipotle")
- Vision model analyzes images and determines necessary action sequence
- First action is executed (e.g., get current location)
- Result from first action is fed back to the vision model
- Vision model determines next action using previous result
- Process continues until final result is achieved
- Final response is presented to the user
The system supports several action types:
get_current_location(): Returns current GPS coordinatesget_nearby_places(location, type, radius): Finds places of interest near a locationget_route_to_destination(origin, destination, mode): Gets directions between two points- Image analysis: Directly analyzes visual content without API calls
-
Install required packages:
pip install openai python-dotenv opencv-python SpeechRecognition -
Create a
.envfile with your API keys:OPENAI_API_KEY=your_api_key_here GOOGLE_MAPS_API_KEY=your_api_key_here ELEVEN_LABS_API_KEY=your_api_key_here -
Run the application:
python main.py -
Speak or type commands. For example:
- "Give me directions to the nearest restaurant"
- "What does the sign say?"
- "Find the closest gas station"
You can adjust several parameters in the code:
- Camera URL in
camera_process() - Buffer size in
main() - Vision model parameters in
reasoning.py
This project is containerized using Docker. To run the application using Docker:
- Docker
- Docker Compose
- Python 3.11 (for local development)
To run the application in development mode:
docker-compose upTo build and run the application in production mode:
docker-compose -f docker-compose.yml up --buildTo stop the application:
docker-compose downThe application runs on port 8000 by default. You can access it at http://localhost:8000.
To build the Docker image manually:
docker build -t echovision .To run the container manually:
docker run -p 8000:8000 echovision- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the application locally:
python app.py