Skip to content

Commit

Permalink
add evalutaion parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiPetukhov committed Oct 2, 2024
1 parent 43dd103 commit 08d662f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git+https://github.com/supervisely/supervisely.git@model-benchmark-eval-params
28 changes: 27 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
InstanceSegmentationBenchmark,
ObjectDetectionBenchmark,
)
from supervisely.nn.benchmark.evaluation.base_evaluator import BaseEvaluator
from supervisely.nn.inference.session import SessionJSON


Expand All @@ -31,6 +32,7 @@ def main_func():

pbar.show()
sec_pbar.show()
evaluation_parameters = eval_params.get_value()
if task_type == "object detection":
bm = ObjectDetectionBenchmark(
api,
Expand All @@ -39,6 +41,7 @@ def main_func():
progress=pbar,
progress_secondary=sec_pbar,
classes_whitelist=g.selected_classes,
evaluation_parameters=evaluation_parameters,
)
elif task_type == "instance segmentation":
bm = InstanceSegmentationBenchmark(
Expand All @@ -48,6 +51,7 @@ def main_func():
progress=pbar,
progress_secondary=sec_pbar,
classes_whitelist=g.selected_classes,
evaluation_parameters=evaluation_parameters,
)
sly.logger.info(f"{g.session_id = }")

Expand Down Expand Up @@ -108,6 +112,20 @@ def main_func():
sel_app_session = widgets.SelectAppSession(g.team_id, tags=g.deployed_nn_tags, show_label=True)
sel_project = widgets.SelectProject(default_id=None, workspace_id=g.workspace_id)

eval_params = widgets.Editor(initial_text=BaseEvaluator.default_parameters(), language_mode="yaml")
eval_params_apply_button = widgets.Button("Apply")
eval_params_card = widgets.Card(
title="Evaluation parameters",
content=widgets.Container([eval_params, eval_params_apply_button]),
collapsable=True,
)


@eval_params_apply_button.click
def apply_eval_params():
return


button = widgets.Button("Evaluate")
button.disable()

Expand All @@ -121,7 +139,15 @@ def main_func():
title="Settings",
description="Select Ground Truth project and deployed model session",
content=widgets.Container(
[sel_project, sel_app_session, button, report_model_benchmark, pbar, sec_pbar]
[
sel_project,
sel_app_session,
eval_params_card,
button,
report_model_benchmark,
pbar,
sec_pbar,
]
),
)

Expand Down

0 comments on commit 08d662f

Please sign in to comment.