Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,11 @@ model = ViltForQuestionAnswering.from_pretrained("Minqin/carets_vqa_finetuned")
|
|
13 |
|
14 |
uploaded_file = st.file_uploader("Please upload one image (jpg)", type="jpg")
|
15 |
|
16 |
-
question = st.text_input("Type here the
|
17 |
if uploaded_file is not None:
|
18 |
-
file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.
|
19 |
img = Image.fromarray(file_bytes)
|
|
|
20 |
|
21 |
encoding = processor(images=file_bytes, text=question, return_tensors="pt")
|
22 |
|
|
|
13 |
|
14 |
uploaded_file = st.file_uploader("Please upload one image (jpg)", type="jpg")
|
15 |
|
16 |
+
question = st.text_input("Type here one question on the image")
|
17 |
if uploaded_file is not None:
|
18 |
+
file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.uint8)
|
19 |
img = Image.fromarray(file_bytes)
|
20 |
+
st.image(img, caption="Here is the uploaded image", use_column_width=True)
|
21 |
|
22 |
encoding = processor(images=file_bytes, text=question, return_tensors="pt")
|
23 |
|