Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,23 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
st.set_page_config(page_title="Your Image to Audio Story",
|
5 |
page_icon="🦜")
|
6 |
st.header("Turn Your Image to Audio Story")
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# function part
|
5 |
+
# img2text
|
6 |
+
def img2text(url):
|
7 |
+
image_to_text_model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
8 |
+
text = image_to_text_model(url)[0]["generated_text"]
|
9 |
+
return text
|
10 |
+
|
11 |
+
# text2story
|
12 |
+
def text2story(text):
|
13 |
+
story_text = "" # to be completed
|
14 |
+
return story_text
|
15 |
+
|
16 |
+
# text2audio
|
17 |
+
def text2audio(story_text):
|
18 |
+
audio_data = "" # to be completed
|
19 |
+
return audio_data
|
20 |
+
|
21 |
st.set_page_config(page_title="Your Image to Audio Story",
|
22 |
page_icon="🦜")
|
23 |
st.header("Turn Your Image to Audio Story")
|