Spaces:
Sleeping
Sleeping
| title: Image Captioning with BLIP | |
| emoji: 🖼️ | |
| colorFrom: blue | |
| colorTo: indigo | |
| sdk: gradio | |
| app_file: app.py | |
| pinned: false | |
| # Image Captioning with BLIP | |
| This project uses the Salesforce BLIP model to generate captions for images. It provides a simple web interface built with Gradio to upload an image and view the generated caption. | |
| ## Setup | |
| 1. **Clone the repository:** | |
| ```bash | |
| git clone https://huggingface.co/spaces/electro-sb/image_captioning | |
| cd image_captioning | |
| ``` | |
| 2. **Install dependencies:** | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 3. **Set up your Hugging Face token:** | |
| Create a `.env` file in the root of the project and add your Hugging Face API key: | |
| ``` | |
| HF_API_KEY=<your-hugging-face-api-key> | |
| ``` | |
| 4. **Run the application:** | |
| ```bash | |
| python app.py | |
| ``` | |
| The application will be available at `http://localhost:7860`. | |
| ## Usage | |
| 1. Open your web browser and navigate to `http://localhost:7860`. | |
| 2. Upload an image using the provided interface. | |
| 3. Click the "Caption" button to generate a caption for the image. | |
| 4. The generated caption will be displayed in the "Caption" textbox. |