Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,33 +1,3 @@
|
|
1 |
-
# import streamlit as st
|
2 |
-
# from transformers import pipeline
|
3 |
-
|
4 |
-
# # Initialize the image captioning pipeline
|
5 |
-
# captioner = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
6 |
-
|
7 |
-
# # Streamlit app title
|
8 |
-
# st.title("Image to Text Captioning")
|
9 |
-
|
10 |
-
# # Input for image URL
|
11 |
-
# image_url = st.text_input("Enter the URL of the image:")
|
12 |
-
|
13 |
-
# # If an image URL is provided
|
14 |
-
# if image_url:
|
15 |
-
# try:
|
16 |
-
# # Display the image
|
17 |
-
# st.image(image_url, caption="Provided Image", use_column_width=True)
|
18 |
-
|
19 |
-
# # Generate the caption
|
20 |
-
# caption = captioner(image_url)
|
21 |
-
|
22 |
-
# # Display the caption
|
23 |
-
# st.write("**Generated Caption:**")
|
24 |
-
# st.write(caption[0]['generated_text'])
|
25 |
-
# except Exception as e:
|
26 |
-
# st.error(f"An error occurred: {e}")
|
27 |
-
|
28 |
-
# # To run this app, save this code to a file (e.g., `app.py`) and run `streamlit run app.py` in your terminal.
|
29 |
-
|
30 |
-
|
31 |
import streamlit as st
|
32 |
import torch
|
33 |
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
import requests
|