Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import os
|
|
| 6 |
# function part
|
| 7 |
# img2text
|
| 8 |
def img2text(image_path):
|
| 9 |
-
image_to_text = pipeline("image-to-text", model="
|
| 10 |
text = image_to_text(image_path)[0]["generated_text"]
|
| 11 |
return text
|
| 12 |
|
|
@@ -74,7 +74,7 @@ uploaded_file = st.file_uploader("Select an Image...")
|
|
| 74 |
|
| 75 |
if uploaded_file is not None:
|
| 76 |
# Display the uploaded image
|
| 77 |
-
st.image(uploaded_file, caption="Uploaded Image",
|
| 78 |
|
| 79 |
# Save the image temporarily
|
| 80 |
image_path = save_uploaded_image(uploaded_file)
|
|
|
|
| 6 |
# function part
|
| 7 |
# img2text
|
| 8 |
def img2text(image_path):
|
| 9 |
+
image_to_text = pipeline("image-to-text", model="dumperize/movie-picture-captioning")
|
| 10 |
text = image_to_text(image_path)[0]["generated_text"]
|
| 11 |
return text
|
| 12 |
|
|
|
|
| 74 |
|
| 75 |
if uploaded_file is not None:
|
| 76 |
# Display the uploaded image
|
| 77 |
+
st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
| 78 |
|
| 79 |
# Save the image temporarily
|
| 80 |
image_path = save_uploaded_image(uploaded_file)
|