Skip to content

Tests refactor - #263

Open
kozlov721 wants to merge 73 commits into
mainfrom
tests/improvement
Open

Tests refactor#263
kozlov721 wants to merge 73 commits into
mainfrom
tests/improvement

Conversation

@kozlov721

@kozlov721 kozlov721 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Previous tests were insufficient. This PR completely refactors the tests, adding coverage reporting and simplified CI.

Specification

  • Adds new tests/conversion tests for more reliable testing of model conversions
  • More properly tested NN Archive conversion, TFLITE, multi-stage conversion
  • 100 % coverage for the conversion part of modelconverter
  • --dev flag now also installs the dev requirements to the image and mounts tests/ from PWD
    • Makes it possible to run tests with modelconverter shell rvc4 --dev -c 'pytest -x'
  • benchmarking tests kept unchanged

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

AI Usage

Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]

Submitted code was reviewed by a human: YES/NO

The author is taking the responsibility for the contribution: YES/NO

Summary by CodeRabbit

  • New Features

    • Improved image preprocessing for models with different input layouts and channel arrangements.
    • Added support for development container builds with live source and test mounting.
    • Added real-model evaluation coverage for conversion quality and segmentation workflows.
  • Bug Fixes

    • Fixed RVC2 handling for grayscale and multi-value inputs.
    • Corrected RVC4 encoding archive detection and LLVM runtime compatibility.
    • Improved calibration data handling and ONNX external-data processing.
  • Refactor

    • Streamlined conversion tests and platform-specific validation across supported targets.
    • Updated publishing and testing workflows for more consistent automation.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

The PR consolidates CI workflows, adds Docker development support, introduces layout-aware preprocessing, updates conversion behavior, replaces legacy package tests with host-side unit tests, and adds broad cross-platform conversion, precision, archive, calibration, evaluation, and type coverage.

Changes

CI and development environment

