StoryTime Magic is a Streamlit storytelling application for children aged 3-10. A user uploads a picture, the app generates an image caption with a Hugging Face BLIP model, expands the caption into a short children's story, and converts the story into playable audio.
- Upload JPG, JPEG, or PNG images.
- Generate an image caption using
Salesforce/blip-image-captioning-base. - Generate a 50-100 word story using
distilgpt2. - Convert the story to speech using
gTTS. - Play and download the generated audio in the Streamlit app.
- Streamlit for the web interface.
- Hugging Face Transformers for image captioning and text generation.
- BLIP (
Salesforce/blip-image-captioning-base) for image understanding. - DistilGPT-2 (
distilgpt2) for story generation. - gTTS for text-to-speech audio.
Install dependencies:
pip install -r requirements.txtRun the app:
streamlit run app.pyThen open the local URL shown in the terminal.
The app is designed to be deployed on Streamlit Cloud. The repository should include:
app.pyrequirements.txtREADME.md
After deployment, submit the Streamlit Cloud app URL with the assignment.
- Image upload accepts JPG, JPEG, and PNG files.
- The BLIP model generates a caption for the uploaded image.
- The text-generation model creates a story within the required 50-100 word range.
- The generated story is displayed in the app.
- gTTS converts the story to audio.
- The audio player and download button work in Streamlit.