Spaces:
Sleeping
Sleeping
João Pedro
commited on
Commit
·
8f5a987
1
Parent(s):
d280e22
add some printing to help debug
Browse files
app.py
CHANGED
@@ -44,12 +44,14 @@ if uploaded_file:
|
|
44 |
for i, image in enumerate(images):
|
45 |
st.image(image, caption=f'Uploaded Image {i}', use_container_width=True)
|
46 |
|
|
|
47 |
encoding = processor(
|
48 |
image,
|
49 |
return_tensors="pt",
|
50 |
truncation=True,
|
51 |
max_length=512,
|
52 |
)
|
|
|
53 |
outputs = model(**encoding)
|
54 |
prediction = outputs.logits.argmax(-1)[0].item()
|
55 |
|
@@ -64,3 +66,4 @@ if uploaded_file:
|
|
64 |
"Please select the correct label:", labels,
|
65 |
key=f'selectbox-{i}'
|
66 |
)
|
|
|
|
44 |
for i, image in enumerate(images):
|
45 |
st.image(image, caption=f'Uploaded Image {i}', use_container_width=True)
|
46 |
|
47 |
+
print(f'Encoding image with index {i}')
|
48 |
encoding = processor(
|
49 |
image,
|
50 |
return_tensors="pt",
|
51 |
truncation=True,
|
52 |
max_length=512,
|
53 |
)
|
54 |
+
print(f'Predicting image with index {i}')
|
55 |
outputs = model(**encoding)
|
56 |
prediction = outputs.logits.argmax(-1)[0].item()
|
57 |
|
|
|
66 |
"Please select the correct label:", labels,
|
67 |
key=f'selectbox-{i}'
|
68 |
)
|
69 |
+
print(f'Correct label for image {i}: {correct_label}')
|