Skip to content

Commit

Permalink
handle failed speedtest (for mmdet)
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev committed Sep 6, 2024
1 parent c2ab040 commit 96d9640
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,23 @@ def main_func():
classes_whitelist=g.selected_classes,
)
sly.logger.info(f"{g.session_id = }")
bm.run_evaluation(model_session=g.session_id)
bm.run_speedtest(g.session_id, g.project_id)
bm.visualize()

task_info = api.task.get_info_by_id(g.session_id)
task_dir = f"{g.session_id}_{task_info['meta']['app']['name']}"

res_dir = f"/model-benchmark/{project.id}_{project.name}/{task_dir}/"
res_dir = api.storage.get_free_dir_name(g.team_id, res_dir)

bm.run_evaluation(model_session=g.session_id)
bm.upload_eval_results(res_dir + "/evaluation/")
bm.upload_speedtest_results(res_dir + "/speedtest/")

try:
bm.run_speedtest(g.session_id, g.project_id)
bm.upload_speedtest_results(res_dir + "/speedtest/")
except Exception as e:
sly.logger.warn(f"Speedtest failed. Skipping. {e}")

bm.visualize()
remote_dir = bm.upload_visualizations(res_dir + "/visualizations/")

report = bm.upload_report_link(remote_dir)
Expand Down

0 comments on commit 96d9640

Please sign in to comment.