gilalnauman commited on
Commit
3e92a7d
·
verified ·
1 Parent(s): 58b1b05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +123 -2
app.py CHANGED
@@ -1,3 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import altair as alt
@@ -71,6 +177,23 @@ else:
71
  )
72
  st.altair_chart(chart, use_container_width=True)
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  # Highlight Top N Models
75
  st.subheader("Highlight Top N Models")
76
  top_n = st.slider("Number of Top Models", min_value=1, max_value=len(filtered_df), value=5)
@@ -101,5 +224,3 @@ else:
101
  )
102
 
103
 
104
-
105
-
 
1
+ # import streamlit as st
2
+ # import pandas as pd
3
+ # import altair as alt
4
+
5
+ # # Set page layout to wide mode
6
+ # st.set_page_config(
7
+ # page_title="PathVLMs Leaderboard",
8
+ # page_icon="🏆",
9
+ # layout="wide"
10
+ # )
11
+
12
+ # # Load the leaderboard data
13
+ # df = pd.read_csv("leaderboard.csv")
14
+
15
+ # # Add title and description
16
+ # st.title("PathVLMs Leaderboard 🏆")
17
+ # st.markdown("""
18
+ # Welcome to the **PathVLMs Leaderboard**! This leaderboard displays evaluation results for various Vision-Language Models (VLMs) in Pathology, focusing on multiple-choice questions (MCQs), answers, and explanations.
19
+ # You can search, filter, and visualize metrics for better insights.
20
+ # """)
21
+
22
+ # # Sidebar Filters
23
+ # with st.sidebar:
24
+ # st.subheader("Filters")
25
+ # # Search by model name (fuzzy search)
26
+ # search_query = st.text_input("Search for Model Name", value="", placeholder="e.g., llava")
27
+
28
+ # # Filter by model size
29
+ # model_sizes = df['Params (B)'].unique()
30
+ # selected_sizes = st.multiselect("Select Model Sizes", options=model_sizes, default=model_sizes)
31
+
32
+ # # Filter by model type
33
+ # if 'Language Model' in df.columns:
34
+ # model_types = df['Language Model'].unique()
35
+ # selected_types = st.multiselect("Select Model Types", options=model_types, default=model_types)
36
+ # else:
37
+ # selected_types = []
38
+
39
+ # # Apply Filters
40
+ # filtered_df = df[
41
+ # (df['Params (B)'].isin(selected_sizes)) &
42
+ # (df['Language Model'].isin(selected_types) if selected_types else True) &
43
+ # (df['Method'].str.contains(search_query, case=False, na=False))
44
+ # ]
45
+
46
+ # # Main Leaderboard Section
47
+ # st.subheader("Leaderboard Table")
48
+ # if filtered_df.empty:
49
+ # st.warning("No results found. Try adjusting the filters.")
50
+ # else:
51
+ # # Display table in wide layout
52
+ # st.dataframe(
53
+ # filtered_df,
54
+ # height=600, # Adjust table height
55
+ # width=1600 # Adjust table width
56
+ # )
57
+
58
+ # # Visualization of selected metric
59
+ # st.subheader("Performance Metrics Visualization")
60
+ # metric = st.selectbox("Select Metric to Visualize", options=filtered_df.columns[5:])
61
+
62
+ # # Visualization Chart
63
+ # chart = alt.Chart(filtered_df).mark_bar().encode(
64
+ # x=alt.X('Method', sort=alt.EncodingSortField(field=metric, order='descending'), title="Model"),
65
+ # y=alt.Y(metric, title=metric),
66
+ # color='Method',
67
+ # tooltip=['Method', metric]
68
+ # ).properties(
69
+ # width=1400, # Full width
70
+ # height=600 # Increased height
71
+ # )
72
+ # st.altair_chart(chart, use_container_width=True)
73
+
74
+ # # Highlight Top N Models
75
+ # st.subheader("Highlight Top N Models")
76
+ # top_n = st.slider("Number of Top Models", min_value=1, max_value=len(filtered_df), value=5)
77
+ # top_models_df = filtered_df.nlargest(top_n, metric)
78
+
79
+ # top_chart = alt.Chart(top_models_df).mark_bar().encode(
80
+ # x=alt.X('Method', title="Model"),
81
+ # y=alt.Y(metric, title=metric),
82
+ # color='Method',
83
+ # tooltip=['Method', metric]
84
+ # ).properties(
85
+ # width=1400, # Full width
86
+ # height=400 # Adjusted height for smaller chart
87
+ # )
88
+ # st.altair_chart(top_chart, use_container_width=True)
89
+
90
+ # # Download Button
91
+ # @st.cache
92
+ # def convert_df_to_csv(dataframe):
93
+ # return dataframe.to_csv(index=False).encode('utf-8')
94
+
95
+ # csv_data = convert_df_to_csv(filtered_df)
96
+ # st.download_button(
97
+ # label="Download Filtered Results",
98
+ # data=csv_data,
99
+ # file_name="filtered_leaderboard.csv",
100
+ # mime="text/csv"
101
+ # )
102
+
103
+
104
+
105
+
106
+
107
  import streamlit as st
108
  import pandas as pd
109
  import altair as alt
 
177
  )
178
  st.altair_chart(chart, use_container_width=True)
179
 
180
+ # Bubble Plot for Accuracy vs. Model Size
181
+ st.subheader("Bubble Plot: Accuracy vs. Model Size")
182
+ if 'Accuracy' in filtered_df.columns and 'Params (B)' in filtered_df.columns:
183
+ bubble_chart = alt.Chart(filtered_df).mark_circle(size=200).encode(
184
+ x=alt.X('Params (B):Q', title="Model Size (in Billion Params)"),
185
+ y=alt.Y('Accuracy:Q', title="Accuracy"),
186
+ size=alt.Size('Params (B):Q', legend=None),
187
+ color=alt.Color('Method:N', title="Model"),
188
+ tooltip=['Method', 'Accuracy', 'Params (B)']
189
+ ).properties(
190
+ width=800,
191
+ height=600
192
+ )
193
+ st.altair_chart(bubble_chart, use_container_width=True)
194
+ else:
195
+ st.warning("Columns 'Accuracy' and 'Params (B)' are required for the bubble plot.")
196
+
197
  # Highlight Top N Models
198
  st.subheader("Highlight Top N Models")
199
  top_n = st.slider("Number of Top Models", min_value=1, max_value=len(filtered_df), value=5)
 
224
  )
225
 
226