Spaces:
Runtime error
Runtime error
Commit
·
8187482
1
Parent(s):
b929de0
Remove actual answer on custom questions
Browse files- apps/vqa.py +10 -9
apps/vqa.py
CHANGED
|
@@ -132,15 +132,16 @@ def app(state):
|
|
| 132 |
format_func=lambda x: code_to_name[x],
|
| 133 |
help="The language to be used to show the top-5 labels.",
|
| 134 |
)
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
| 144 |
|
| 145 |
with st.spinner("Predicting..."):
|
| 146 |
logits = predict(transformed_image, dict(question_inputs))
|
|
|
|
| 132 |
format_func=lambda x: code_to_name[x],
|
| 133 |
help="The language to be used to show the top-5 labels.",
|
| 134 |
)
|
| 135 |
+
if question == vqa_state.question:
|
| 136 |
+
|
| 137 |
+
actual_answer = answer_reverse_mapping[str(vqa_state.answer_label)]
|
| 138 |
+
new_col2.markdown(
|
| 139 |
+
"**Actual Answer**: "
|
| 140 |
+
+ translate_labels([actual_answer], vqa_state.answer_lang_id)[0]
|
| 141 |
+
+ " ("
|
| 142 |
+
+ actual_answer
|
| 143 |
+
+ ")"
|
| 144 |
+
)
|
| 145 |
|
| 146 |
with st.spinner("Predicting..."):
|
| 147 |
logits = predict(transformed_image, dict(question_inputs))
|