still trying to make the leaderboard
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ import os
|
|
| 16 |
from submit import submit_boundary
|
| 17 |
from about import PROBLEM_TYPES, TOKEN, CACHE_PATH, API, submissions_repo, results_repo
|
| 18 |
from utils import read_boundary, write_results, get_user
|
|
|
|
| 19 |
|
| 20 |
def evaluate_boundary(filename):
|
| 21 |
local_path = read_boundary(filename)
|
|
@@ -23,6 +24,8 @@ def evaluate_boundary(filename):
|
|
| 23 |
raw = f.read()
|
| 24 |
data_dict = json.loads(raw)
|
| 25 |
result = evaluate_problem(data_dict['problem_type'], local_path)
|
|
|
|
|
|
|
| 26 |
write_results(data_dict, result)
|
| 27 |
return
|
| 28 |
|
|
@@ -64,14 +67,6 @@ def gradio_interface() -> gr.Blocks:
|
|
| 64 |
render=True
|
| 65 |
)
|
| 66 |
|
| 67 |
-
'''gr.Dataframe(
|
| 68 |
-
value=get_leaderboard(),
|
| 69 |
-
datatype=['str', 'date', 'str', 'str', 'bool', 'html', 'number', 'bool', 'number', 'number', 'str'],
|
| 70 |
-
show_search='filter',
|
| 71 |
-
every=60,
|
| 72 |
-
render=True
|
| 73 |
-
)'''
|
| 74 |
-
|
| 75 |
with gr.TabItem("About", elem_id="boundary-benchmark-tab-table"):
|
| 76 |
gr.Markdown(
|
| 77 |
"""
|
|
|
|
| 16 |
from submit import submit_boundary
|
| 17 |
from about import PROBLEM_TYPES, TOKEN, CACHE_PATH, API, submissions_repo, results_repo
|
| 18 |
from utils import read_boundary, write_results, get_user
|
| 19 |
+
from visualize import make_visual
|
| 20 |
|
| 21 |
def evaluate_boundary(filename):
|
| 22 |
local_path = read_boundary(filename)
|
|
|
|
| 24 |
raw = f.read()
|
| 25 |
data_dict = json.loads(raw)
|
| 26 |
result = evaluate_problem(data_dict['problem_type'], local_path)
|
| 27 |
+
vis = make_visual(json.loads(data_dict['boundary_json']))
|
| 28 |
+
data_dict['vis'] = vis
|
| 29 |
write_results(data_dict, result)
|
| 30 |
return
|
| 31 |
|
|
|
|
| 67 |
render=True
|
| 68 |
)
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
with gr.TabItem("About", elem_id="boundary-benchmark-tab-table"):
|
| 71 |
gr.Markdown(
|
| 72 |
"""
|
submit.py
CHANGED
|
@@ -51,6 +51,7 @@ def submit_boundary(
|
|
| 51 |
"boundary_json": file_content.decode("utf-8"),
|
| 52 |
"evaluated": False,
|
| 53 |
"user": user_state,
|
|
|
|
| 54 |
}
|
| 55 |
with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as tmp:
|
| 56 |
json.dump(record, tmp, indent=2)
|
|
|
|
| 51 |
"boundary_json": file_content.decode("utf-8"),
|
| 52 |
"evaluated": False,
|
| 53 |
"user": user_state,
|
| 54 |
+
"vis": "None"
|
| 55 |
}
|
| 56 |
with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as tmp:
|
| 57 |
json.dump(record, tmp, indent=2)
|