Spaces:
Running
Running
greencatted
commited on
Commit
•
17f7d43
1
Parent(s):
884169d
Use Transformers
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
-
from transformers import BlipProcessor, BlipForConditionalGeneration
|
4 |
|
5 |
-
|
6 |
-
|
|
|
|
|
7 |
|
8 |
enable = st.checkbox("Enable camera")
|
9 |
picture = st.camera_input("Take a picture", disabled=not enable)
|
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
|
|
3 |
|
4 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText
|
5 |
+
|
6 |
+
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
|
7 |
+
model = AutoModelForImageTextToText.from_pretrained("Salesforce/blip-image-captioning-large")
|
8 |
|
9 |
enable = st.checkbox("Enable camera")
|
10 |
picture = st.camera_input("Take a picture", disabled=not enable)
|