This is a demo which use blip-image-captioning-large to do image caption task with a web ui.
Download model from huggingface repo to the project’s root directory as below.
project_root/
│
├─ blip-image-captioning-large/
├─ static/
├─ templates/
│ └─ index.html
├─ demo.png
├─ main.py
├─ miku in vatican.jpg
├─ README.md
└─ requirements.txt
conda create -n image_caption_env python=3.11
conda activate image_caption_env
pip install -r requirements.txtpython main.pyAfter starting the FastAPI server, open your browser and go to http://localhost:8000
following interface can be seen:
