maheshsmc/image-caption-decoder
0
๐ผ๏ธ Image Caption Generator with Decoding Strategies
This project is a Hugging Face + GitHub demo of an Image Caption Generator using the nlpconnect/vit-gpt2-image-captioning model.
๐ Features
- Upload an image and generate captions
- Supports multiple decoding strategies:
- Greedy
- Beam Search
- Top-k Sampling
- Top-p (Nucleus) Sampling
๐ฆ Installation
pip install -r requirements.txtโถ๏ธ Run Locally
streamlit run app.py๐ Deployment
- Hugging Face Spaces (Streamlit): Upload all files
- GitHub: Push repo for tracking + sharing
๐ Example
Greedy: a man riding a horse in the field Beam (5): a person on a horse riding in a grassy field Top-k: a rider sits proudly on a horse in the countryside Top-p: someone is on horseback, enjoying the open field
