Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- Add duration of experiments in seconds in the benchmark CSV result by [mzweilin](https://github.com/mzweilin) in https://github.com/openvinotoolkit/anomalib/pull/2392

### Deprecated

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions src/anomalib/pipelines/benchmark/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0

import logging
import time
from datetime import datetime
from pathlib import Path
from tempfile import TemporaryDirectory
Expand Down Expand Up @@ -48,6 +49,7 @@ def run(
task_id: int | None = None,
) -> dict[str, Any]:
"""Run the benchmark."""
start_time = time.time()
devices: str | list[int] = "auto"
if task_id is not None:
devices = [task_id]
Expand All @@ -61,6 +63,7 @@ def run(
)
engine.fit(self.model, self.datamodule)
test_results = engine.test(self.model, self.datamodule)
duration = time.time() - start_time
# TODO(ashwinvaidya17): Restore throughput
# https://github.com/openvinotoolkit/anomalib/issues/2054
output = {
Expand All @@ -69,6 +72,7 @@ def run(
"model": self.model.__class__.__name__,
"data": self.datamodule.__class__.__name__,
"category": self.datamodule.category,
"duration": int(duration),
**test_results[0],
}
logger.info(f"Completed with result {output}")
Expand Down