This project is a simple Streamlit-based web application that allows users to upload an image and get a description of it using the Ollama llava
model. The app provides an intuitive interface for interacting with the model, making it easy to describe uploaded images.
- Upload images in
.jpg
,.jpeg
, or.png
formats. - Display the uploaded image for user confirmation.
- Use the
ollama
model to generate a description of the image. - Streamlit interface for simplicity and accessibility.
To run this project, you need the following:
- Python 3.7 or higher
- Required Python libraries:
streamlit
ollama
-
Clone this repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
-
Install the required dependencies:
pip install streamlit ollama
-
Run the Streamlit app:
streamlit run test.py
- Launch the app locally by running the above command.
- Upload an image using the file uploader.
- Click the "Describe Image" button to get the model's description of the image.
The main functionality is implemented in the test.py
file:
-
Image Upload: Allows users to upload an image via Streamlit's
file_uploader
widget. -
Image Display: The uploaded image is displayed using
st.image()
. -
Model Interaction: The uploaded image is saved temporarily and passed to the
ollama.chat
function to get a description. -
Error Handling: Handles exceptions to ensure a smooth user experience.
.
├── test.py # Main application file
├── images/ # Folder for storing example images or screenshots
└── README.md # Project documentation
- Input: An uploaded image of a cat.
- Output: "This is an image of a cat sitting on a windowsill, looking outside."
- Add support for multiple image uploads.
- Provide additional model configuration options.
- Enhance the UI with more styling and interactivity.
Contributions are welcome! Please fork this repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE
file for details.
Feel free to reach out if you have any questions or suggestions!