Spaces:
Running
Running
Avijit Ghosh
commited on
Commit
·
e6e82b8
1
Parent(s):
5c81a32
fixed checkbox logic
Browse files
app.py
CHANGED
@@ -40,12 +40,8 @@ globaldf.sort_values(by=['Modality', 'Type'], inplace=True)
|
|
40 |
|
41 |
# Path: taxonomy.py
|
42 |
|
43 |
-
def
|
44 |
-
filteredtable =
|
45 |
-
return filteredtable
|
46 |
-
|
47 |
-
def filter_type(filteredtable, modality_filter):
|
48 |
-
filteredtable = filteredtable[filteredtable['Type'].isin(modality_filter)]
|
49 |
return filteredtable
|
50 |
|
51 |
def showmodal(evt: gr.SelectData):
|
@@ -123,10 +119,10 @@ The following categories are high-level, non-exhaustive, and present a synthesis
|
|
123 |
# info="Which modality to show."
|
124 |
)
|
125 |
with gr.Row():
|
126 |
-
|
127 |
-
|
128 |
-
modality_filter.change(
|
129 |
-
type_filter.change(
|
130 |
|
131 |
|
132 |
with Modal(visible=False) as modal:
|
@@ -136,7 +132,7 @@ The following categories are high-level, non-exhaustive, and present a synthesis
|
|
136 |
abstractmd = gr.Markdown(visible=False)
|
137 |
datasetmd = gr.Markdown(visible=False)
|
138 |
gallery = gr.Gallery(visible=False)
|
139 |
-
|
140 |
|
141 |
|
142 |
|
@@ -161,10 +157,10 @@ The following categories are high-level, non-exhaustive, and present a synthesis
|
|
161 |
# info="Which modality to show."
|
162 |
)
|
163 |
with gr.Row():
|
164 |
-
|
165 |
-
|
166 |
-
modality_filter.change(
|
167 |
-
type_filter.change(
|
168 |
|
169 |
|
170 |
with Modal(visible=False) as modal:
|
@@ -174,7 +170,8 @@ The following categories are high-level, non-exhaustive, and present a synthesis
|
|
174 |
abstractmd = gr.Markdown(visible=False)
|
175 |
datasetmd = gr.Markdown(visible=False)
|
176 |
gallery = gr.Gallery(visible=False)
|
177 |
-
|
|
|
178 |
|
179 |
|
180 |
# with gr.TabItem("Disparate Performance"):
|
|
|
40 |
|
41 |
# Path: taxonomy.py
|
42 |
|
43 |
+
def filter_modality_type(fulltable, modality_filter, type_filter):
|
44 |
+
filteredtable = fulltable[fulltable['Modality'].isin(modality_filter) & fulltable['Type'].isin(type_filter)]
|
|
|
|
|
|
|
|
|
45 |
return filteredtable
|
46 |
|
47 |
def showmodal(evt: gr.SelectData):
|
|
|
119 |
# info="Which modality to show."
|
120 |
)
|
121 |
with gr.Row():
|
122 |
+
table_full = gr.DataFrame(value=fulltable, wrap=True, datatype="markdown", visible=False, interactive=False)
|
123 |
+
table_filtered = gr.DataFrame(value=fulltable, wrap=True, datatype="markdown", visible=True, interactive=False)
|
124 |
+
modality_filter.change(filter_modality_type, inputs=[table_full, modality_filter, type_filter], outputs=table_filtered)
|
125 |
+
type_filter.change(filter_modality_type, inputs=[table_full, modality_filter, type_filter], outputs=table_filtered)
|
126 |
|
127 |
|
128 |
with Modal(visible=False) as modal:
|
|
|
132 |
abstractmd = gr.Markdown(visible=False)
|
133 |
datasetmd = gr.Markdown(visible=False)
|
134 |
gallery = gr.Gallery(visible=False)
|
135 |
+
table_filtered.select(showmodal, None, [modal, titlemd, authormd, tagsmd, abstractmd, datasetmd, gallery])
|
136 |
|
137 |
|
138 |
|
|
|
157 |
# info="Which modality to show."
|
158 |
)
|
159 |
with gr.Row():
|
160 |
+
table_full = gr.DataFrame(value=fulltable, wrap=True, datatype="markdown", visible=False, interactive=False)
|
161 |
+
table_filtered = gr.DataFrame(value=fulltable, wrap=True, datatype="markdown", visible=True, interactive=False)
|
162 |
+
modality_filter.change(filter_modality_type, inputs=[table_full, modality_filter, type_filter], outputs=table_filtered)
|
163 |
+
type_filter.change(filter_modality_type, inputs=[table_full, modality_filter, type_filter], outputs=table_filtered)
|
164 |
|
165 |
|
166 |
with Modal(visible=False) as modal:
|
|
|
170 |
abstractmd = gr.Markdown(visible=False)
|
171 |
datasetmd = gr.Markdown(visible=False)
|
172 |
gallery = gr.Gallery(visible=False)
|
173 |
+
table_filtered.select(showmodal, None, [modal, titlemd, authormd, tagsmd, abstractmd, datasetmd, gallery])
|
174 |
+
|
175 |
|
176 |
|
177 |
# with gr.TabItem("Disparate Performance"):
|