Spaces:
Sleeping
A newer version of the Streamlit SDK is available: 1.58.0
Deployment Guide for CaptionIQ
This document explains how to deploy your Image Captioning application to the public.
1. Hugging Face Spaces (Streamlit SDK)
Hugging Face Spaces allows you to quickly host Machine Learning demos. I have prepared an automated script to deploy it.
Automatic Method (Recommended)
You can deploy directly from your local terminal using the script provided:
python3 deploy_hf.py --token YOUR_HUGGING_FACE_TOKEN --repo-name CaptionIQ
Note: Make sure your token has Write permissions. You can generate one at huggingface.co/settings/tokens.
The script will:
- Automatically create a Streamlit Space named
CaptionIQon your Hugging Face account. - Filter out unnecessary large files (like dataset images in
data/Images). - Upload your models and code.
- Set up Git LFS (Large File Storage) for your
.h5model files automatically.
2. Streamlit Community Cloud
Streamlit provides a free community cloud that integrates directly with GitHub. If you prefer to deploy there:
Push your code to GitHub:
- Create a GitHub repository for your project.
- Commit and push your code. Because the
.h5models are large, ensure you have Git LFS installed (git lfs install) before pushing, or exclude them and load models from an external URL. I have added.gitattributesto track.h5files with LFS.
Deploy via Streamlit Cloud:
- Go to share.streamlit.io.
- Click "New app".
- Select your GitHub repository, choose the main branch, and specify
app.pyas your Main file path. - Click Deploy.
Note on Free Tiers: Streamlit Community Cloud has a 1GB memory limit which might be tight when loading two large VGG models simultaneously. Hugging Face Spaces (Free Tier) typically offers 16GB of RAM, making it a better fit for this project!