Spaces:
Sleeping
Sleeping
Leo Liu
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import streamlit as st
|
|
5 |
# function part
|
6 |
# img2text
|
7 |
def img2text(url):
|
8 |
-
image_to_text_model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
9 |
text = image_to_text_model(url)[0]["generated_text"]
|
10 |
return text
|
11 |
|
@@ -23,6 +23,8 @@ def text2audio(story_text):
|
|
23 |
st.set_page_config(page_title="Your Image to Audio Story",
|
24 |
page_icon="🦜")
|
25 |
st.header("Turn Your Image to Audio Story")
|
|
|
|
|
26 |
uploaded_file = st.file_uploader("Select an Image...")
|
27 |
|
28 |
if uploaded_file is not None:
|
|
|
5 |
# function part
|
6 |
# img2text
|
7 |
def img2text(url):
|
8 |
+
image_to_text_model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base") # model is slow
|
9 |
text = image_to_text_model(url)[0]["generated_text"]
|
10 |
return text
|
11 |
|
|
|
23 |
st.set_page_config(page_title="Your Image to Audio Story",
|
24 |
page_icon="🦜")
|
25 |
st.header("Turn Your Image to Audio Story")
|
26 |
+
|
27 |
+
# Upload image here
|
28 |
uploaded_file = st.file_uploader("Select an Image...")
|
29 |
|
30 |
if uploaded_file is not None:
|