witchEverly
commited on
Update pages/๐ธ_InstaMuse.py
Browse files- pages/๐ธ_InstaMuse.py +9 -9
pages/๐ธ_InstaMuse.py
CHANGED
@@ -78,15 +78,15 @@ if file:
|
|
78 |
with col1:
|
79 |
st.markdown("## ๐ธ Your Image:")
|
80 |
st.image(image, caption='Uploaded Image', use_column_width=True)
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
|
91 |
with col2:
|
92 |
if captions:
|
|
|
78 |
with col1:
|
79 |
st.markdown("## ๐ธ Your Image:")
|
80 |
st.image(image, caption='Uploaded Image', use_column_width=True)
|
81 |
+
try:
|
82 |
+
desc = caption_generator.image_2_text(image)
|
83 |
+
captions, caption_list, img_description = caption_generator.text_2_caption(desc)
|
84 |
+
st.session_state['captions'] = captions
|
85 |
+
st.session_state['caption_list'] = caption_list
|
86 |
+
st.session_state['img_description'] = img_description
|
87 |
+
except Exception as e:
|
88 |
+
st.error(f"Error generating captions: {e}")
|
89 |
+
captions = None
|
90 |
|
91 |
with col2:
|
92 |
if captions:
|