Layer / File(s) Summary
Consolidated CI and development setup
.github/workflows/ci.yaml, .github/workflows/publish.yaml, docker/*/Dockerfile, pyproject.toml, requirements-dev.txt, tests/conftest.py
Adds matrix CI with unit and integration jobs, development Docker builds, pytest/coverage configuration, updated tooling, and target-specific test selection. Legacy platform-specific workflows are removed.

Runtime conversion behavior

Layer / File(s) Summary
Layout-aware inference and exporter updates
modelconverter/packages/*, modelconverter/utils/image.py, modelconverter/utils/docker_utils.py
Propagates input layouts through inferers and image loading, adjusts color handling, calibration preparation, external-data handling, Docker mounts, environment forwarding, and backend-specific conversion behavior.

Conversion and evaluation coverage

Layer / File(s) Summary
Cross-platform conversion, precision, and evaluation tests
tests/conversion/*, tests/helpers/*
Adds generated model factories, reference inference, precision utilities, real-model metric checks, archive helpers, and conversion tests covering calibration formats, external data, multistage flows, encodings, compilation, and expected failures.

Host-side unit tests

Layer / File(s) Summary
Unit-test isolation and utility coverage
tests/unit/*, tests/conftest.py
Adds isolated fixtures and tests for configuration, calibration data, filesystem operations, metadata, image processing, layouts, encodings, environment handling, getters, archive processing, evaluation helpers, target versions, and data types.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: klemen1999, tersekmatija, conorsim

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes, but it's too generic to convey the main refactor or added conversion coverage. Use a more specific title, e.g. "Refactor and expand conversion tests with new CI coverage".
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tests/improvement

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@kozlov721
kozlov721 force-pushed the tests/improvement branch from f295733 to c0f6bf2 Compare July 25, 2026 19:26
@kozlov721
kozlov721 force-pushed the tests/improvement branch from 7aee76c to 81b34fe Compare July 27, 2026 09:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
modelconverter/packages/hailo/exporter.py (1)

246-251: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Validate normalization vector lengths before emitting the Hailo script.

The config parse path now accepts scalar normalization lists as [v, v, v], so non-3-channel inputs can still be serialized with legacy 3-element means/scales. Reject mismatched mean_values and scale_values before appending the normalization_... command.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/packages/hailo/exporter.py` around lines 246 - 251, Validate
mean_values and scale_values in the normalization emission flow before appending
the normalization command: each vector must match values_len, rejecting
mismatched lengths, including legacy 3-element values for non-3-channel inputs.
Preserve the existing defaults for missing values and only emit normalization
after both vectors pass validation.
🧹 Nitpick comments (2)
modelconverter/packages/base_exporter.py (1)

133-133: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Do not exclude reachable conversion paths from coverage.

Line 133 excludes the entire simplify_onnx body, while Lines 204 and 240 hide normal cleanup and explicit validation behavior. Add focused tests/mocks and reserve pragma: no cover for genuinely untestable external failures.

Suggested change
-    def simplify_onnx(self) -> Path:  # pragma: no cover
+    def simplify_onnx(self) -> Path:

Also applies to: 204-204, 240-240

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/packages/base_exporter.py` at line 133, Remove the `pragma: no
cover` exclusions from `simplify_onnx` and the cleanup and validation branches
at the referenced locations, then add focused tests with mocks that exercise
those reachable conversion paths. Keep coverage exclusions only for genuinely
untestable external failure handling.
tests/unit/test_evaluation.py (1)

37-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing coverage for the source-floor failure branch of assert_quality.

Only the max-drop failure path is exercised; the floor-check branch (reference[metric] < floor) is never triggered by a failing case, leaving that branch uncovered.

Suggested addition
+def test_assert_quality_checks_source_floor() -> None:
+    with pytest.raises(AssertionError, match="below floor"):
+        assert_quality(
+            {"AP": 0.10},
+            {"AP": 0.10},
+            floors={"AP": 0.39},
+            max_drops={"AP": 0.03},
+            case_id="test",
+            platform="rvc4",
+        )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/test_evaluation.py` around lines 37 - 55, Add a failing test case
to test_assert_quality_checks_source_floor_and_drop that makes reference[metric]
fall below its configured floor while avoiding the max-drop condition, and
assert that assert_quality raises AssertionError with the expected floor-related
message. Keep the existing max-drop coverage unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modelconverter/packages/base_exporter.py`:
- Around line 252-255: Update the calibration handling around the is_raw_input
condition so raw inputs retain an array/raw-compatible calibration configuration
when random calibration writes .npy files; do not replace it with
ImageCalibrationConfig unless the data remains image-backed and compatible with
read_img_dir. Preserve the existing image calibration behavior for non-raw
inputs.

In `@tests/conversion/test_model_evaluation.py`:
- Around line 129-172: Update the return type annotation of
_lazy_eval_components to declare all five returned tuple elements, including the
callable corresponding to get_metric_ctx, while preserving the existing parser,
metrics, and mapping callable types.

---

Outside diff comments:
In `@modelconverter/packages/hailo/exporter.py`:
- Around line 246-251: Validate mean_values and scale_values in the
normalization emission flow before appending the normalization command: each
vector must match values_len, rejecting mismatched lengths, including legacy
3-element values for non-3-channel inputs. Preserve the existing defaults for
missing values and only emit normalization after both vectors pass validation.

---

Nitpick comments:
In `@modelconverter/packages/base_exporter.py`:
- Line 133: Remove the `pragma: no cover` exclusions from `simplify_onnx` and
the cleanup and validation branches at the referenced locations, then add
focused tests with mocks that exercise those reachable conversion paths. Keep
coverage exclusions only for genuinely untestable external failure handling.

In `@tests/unit/test_evaluation.py`:
- Around line 37-55: Add a failing test case to
test_assert_quality_checks_source_floor_and_drop that makes reference[metric]
fall below its configured floor while avoiding the max-drop condition, and
assert that assert_quality raises AssertionError with the expected floor-related
message. Keep the existing max-drop coverage unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 66ee9eb5-289c-462d-bffa-22640ee4478c

📥 Commits

Reviewing files that changed from the base of the PR and between 76a8e68 and 27672e9.

📒 Files selected for processing (16)
  • .github/workflows/ci.yaml
  • docker/rvc2/Dockerfile
  • docker/rvc4/Dockerfile
  • modelconverter/packages/base_exporter.py
  • modelconverter/packages/hailo/exporter.py
  • modelconverter/packages/rvc2/exporter.py
  • modelconverter/packages/rvc4/inferer.py
  • requirements-eval.txt
  • tests/conversion/test_model_evaluation.py
  • tests/conversion/test_precision.py
  • tests/conversion/test_toy_integration.py
  • tests/helpers/evaluation.py
  • tests/helpers/onnx_reference.py
  • tests/unit/test_environ.py
  • tests/unit/test_evaluation.py
  • tests/unit/test_random_calibration.py
🚧 Files skipped from review as they are similar to previous changes (8)
  • tests/unit/test_random_calibration.py
  • modelconverter/packages/rvc2/exporter.py
  • tests/conversion/test_precision.py
  • .github/workflows/ci.yaml
  • tests/unit/test_environ.py
  • tests/helpers/onnx_reference.py
  • docker/rvc4/Dockerfile
  • tests/conversion/test_toy_integration.py

Comment thread modelconverter/packages/base_exporter.py
Comment thread tests/conversion/test_model_evaluation.py Outdated
@kozlov721
kozlov721 force-pushed the tests/improvement branch from 1854081 to 9224bc2 Compare July 28, 2026 00:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_benchmark/test_benchmark_regression.py`:
- Around line 215-216: Update test_benchmark_fps to keep the FPS validation
independent of Influx configuration: remove the mandatory influx_token
assertion, allow the conftest-provided optional token, and guard telemetry
persistence so it runs only when influx_token is available while retaining the
FPS check regardless.
- Line 225: Update the expected_fps validation in the benchmark regression test
to accept valid JSON numeric values represented as integers by normalizing
expected_fps with float(...) before comparison, rather than requiring
isinstance(expected_fps, float). Preserve rejection of non-numeric values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d7bbde0-5386-458b-b957-7c9d9ef29afe

📥 Commits

Reviewing files that changed from the base of the PR and between 57c4de3 and 1db1822.

📒 Files selected for processing (12)
  • .github/workflows/ci.yaml
  • modelconverter/utils/nn_archive.py
  • tests/conversion/test_conversion.py
  • tests/conversion/test_model_evaluation.py
  • tests/helpers/onnx_reference.py
  • tests/test_benchmark/conftest.py
  • tests/test_benchmark/test_benchmark_regression.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_config.py
  • tests/unit/test_nn_archive.py
  • tests/unit/test_target_versions.py
  • tests/unit/test_types.py
🚧 Files skipped from review as they are similar to previous changes (10)
  • tests/unit/test_target_versions.py
  • modelconverter/utils/nn_archive.py
  • tests/helpers/onnx_reference.py
  • .github/workflows/ci.yaml
  • tests/conversion/test_conversion.py
  • tests/conversion/test_model_evaluation.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_config.py
  • tests/unit/test_types.py
  • tests/unit/test_nn_archive.py

@kozlov721
kozlov721 force-pushed the tests/improvement branch from 29204ed to f632f62 Compare July 28, 2026 03:48
@luxonis luxonis deleted a comment from coderabbitai Bot Jul 28, 2026
@luxonis luxonis deleted a comment from coderabbitai Bot Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
modelconverter/utils/docker_utils.py (1)

81-86: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not leave HUBAI_API_KEY in the generated compose file.

This key is serialized into a temporary YAML file by docker_exec (Line 466 onward), but that file is created with delete=False and never unlinked. Each run can therefore leave the API key in plaintext on disk. Use a secret/env-file mechanism and remove the compose file in a finally block.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelconverter/utils/docker_utils.py` around lines 81 - 86, Update
docker_exec and the environment construction around the HUBAI_API_KEY entry so
the key is passed through a Docker secret or env-file mechanism rather than
serialized into the generated compose YAML. Ensure the temporary compose file
created with delete=False is always removed in a finally block, including when
execution fails, while preserving existing container environment behavior.
pyproject.toml (1)

182-182: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Make the assert exclusion word-bounded.

In [tool.coverage.report], "assert" is a regex that can match identifiers like _assert_correct, causing helper statements to be excluded even though coverage sources include tests. Use \bassert\b to exclude only assertion statements.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 182, Update the "assert" exclusion entry in the
[tool.coverage.report] configuration to use a word-bounded regular expression,
\bassert\b, so identifiers containing assert are not excluded while assertion
statements remain excluded.
tests/conversion/test_model_evaluation.py (1)

234-297: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Ensure calibration images come from the same parsed dataset samples used for evaluation.

CALIBRATION_SPEC loads only "train", while coco_sample iterates view=["train", "val", "test"]; if val/test samples exist or are ordered differently, zip(coco_sample, images, strict=True) can pair wrong labels with the exported predictions. Use the same view list in both places, use only one source collection for both calibration materialization and metric labels, or assert/document that the data is train-only.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/conversion/test_model_evaluation.py` around lines 234 - 297, Update the
evaluation setup around CALIBRATION_SPEC, coco_sample, and _calibration_images
so calibration images and metric labels come from the same parsed dataset view
and collection, preserving sample order for the strict zip evaluation loop. Use
the shared train/val/test view list consistently, or explicitly constrain both
paths to train-only if that is the intended contract.
🧹 Nitpick comments (1)
tests/conversion/test_model_evaluation.py (1)

276-278: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid relying on LuxonisLoader’s private _classes attribute.

coco_sample._classes[""] reads an underscore-prefixed attribute, which is not a stable public API and can break across luxonis_ml releases. Add a small test helper that receives the class mapping as a public argument instead of reading loader internals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/conversion/test_model_evaluation.py` around lines 276 - 278, Replace
the direct coco_sample._classes access in the ldf_class_map setup with a small
test helper that accepts the class mapping through a public argument. Update the
relevant test calls to pass that mapping explicitly, preserving the existing
name-to-index conversion without depending on LuxonisLoader internals.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modelconverter/packages/rvc2/inferer.py`:
- Around line 17-24: Update the input-processing loop so self.layout is
initialized or refreshed for every four-dimensional input, regardless of whether
self.in_shapes already matches the runtime shape. Keep the shape-cache update
conditional in the existing guard, but perform the NCHW/NHWC inference
independently before loading the network in exec_net.

In `@tests/conftest.py`:
- Around line 22-24: Remove the global suppress_health_check setting from the
modelconverter profile in tests/conft.py, and apply
HealthCheck.function_scoped_fixture suppression only to the specific tests or
modules that intentionally reuse tmp_path across Hypothesis examples. Preserve
the suppression for those affected cases while allowing fixture-isolation checks
elsewhere.

---

Outside diff comments:
In `@modelconverter/utils/docker_utils.py`:
- Around line 81-86: Update docker_exec and the environment construction around
the HUBAI_API_KEY entry so the key is passed through a Docker secret or env-file
mechanism rather than serialized into the generated compose YAML. Ensure the
temporary compose file created with delete=False is always removed in a finally
block, including when execution fails, while preserving existing container
environment behavior.

In `@pyproject.toml`:
- Line 182: Update the "assert" exclusion entry in the [tool.coverage.report]
configuration to use a word-bounded regular expression, \bassert\b, so
identifiers containing assert are not excluded while assertion statements remain
excluded.

In `@tests/conversion/test_model_evaluation.py`:
- Around line 234-297: Update the evaluation setup around CALIBRATION_SPEC,
coco_sample, and _calibration_images so calibration images and metric labels
come from the same parsed dataset view and collection, preserving sample order
for the strict zip evaluation loop. Use the shared train/val/test view list
consistently, or explicitly constrain both paths to train-only if that is the
intended contract.

---

Nitpick comments:
In `@tests/conversion/test_model_evaluation.py`:
- Around line 276-278: Replace the direct coco_sample._classes access in the
ldf_class_map setup with a small test helper that accepts the class mapping
through a public argument. Update the relevant test calls to pass that mapping
explicitly, preserving the existing name-to-index conversion without depending
on LuxonisLoader internals.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b4872ce-811c-467c-beae-8852f43063c0

📥 Commits

Reviewing files that changed from the base of the PR and between 1db1822 and a418362.

📒 Files selected for processing (44)
  • .github/workflows/ci.yaml
  • modelconverter/packages/hailo/exporter.py
  • modelconverter/packages/rvc2/exporter.py
  • modelconverter/packages/rvc2/inferer.py
  • modelconverter/utils/docker_utils.py
  • pyproject.toml
  • requirements-dev.txt
  • tests/conftest.py
  • tests/conversion/test_conversion.py
  • tests/conversion/test_conversion_variants.py
  • tests/conversion/test_external_data.py
  • tests/conversion/test_hailo_compile.py
  • tests/conversion/test_model_evaluation.py
  • tests/conversion/test_precision.py
  • tests/conversion/test_rvc4_encodings.py
  • tests/conversion/test_toy_integration.py
  • tests/conversion/test_toy_multistage.py
  • tests/conversion/test_toy_precision.py
  • tests/conversion/test_toy_tflite.py
  • tests/helpers/archive_factory.py
  • tests/helpers/conversion.py
  • tests/helpers/evaluation.py
  • tests/helpers/onnx_factory.py
  • tests/helpers/onnx_reference.py
  • tests/helpers/platforms.py
  • tests/helpers/precision.py
  • tests/helpers/strategies.py
  • tests/helpers/target_options.py
  • tests/helpers/tflite_factory.py
  • tests/unit/test_calibration_data.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_config.py
  • tests/unit/test_conversion_helpers.py
  • tests/unit/test_encodings.py
  • tests/unit/test_filesystem_utils.py
  • tests/unit/test_general.py
  • tests/unit/test_getters.py
  • tests/unit/test_image.py
  • tests/unit/test_layout.py
  • tests/unit/test_metadata.py
  • tests/unit/test_nn_archive.py
  • tests/unit/test_random_calibration.py
  • tests/unit/test_subprocess.py
  • tests/unit/test_types.py
💤 Files with no reviewable changes (2)
  • tests/helpers/archive_factory.py
  • tests/helpers/tflite_factory.py
🚧 Files skipped from review as they are similar to previous changes (5)
  • modelconverter/packages/hailo/exporter.py
  • tests/unit/test_getters.py
  • tests/unit/test_filesystem_utils.py
  • tests/unit/test_cli_utils.py
  • tests/unit/test_nn_archive.py

Comment thread modelconverter/packages/rvc2/inferer.py
Comment thread tests/conftest.py Outdated
`RVC2Inferer.setup` skipped the layout assignment whenever the configured
shape already matched the IR's, so an NHWC IR whose config carried no layout
reached `infer` as channels-first and `read_image` transposed it. The shape
and the layout now both come from the IR, with a host-side regression test
driving `setup` against a stubbed OpenVINO.

`suppress_health_check=[function_scoped_fixture]` was set on the whole
`modelconverter` Hypothesis profile, silencing the check for every property
test. Only seven of them reuse `work_dir`/`monkeypatch` on purpose, so they
now opt in individually via `reuses_function_fixtures`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants