Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 1.6 benchmark w.r.t. 2.1 #3338

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 9 additions & 5 deletions .github/workflows/perf_benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
type: choice
description: Model category to run benchmark
options:
- speed
- balance
- accuracy
- default # speed, balance, accuracy models only
- all # default + other models
default: all
Expand Down Expand Up @@ -54,7 +57,7 @@ on:
inputs:
model-category:
type: string
description: Model category to run benchmark [default, all]
description: Model category to run benchmark [speed, balance, accuracy, default, all]
default: default
data-group:
type: string
Expand Down Expand Up @@ -156,13 +159,10 @@ jobs:
if: ${{ always() }}

Perf-Benchmark-Summary:
if: ${{ always() }}
needs: Perf-Benchmark-Run
runs-on: ubuntu-latest
steps:
- name: Download benchmark results
uses: actions/download-artifact@v4
with:
path: tests/perf/history/latest
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Python
Expand All @@ -171,6 +171,10 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: python -m pip install --upgrade pip pandas matplotlib nbconvert ipython ipykernel openpyxl
- name: Download benchmark results
uses: actions/download-artifact@v4
with:
path: tests/perf/history/latest
- name: Summarize benchamrk results
run: |
python tests/perf/history/summary.py tests/perf/history ./perf-benchmark-summary --pattern "*raw*.csv"
Expand Down
4 changes: 2 additions & 2 deletions tests/perf/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def pytest_addoption(parser):
"--model-category",
action="store",
default="all",
choices=("default", "all"),
help="Choose default|all. Defaults to all.",
choices=("speed", "balance", "accuracy", "default", "other", "all"),
help="Choose speed|balcence|accuracy|default|other|all. Defaults to all.",
)
parser.addoption(
"--data-group",
Expand Down
13 changes: 10 additions & 3 deletions tests/perf/history/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,26 @@ def normalize(data: pd.DataFrame) -> pd.DataFrame:
data.loc[tiling_indices, "task"] = data.loc[tiling_indices, "task"].str.replace("tiling_", "")
data.loc[tiling_indices, "model"] = data.loc[tiling_indices, "model"] + "_tile"
# Map anomaly metrics
anomaly_indices = data["task"] == "anomaly_classification"
if "test/image_F1Score" in data:
anomaly_indices = data["task"] == "anomaly_classification"
data.loc[anomaly_indices, "test/f1-score"] = data.loc[anomaly_indices, "test/image_F1Score"]
if "export/image_F1Score" in data:
data.loc[anomaly_indices, "export/f1-score"] = data.loc[anomaly_indices, "export/image_F1Score"]
if "optimize/image_F1Score" in data:
data.loc[anomaly_indices, "optimize/f1-score"] = data.loc[anomaly_indices, "optimize/image_F1Score"]
anomaly_indices = data["task"] == "anomaly_detection"
anomaly_indices = data["task"] == "anomaly_detection"
if "test/image_F1Score" in data:
data.loc[anomaly_indices, "test/f1-score"] = data.loc[anomaly_indices, "test/image_F1Score"]
if "export/image_F1Score" in data:
data.loc[anomaly_indices, "export/f1-score"] = data.loc[anomaly_indices, "export/image_F1Score"]
if "optimize/image_F1Score" in data:
data.loc[anomaly_indices, "optimize/f1-score"] = data.loc[anomaly_indices, "optimize/image_F1Score"]
anomaly_indices = data["task"] == "anomaly_segmentation"
if "test/pixel_F1Score" in data:
anomaly_indices = data["task"] == "anomaly_segmentation"
data.loc[anomaly_indices, "test/f1-score"] = data.loc[anomaly_indices, "test/pixel_F1Score"]
if "export/pixel_F1Score" in data:
data.loc[anomaly_indices, "export/f1-score"] = data.loc[anomaly_indices, "export/pixel_F1Score"]
if "optimize/pixel_F1Score" in data:
data.loc[anomaly_indices, "optimize/f1-score"] = data.loc[anomaly_indices, "optimize/pixel_F1Score"]
# Map other names
data = data.rename(columns=V1_V2_NAME_MAP).replace(V1_V2_NAME_MAP)
Expand Down
Loading