Welcome to the Image Detection (Write Metadata) Streamlit App!
With this Streamlit app, you can easily:
-Upload images
-Detect objects within them
-Generate text descriptions
-Add metadata to the images
The models employed in this app are sourced from Hugging Face and include "facebook/detr-resnet-50" for object detection and "Salesforce/blip-image-captioning-base" for text generation.
Follow these steps to set up and run the Streamlit app on your local machine.
- Python (>=3.9)
- pip (Python package manager)
-
Clone this repository to your local machine:
git clone https://github.com/timooo-thy/image-detection.git cd image-detection
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project. -
Add your huggingface token information to the
.env
file in the following format: HUGGINGFACEHUB_API_TOKEN = your_api_key_here -
Make sure to include
.env
in your.gitignore
file to keep your sensitive information secure.
-
Open a terminal and navigate to the project directory.
-
Activate the virtual environment if you created one:
source venv/bin/activate # On Windows: venv\Scripts\activate
-
Run the Streamlit app:
streamlit run app.py
-
The app should open in your default web browser.
For deploying the app to a production environment, consider deploying from Streamlit. Be sure to adjust configurations and follow deployment instructions for your chosen platform.
©Timothy Lee