Spaces:
Runtime error
Runtime error
Download app.py from william-renaldy/Image-Caption-Generator: direct link, hf CLI and curl.
- Browser
- Download file 512 Bytes
-
https://huggingface.co/spaces/william-renaldy/Image-Caption-Generator/resolve/main/app.py
- Command line
-
hf download hf://spaces/william-renaldy/Image-Caption-Generator/app.py
-
curl -L -o app.py https://huggingface.co/spaces/william-renaldy/Image-Caption-Generator/resolve/main/app.py
512 Bytes
| import streamlit as st | |
| from processor import GenerateDescription | |
| generator = GenerateDescription() | |
| st.set_page_config(page_title="Image Caption Generator") | |
| st.title("Image Caption Generator") | |
| image = st.file_uploader("Upload your Image: ") | |
| if image: | |
| st.image(image) | |
| if image: | |
| caption = generator.generate(image) | |
| caption = caption.strip("start") | |
| caption = caption.strip("end") | |
| caption = caption.strip() | |
| caption = caption.capitalize() | |
| caption += "." | |
| st.header(caption) |