Update app.py
Browse files
app.py
CHANGED
@@ -38,17 +38,17 @@ if uploaded_file is not None:
|
|
38 |
st.image(uploaded_file, caption="Uploaded Image",
|
39 |
use_column_width=True)
|
40 |
|
41 |
-
#Stage 1: Image to Text
|
42 |
st.text('Processing img2text...')
|
43 |
scenario = img2text(uploaded_file.name)
|
44 |
st.write(scenario)
|
45 |
|
46 |
-
#Stage 2: Text to Story
|
47 |
st.text('Generating a story...')
|
48 |
story = text2story(scenario)
|
49 |
st.write(story)
|
50 |
|
51 |
-
#Stage 3: Story to Audio data
|
52 |
st.text('Generating audio data...')
|
53 |
audio_file = text2audio(story)
|
54 |
|
@@ -61,4 +61,4 @@ if uploaded_file is not None:
|
|
61 |
start_time=0)
|
62 |
# 删除临时音频文件
|
63 |
if os.path.exists(audio_file):
|
64 |
-
os.remove(audio_file)
|
|
|
38 |
st.image(uploaded_file, caption="Uploaded Image",
|
39 |
use_column_width=True)
|
40 |
|
41 |
+
# Stage 1: Image to Text
|
42 |
st.text('Processing img2text...')
|
43 |
scenario = img2text(uploaded_file.name)
|
44 |
st.write(scenario)
|
45 |
|
46 |
+
# Stage 2: Text to Story
|
47 |
st.text('Generating a story...')
|
48 |
story = text2story(scenario)
|
49 |
st.write(story)
|
50 |
|
51 |
+
# Stage 3: Story to Audio data
|
52 |
st.text('Generating audio data...')
|
53 |
audio_file = text2audio(story)
|
54 |
|
|
|
61 |
start_time=0)
|
62 |
# 删除临时音频文件
|
63 |
if os.path.exists(audio_file):
|
64 |
+
os.remove(audio_file)
|