This is a Streamlit-based web application that allows users to upload images and analyze them using the Mistral AI API.
- Upload images (JPG, JPEG, PNG)
- Display uploaded images
- Analyze images using Mistral AI's image recognition capabilities
- Show analysis results
- Python 3.7+
- Streamlit
- Pillow
- Requests
-
Clone this repository:
git clone https://github.com/eniompw/MistralVision.git cd image-analysis-app
-
Install the required packages:
pip install streamlit pillow requests
-
Set up your Mistral AI API key:
- Sign up for an account at Mistral AI
- Obtain your API key
- Set the API key as an environment variable:
export MISTRAL_API_KEY=your_api_key_here
-
Run the Streamlit app:
streamlit run app.py
-
Open your web browser and go to the URL displayed in the terminal (usually
http://localhost:8501
) -
Use the file uploader to select an image
-
Click the "Analyze Image" button to process the image and view the results
- The app uses Streamlit's file uploader to allow users to select an image file.
- The uploaded image is displayed on the page.
- When the user clicks "Analyze Image", the app encodes the image to base64.
- The encoded image is sent to the Mistral AI API along with a prompt asking "What's in this image?".
- The API response is processed and displayed on the page.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.