File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/anomalib/pipelines/benchmark Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 44# SPDX-License-Identifier: Apache-2.0
55
66import logging
7+ import time
78from datetime import datetime
89from pathlib import Path
910from tempfile import TemporaryDirectory
@@ -48,6 +49,7 @@ def run(
4849 task_id : int | None = None ,
4950 ) -> dict [str , Any ]:
5051 """Run the benchmark."""
52+ start_time = time .time ()
5153 devices : str | list [int ] = "auto"
5254 if task_id is not None :
5355 devices = [task_id ]
@@ -61,6 +63,7 @@ def run(
6163 )
6264 engine .fit (self .model , self .datamodule )
6365 test_results = engine .test (self .model , self .datamodule )
66+ duration = time .time () - start_time
6467 # TODO(ashwinvaidya17): Restore throughput
6568 # https://github.com/openvinotoolkit/anomalib/issues/2054
6669 output = {
@@ -69,6 +72,7 @@ def run(
6972 "model" : self .model .__class__ .__name__ ,
7073 "data" : self .datamodule .__class__ .__name__ ,
7174 "category" : self .datamodule .category ,
75+ "duration" : int (duration ),
7276 ** test_results [0 ],
7377 }
7478 logger .info (f"Completed with result { output } " )
You can’t perform that action at this time.
0 commit comments