Update app.py
Browse files
app.py
CHANGED
|
@@ -31,17 +31,18 @@ if uploaded_image is not None:
|
|
| 31 |
with st.spinner("Loading image..."):
|
| 32 |
time.sleep(1) # Simulate a delay
|
| 33 |
image = Image.open(uploaded_image)
|
| 34 |
-
|
| 35 |
-
# Generate caption
|
| 36 |
-
caption = generate_image_caption(image)
|
| 37 |
-
st.write("Generated Caption:", caption)
|
| 38 |
-
|
| 39 |
-
# Generate story
|
| 40 |
-
if st.button("Generate Story"):
|
| 41 |
-
with st.spinner("Generating story..."):
|
| 42 |
-
generated_story = text2story(caption)
|
| 43 |
-
st.write("Generated Story:", generated_story)
|
| 44 |
# st.image(image, caption='Uploaded Image', use_column_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
# #Play audio with apinner:
|
| 47 |
# if uploaded_audio is not None:
|
|
|
|
| 31 |
with st.spinner("Loading image..."):
|
| 32 |
time.sleep(1) # Simulate a delay
|
| 33 |
image = Image.open(uploaded_image)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# st.image(image, caption='Uploaded Image', use_column_width=True)
|
| 35 |
+
|
| 36 |
+
# Generate caption
|
| 37 |
+
caption = generate_image_caption(image)
|
| 38 |
+
st.write("Generated Caption:", caption)
|
| 39 |
+
|
| 40 |
+
# Generate story
|
| 41 |
+
if st.button("Generate Story"):
|
| 42 |
+
with st.spinner("Generating story..."):
|
| 43 |
+
generated_story = text2story(caption)
|
| 44 |
+
st.write("Generated Story:", generated_story)
|
| 45 |
+
|
| 46 |
|
| 47 |
# #Play audio with apinner:
|
| 48 |
# if uploaded_audio is not None:
|