Update my_model/results/demo.py
Browse files- my_model/results/demo.py +3 -7
my_model/results/demo.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import os
|
| 2 |
-
from my_model.utilities.gen_utilities import log_function_call
|
| 3 |
import altair as alt
|
| 4 |
from my_model.config import evaluation_config as config
|
| 5 |
import streamlit as st
|
|
@@ -41,7 +40,6 @@ class ResultDemonstrator:
|
|
| 41 |
"""
|
| 42 |
st.dataframe(data)
|
| 43 |
|
| 44 |
-
@log_function_call
|
| 45 |
def calculate_and_append_data(self, data_list: list, score_column: str, model_config: str) -> None:
|
| 46 |
"""
|
| 47 |
Calculates mean scores by category and appends them to the data list.
|
|
@@ -59,8 +57,7 @@ class ResultDemonstrator:
|
|
| 59 |
"Configuration": model_config,
|
| 60 |
"Mean Value": round(mean_value * 100, 2)
|
| 61 |
})
|
| 62 |
-
|
| 63 |
-
@log_function_call
|
| 64 |
def display_ablation_results_per_question_category(self) -> None:
|
| 65 |
"""Displays ablation results per question category for each model configuration."""
|
| 66 |
|
|
@@ -90,7 +87,7 @@ class ResultDemonstrator:
|
|
| 90 |
with st.expander(f"{score_type.upper()} Scores per Question Category and Model Configuration"):
|
| 91 |
self.display_table(results_df)
|
| 92 |
|
| 93 |
-
|
| 94 |
def display_main_results(self) -> None:
|
| 95 |
"""Displays the main model results from the Scores sheet, these are displayed from the file directly."""
|
| 96 |
main_scores = pd.read_excel(config.EVALUATION_DATA_PATH, sheet_name="Scores", index_col=0)
|
|
@@ -98,7 +95,7 @@ class ResultDemonstrator:
|
|
| 98 |
main_scores.reset_index()
|
| 99 |
self.display_table(main_scores)
|
| 100 |
|
| 101 |
-
|
| 102 |
def plot_token_count_vs_scores(self, conf: str, model_name: str, score_name: str = 'VQA Score') -> None:
|
| 103 |
"""
|
| 104 |
Plots an interactive scatter plot comparing token count to VQA or EM scores using Altair.
|
|
@@ -194,7 +191,6 @@ class ResultDemonstrator:
|
|
| 194 |
return 'color: black;'
|
| 195 |
|
| 196 |
|
| 197 |
-
@log_function_call
|
| 198 |
def show_samples(self, num_samples: int = 3) -> None:
|
| 199 |
"""
|
| 200 |
Displays random sample images and their associated models answers and evaluations.
|
|
|
|
| 1 |
import os
|
|
|
|
| 2 |
import altair as alt
|
| 3 |
from my_model.config import evaluation_config as config
|
| 4 |
import streamlit as st
|
|
|
|
| 40 |
"""
|
| 41 |
st.dataframe(data)
|
| 42 |
|
|
|
|
| 43 |
def calculate_and_append_data(self, data_list: list, score_column: str, model_config: str) -> None:
|
| 44 |
"""
|
| 45 |
Calculates mean scores by category and appends them to the data list.
|
|
|
|
| 57 |
"Configuration": model_config,
|
| 58 |
"Mean Value": round(mean_value * 100, 2)
|
| 59 |
})
|
| 60 |
+
|
|
|
|
| 61 |
def display_ablation_results_per_question_category(self) -> None:
|
| 62 |
"""Displays ablation results per question category for each model configuration."""
|
| 63 |
|
|
|
|
| 87 |
with st.expander(f"{score_type.upper()} Scores per Question Category and Model Configuration"):
|
| 88 |
self.display_table(results_df)
|
| 89 |
|
| 90 |
+
|
| 91 |
def display_main_results(self) -> None:
|
| 92 |
"""Displays the main model results from the Scores sheet, these are displayed from the file directly."""
|
| 93 |
main_scores = pd.read_excel(config.EVALUATION_DATA_PATH, sheet_name="Scores", index_col=0)
|
|
|
|
| 95 |
main_scores.reset_index()
|
| 96 |
self.display_table(main_scores)
|
| 97 |
|
| 98 |
+
|
| 99 |
def plot_token_count_vs_scores(self, conf: str, model_name: str, score_name: str = 'VQA Score') -> None:
|
| 100 |
"""
|
| 101 |
Plots an interactive scatter plot comparing token count to VQA or EM scores using Altair.
|
|
|
|
| 191 |
return 'color: black;'
|
| 192 |
|
| 193 |
|
|
|
|
| 194 |
def show_samples(self, num_samples: int = 3) -> None:
|
| 195 |
"""
|
| 196 |
Displays random sample images and their associated models answers and evaluations.
|