Spaces:
Runtime error
Runtime error
Commit
·
41e64cb
1
Parent(s):
892359b
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from PIL import Image
|
| 4 |
+
|
| 5 |
+
model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-large")
|
| 6 |
+
x = st.file_uploader("Upload Images", type=["png","jpg","jpeg"])
|
| 7 |
+
if x is not None:
|
| 8 |
+
st.image(Image.open(x), width=250)
|
| 9 |
+
i = Image.open(x)
|
| 10 |
+
st.write(model(i))
|