Spaces:
Sleeping
Sleeping
Download app.py from reputation/sharingan: direct link, hf CLI and curl.
- Browser
- Download file 837 Bytes
-
https://huggingface.co/spaces/reputation/sharingan/resolve/main/app.py
- Command line
-
hf download hf://spaces/reputation/sharingan/app.py
-
curl -L -o app.py https://huggingface.co/spaces/reputation/sharingan/resolve/main/app.py
837 Bytes
| import streamlit as st | |
| import model_main | |
| def main(): | |
| st.title("Sharingan") | |
| st.sidebar.image("eye.png", width=100) | |
| st.sidebar.title("Sharingan") | |
| st.sidebar.write("Sharingan is an Image Descriptor") | |
| st.sidebar.write("Upload an image and see it's description below") | |
| uploaded_file = st.sidebar.file_uploader("Choose an image", type=["jpg", "jpeg", "png"]) | |
| if uploaded_file is not None: | |
| st.image(uploaded_file, caption="using sharingan...", use_column_width=True) | |
| st.text("Generated Description:") | |
| st.title(model_main.generate_caption(uploaded_file)) | |
| else: | |
| st.image("violin.jpg", caption="using sharingan...", use_column_width=True) | |
| st.text("Generated Description:") | |
| st.title(model_main.generate_caption("violin.jpg")) | |
| if __name__ == "__main__": | |
| main() | |