MarcosAcv commited on
Commit
54260cf
·
1 Parent(s): 4ef7be6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -1,9 +1,11 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
- pipe = pipeline('sentiment-analysis')
5
- text = st.text_area('enter some text:')
 
6
 
7
- if text:
8
- out = pipe(text)
9
- st.json(out)
 
 
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)