WebcamGPT-Vision is a lightweight web application that enables users to process images from their webcam using OpenAI's GPT-4 Vision API. The application captures images from the user's webcam, sends them to the GPT-4 Vision API, and displays the descriptive results.
There are three versions of this project: PHP, Node.js, and Python / Flask.
webcamgpt2.mp4
- Webcam integration for live image capture.
- Processing of images with OpenAI's GPT-4 Vision API.
- Display of AI-generated image descriptions.
- Simple and intuitive user interface.
Before you begin, ensure you have met the following requirements:
- You have a modern web browser.
- For the PHP version: You have a server with PHP support and cURL enabled.
- For the Node.js version: You have Node.js and npm installed.
- For the Python/Flask version: You have Python and Flask installed.
- You have obtained an API key from OpenAI for GPT-4 Vision API usage.
To install WebcamGPT-Vision, follow these steps for the correct version (all are included):
- Clone the repository to your local machine or server:
git clone https://github.com/bdekraker/webcamgpt-vision.git
- Navigate to the
php-version
directory. - Replace
YOUR_DEFAULT_API_KEY
in theprocess_image.php
file with your actual OpenAI API key. - Upload the code to your PHP-enabled server.
- Open the
index.html
in your web browser to start using the application.
- Clone the repository:
git clone https://github.com/bdekraker/webcamgpt-vision.git
- Navigate to the
js-version
directory. - Run
npm install
to install the dependencies. - Create a
.env
file in the root ofjs-version
directory and add your OpenAI API key:OPENAI_API_KEY=YOUR_DEFAULT_API_KEY
- Start the server with
node server.js
. - Access the application through your web browser at
http://localhost:3000
(or the port you configured).
- Clone the repository:
git clone https://github.com/bdekraker/webcamgpt-vision.git
- Navigate to the
python-version
directory. - Run
pip install -r requirements.txt
to install the dependencies. - Set your OpenAI API key as an environment variable:
export YOUR_DEFAULT_API_KEY='your_actual_api_key_here'
- Start the Flask server with
python process_image.py
. - Access the application through your web browser at
http://localhost:5000
.
For both versions, the usage is as follows:
- Ensure that you have a working webcam connected and allowed for use by the browser.
- Open the
index.html
page in your web browser. - Click the "Capture" button to take a snapshot from your webcam.
- The application will process the image and display the description below the webcam feed.
Contributions to WebcamGPT-Vision are welcome. Please adhere to the following guidelines:
- Fork the repository and create a new branch for your feature or fix.
- Write clear and concise commit messages.
- Ensure your code adheres to the existing style.
- Open a pull request with a detailed description of your changes.
If you have any questions or feedback, please open an issue in the repository, and a maintainer will get back to you.
This project is licensed under the MIT License - see the LICENSE.md
file for details.
- Thanks to OpenAI for providing the GPT-4 Vision API.
- This project was inspired by the capabilities of AI in image processing and understanding.
If you need to contact the maintainer of this project, please reach out to Benjamin De Kraker.
This application is not affiliated with OpenAI, and the GPT-4 Vision API usage is subject to OpenAI's terms and conditions. Ensure that you follow OpenAI's usage guidelines and have appropriate permissions to use the API.