From d0777e8d0027682966064f48c510a8b44386a10a Mon Sep 17 00:00:00 2001 From: almaz Date: Thu, 10 Oct 2024 13:38:54 +0200 Subject: [PATCH] convert yaml to dict --- src/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.py b/src/main.py index 1dab895..2d39c5d 100644 --- a/src/main.py +++ b/src/main.py @@ -41,7 +41,7 @@ def main_func(): pbar.show() sec_pbar.show() - evaluation_parameters = eval_params.get_value() + evaluation_parameters = yaml.safe_load(eval_params.get_value()) if task_type == "object detection": bm = ObjectDetectionBenchmark( api, @@ -123,7 +123,7 @@ def main_func(): sel_project = widgets.SelectProject(default_id=None, workspace_id=g.workspace_id) eval_params = widgets.Editor( - initial_text=BaseEvaluator._get_default_evaluation_params(), + initial_text=None, language_mode="yaml", height_lines=16, ) @@ -195,10 +195,10 @@ def update_eval_params(): g.session = SessionJSON(g.api, g.session_id) task_type = g.session.get_deploy_info()["task_type"] if task_type == TaskType.OBJECT_DETECTION: - params = ObjectDetectionEvaluator._get_default_evaluation_params() + params = ObjectDetectionEvaluator.load_yaml_evaluation_params() elif task_type == TaskType.INSTANCE_SEGMENTATION: - params = InstanceSegmentationEvaluator._get_default_evaluation_params() - eval_params.set_text(yaml.dump(params), language_mode="yaml") + params = InstanceSegmentationEvaluator.load_yaml_evaluation_params() + eval_params.set_text(params, language_mode="yaml") eval_params_card.uncollapse()