Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -1,88 +1,88 @@
|
|
1 |
import streamlit as st
|
2 |
-
import
|
3 |
-
|
4 |
-
from st_on_hover_tabs import on_hover_tabs
|
5 |
|
6 |
from app.pages import *
|
7 |
|
8 |
-
import json
|
9 |
|
|
|
10 |
st.set_page_config(
|
11 |
-
page_title="Leaderboard",
|
|
|
|
|
12 |
)
|
13 |
|
14 |
-
# st.header("AudioBench Leaderboard")
|
15 |
-
st.markdown('<style>' + open('./style/sidebar_style.css').read() + '</style>', unsafe_allow_html=True)
|
16 |
-
|
17 |
-
with st.sidebar:
|
18 |
-
tabs = on_hover_tabs(tabName=['== INTRODUCTION ==',
|
19 |
-
'ASR - English',
|
20 |
-
'ASR - Singlish',
|
21 |
-
'ASR - Mandarin',
|
22 |
-
'Speech Translation',
|
23 |
-
'Speech Question Answering',
|
24 |
-
'Speech Instruction',
|
25 |
-
'Audio Captioning',
|
26 |
-
'Audio Scene Question Answering',
|
27 |
-
'Accent Recognition',
|
28 |
-
'Gender Recognition',
|
29 |
-
'Emotion Recognition',
|
30 |
-
'Music - MCQ',
|
31 |
-
],
|
32 |
-
iconName=['dashboard', 'filter_1', 'filter_2', 'filter_3', 'filter_4', 'filter_5',
|
33 |
-
'filter_6', 'filter_7', 'filter_8', 'filter_9', 'filter_9_plus', 'filter_9_plus',
|
34 |
-
'filter_9_plus'
|
35 |
-
],
|
36 |
-
styles = {
|
37 |
-
'navtab': {
|
38 |
-
'font-size': '12px',
|
39 |
-
'transition': '0.3s',
|
40 |
-
'text-transform': 'none',
|
41 |
-
},
|
42 |
-
'iconStyle':{
|
43 |
-
'font-size': '18px',
|
44 |
-
|
45 |
-
},
|
46 |
-
},
|
47 |
-
default_choice=0
|
48 |
-
)
|
49 |
-
|
50 |
-
|
51 |
-
if tabs =='== INTRODUCTION ==':
|
52 |
-
dashboard()
|
53 |
-
|
54 |
-
elif tabs == 'ASR - English':
|
55 |
-
asr()
|
56 |
-
|
57 |
-
elif tabs == 'ASR - Singlish':
|
58 |
-
singlish_asr()
|
59 |
-
|
60 |
-
elif tabs == 'ASR - Mandarin':
|
61 |
-
cnasr()
|
62 |
|
63 |
-
elif tabs == 'Speech Question Answering':
|
64 |
-
sqa()
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
-
|
82 |
-
er()
|
83 |
|
84 |
-
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import streamlit_antd_components as sac
|
|
|
|
|
3 |
|
4 |
from app.pages import *
|
5 |
|
|
|
6 |
|
7 |
+
# Set page configuration
|
8 |
st.set_page_config(
|
9 |
+
page_title="AudioBench Leaderboard",
|
10 |
+
page_icon=":chart_with_upwards_trend:",
|
11 |
+
layout="wide",
|
12 |
)
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
|
|
|
|
15 |
|
16 |
+
# Dictionary mapping menu items to their corresponding functions
|
17 |
+
pages = {
|
18 |
+
'Dashboard' : dashboard,
|
19 |
+
'ASR-English' : asr_english,
|
20 |
+
'ASR-Mandarin' : asr_mandarin,
|
21 |
+
'ASR-Singlish' : asr_singlish,
|
22 |
+
'Speech Translation' : speech_translation,
|
23 |
+
'SQA-English' : speech_question_answering_english,
|
24 |
+
'SQA-Singlish' : speech_question_answering_singlish,
|
25 |
+
'Speech Instruction' : speech_instruction,
|
26 |
+
'Audio Captioning' : audio_captioning,
|
27 |
+
'Audio-Scene Question Answering': audio_scene_question_answering,
|
28 |
+
'Accent Recognition' : accent_recognition,
|
29 |
+
'Gender Recognition' : gender_recognition,
|
30 |
+
'Emotion Recognition' : emotion_recognition,
|
31 |
+
'Music Understanding' : music_understanding,
|
32 |
+
}
|
33 |
+
|
34 |
+
# Initialize session state for menu selection
|
35 |
+
if 'selected_menu' not in st.session_state:
|
36 |
+
st.session_state.selected_menu = 'Introduction'
|
37 |
+
|
38 |
+
# Define the menu items
|
39 |
+
menu_items = [
|
40 |
+
sac.MenuItem(label='Dashboard', icon='house'),
|
41 |
+
|
42 |
+
sac.MenuItem(label='Automatic Speech Recognition', icon='mic',
|
43 |
+
children = [
|
44 |
+
sac.MenuItem(label='ASR-English', icon='mic'),
|
45 |
+
sac.MenuItem(label='ASR-Mandarin', icon='mic'),
|
46 |
+
sac.MenuItem(label='ASR-Singlish', icon='mic'),
|
47 |
+
]
|
48 |
+
),
|
49 |
+
|
50 |
+
sac.MenuItem(label='Speech Translation', icon='translate'
|
51 |
+
),
|
52 |
+
|
53 |
+
sac.MenuItem(label='Spoken Question Answering', icon='question-circle',
|
54 |
+
children = [
|
55 |
+
sac.MenuItem(label='SQA-English', icon='mic'),
|
56 |
+
sac.MenuItem(label='SQA-Singlish', icon='mic'),
|
57 |
+
]
|
58 |
+
),
|
59 |
+
|
60 |
+
sac.MenuItem(label='Speech Instruction', icon='mic-fill'),
|
61 |
+
|
62 |
+
sac.MenuItem(label='Audio Captioning', icon='volume-down'),
|
63 |
+
|
64 |
+
sac.MenuItem(label='Audio-Scene Question Answering', icon='question-diamond-fill'),
|
65 |
+
|
66 |
+
sac.MenuItem(label='Accent Recognition', icon='person-badge-fill'),
|
67 |
+
|
68 |
+
sac.MenuItem(label='Gender Recognition', icon='gender-ambiguous'),
|
69 |
|
70 |
+
sac.MenuItem(label='Emotion Recognition', icon='emoji-smile-fill'),
|
|
|
71 |
|
72 |
+
sac.MenuItem(label='Music Understanding', icon='music-note-list'),
|
73 |
+
]
|
74 |
|
75 |
+
# Render the menu in the sidebar
|
76 |
+
with st.sidebar:
|
77 |
+
selected = sac.menu(menu_items,
|
78 |
+
size='sm',
|
79 |
+
open_all=False,
|
80 |
+
)
|
81 |
+
|
82 |
+
# Update session state based on selection
|
83 |
+
if selected:
|
84 |
+
st.session_state.selected_menu = selected
|
85 |
+
|
86 |
+
# Display the selected page's content
|
87 |
+
page = pages[st.session_state.selected_menu]
|
88 |
+
page()
|