Skip to content

LechuanWANG/storytime-magic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

StoryTime Magic

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.

Features

  • 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.

Models and Libraries

  • 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.

Local Setup

Install dependencies:

pip install -r requirements.txt

Run the app:

streamlit run app.py

Then open the local URL shown in the terminal.

Deployment

The app is designed to be deployed on Streamlit Cloud. The repository should include:

  • app.py
  • requirements.txt
  • README.md

After deployment, submit the Streamlit Cloud app URL with the assignment.

Testing Checklist

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages