Spaces:
Sleeping
Sleeping
phind
commited on
Commit
·
f7f1988
1
Parent(s):
fa57ca3
fix bugs
Browse files
app.py
CHANGED
@@ -38,10 +38,14 @@ with tabs2:
|
|
38 |
if file_name is not None:
|
39 |
col1, col2 = st.columns(2)
|
40 |
image = Image.open(file_name)
|
|
|
41 |
col1.image(image, use_column_width=True)
|
|
|
42 |
captioner = get_model_image_captioning()
|
43 |
-
|
44 |
-
with col2
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
38 |
if file_name is not None:
|
39 |
col1, col2 = st.columns(2)
|
40 |
image = Image.open(file_name)
|
41 |
+
|
42 |
col1.image(image, use_column_width=True)
|
43 |
+
|
44 |
captioner = get_model_image_captioning()
|
45 |
+
|
46 |
+
with col2:
|
47 |
+
st.header("generated caption")
|
48 |
+
with st.spinner("Generating caption..."):
|
49 |
+
predictions = captioner(image)
|
50 |
+
for generated_text in predictions:
|
51 |
+
st.write(f"\n{generated_text['generated_text']}")
|