Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
def image2text(url):
|
| 5 |
+
image_to_text_pipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-large")
|
| 6 |
+
text = image_to_text_pipe(url)[0]['generated_text']
|
| 7 |
|
| 8 |
+
print(text)
|
| 9 |
+
return text
|
| 10 |
+
|
| 11 |
+
image2text(Cpature.PNG)
|