How hmzask/codsoft-ai_caption_generate works
This is a small Streamlit image-captioning app. A user uploads an image; the app normalizes it, invokes the caption model on request, and displays the generated caption. The model loads Microsoft Florence-2-base through Hugging Face Transformers and prepares, generates, and post-processes the caption. The README describes CPU-focused use, while the implementation selects CUDA when available. The graph follows the sampled calls; the README also documents model download and CPU performance considerations, but no separate runtime subsystem for those concerns appears in the tree.
Main entry points: app.py Streamlit app · caption_model.py Caption model · image_utils.py Image loader
Components 5
User interface
- Streamlit app
app.py
Image preparation
- Image loader
utils/image_utils.py
Caption inference
- Caption model
models/caption_model.py
Other components
- User
- Florence-2-base
Connections 5
- User → Streamlit app: uploads image
app.py - Streamlit app → Image loader: loads image
app.py - Streamlit app → Caption model: requests caption
app.py - Caption model → Florence-2-base: loads checkpoint
models/caption_model.py - Streamlit app → User: displays caption
app.py