Spaces:
Sleeping
Sleeping
Tanishq commited on
Commit ·
d1f7784
1
Parent(s): ce51170
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import model_main
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def main():
|
| 6 |
+
st.title("Sharingan")
|
| 7 |
+
st.sidebar.image("eye.png", width=100)
|
| 8 |
+
st.sidebar.title("Sharingan")
|
| 9 |
+
st.sidebar.write("Sharingan is an Image Descriptor")
|
| 10 |
+
st.sidebar.write("Upload an image and see it's description below")
|
| 11 |
+
uploaded_file = st.sidebar.file_uploader("Choose an image", type=["jpg", "jpeg", "png"])
|
| 12 |
+
if uploaded_file is not None:
|
| 13 |
+
st.image(uploaded_file, caption="using sharingan...", use_column_width=True)
|
| 14 |
+
st.text("Generated Description:")
|
| 15 |
+
st.title(model_main.generate_caption(uploaded_file))
|
| 16 |
+
else:
|
| 17 |
+
st.image("violin.jpg", caption="using sharingan...", use_column_width=True)
|
| 18 |
+
st.text("Generated Description:")
|
| 19 |
+
st.title(model_main.generate_caption("violin.jpg"))
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
if __name__ == "__main__":
|
| 23 |
+
main()
|