Spaces:
Sleeping
Sleeping
Update my_model/tabs/results.py
Browse files- my_model/tabs/results.py +5 -2
my_model/tabs/results.py
CHANGED
@@ -6,6 +6,7 @@ from ast import literal_eval
|
|
6 |
from typing import Union, List
|
7 |
import streamlit as st
|
8 |
from my_model.results.evaluation import KBVQAEvaluator
|
|
|
9 |
|
10 |
class ResultDemonstrator(KBVQAEvaluator):
|
11 |
|
@@ -70,10 +71,12 @@ class ResultDemonstrator(KBVQAEvaluator):
|
|
70 |
|
71 |
|
72 |
####################
|
|
|
|
|
73 |
|
74 |
# Define colors and labels for the legend
|
75 |
-
colors = ['green' if
|
76 |
-
labels = ['Correct' if
|
77 |
plt.figure(figsize=(10, 6))
|
78 |
# Create a scatter plot with smaller dots using the 's' parameter
|
79 |
scatter = plt.scatter(range(len(token_counts)), token_counts, c=colors, s=20, label=labels)
|
|
|
6 |
from typing import Union, List
|
7 |
import streamlit as st
|
8 |
from my_model.results.evaluation import KBVQAEvaluator
|
9 |
+
from my_model.config import evaluation_config as config
|
10 |
|
11 |
class ResultDemonstrator(KBVQAEvaluator):
|
12 |
|
|
|
71 |
|
72 |
|
73 |
####################
|
74 |
+
scores = d['vqa_score_13b_caption+detic']
|
75 |
+
token_counts = d['trimmed_tokens_count_caption_detic']
|
76 |
|
77 |
# Define colors and labels for the legend
|
78 |
+
colors = ['green' if score == 1 else 'orange' if round(score,2) == 0.67 else 'red' for score in scores]
|
79 |
+
labels = ['Correct' if score == 1 else 'Partially Correct' if score == 0.67 else 'Incorrect' for score in scores]
|
80 |
plt.figure(figsize=(10, 6))
|
81 |
# Create a scatter plot with smaller dots using the 's' parameter
|
82 |
scatter = plt.scatter(range(len(token_counts)), token_counts, c=colors, s=20, label=labels)
|