Minqin commited on
Commit
30b0855
1 Parent(s): 1dbea58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 question")
17
  if uploaded_file is not None:
18
- file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.unit8)
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