m7mdal7aj commited on
Commit
7bb2c40
·
verified ·
1 Parent(s): e0a8d2a

Update my_model/tabs/results.py

Browse files
Files changed (1) hide show
  1. 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 accuracy == 1 else 'orange' if round(accuracy,2) == 0.67 else 'red' for accuracy in accuracies]
76
- labels = ['Correct' if accuracy == 1 else 'Partially Correct' if accuracy == 0.67 else 'Incorrect' for accuracy in accuracies]
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)