Skip to content

Commit

Permalink
align with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eunwoosh committed Nov 22, 2023
1 parent 1830b39 commit 96c8c29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/test_suite/run_test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ def test_default_for_task(self):

return _TestModelTemplates


def compare_model_accuracy(performance_to_test: Dict, target_performance: Dict, threshold: Union[float, int]):
for k in target_performance.keys():
if k == "avg_time_per_image":
Expand Down
11 changes: 8 additions & 3 deletions tools/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
from typing import Any, Dict, List, Optional, Union

import yaml
from otx.cli.tools.cli import main as otx_cli
from rich.console import Console
from rich.table import Table

from otx.cli.tools.cli import main as otx_cli


def get_parser() -> argparse.ArgumentParser:
"""Parses command line arguments."""
Expand Down Expand Up @@ -192,11 +193,15 @@ def get_exp_result(self):
def _calculate_avg_std_per_iter(self):
if self._iter_time_arr:
self._exp_result.avg_iter_time = statistics.mean(self._iter_time_arr)
self._exp_result.std_iter_time = statistics.stdev(self._iter_time_arr) if len(self._iter_time_arr) > 1 else 0
self._exp_result.std_iter_time = (
statistics.stdev(self._iter_time_arr) if len(self._iter_time_arr) > 1 else 0
)

if self._data_time_arr:
self._exp_result.avg_data_time = statistics.mean(self._data_time_arr)
self._exp_result.std_data_time = statistics.stdev(self._data_time_arr) if len(self._data_time_arr) > 1 else 0
self._exp_result.std_data_time = (
statistics.stdev(self._data_time_arr) if len(self._data_time_arr) > 1 else 0
)

def _parse_eval_output(self, file_path: Path):
# NOTE: It is assumed that performance.json has key named either score or avg_time_per_image
Expand Down

0 comments on commit 96c8c29

Please sign in to comment.