Skip to content

Feat/luxonis eval object#8

Draft
klemen1999 wants to merge 9 commits into
develop-v0.1.0from
feat/luxonis_eval_object
Draft

Feat/luxonis eval object#8
klemen1999 wants to merge 9 commits into
develop-v0.1.0from
feat/luxonis_eval_object

Conversation

@klemen1999

@klemen1999 klemen1999 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Summary

  • Introduces a reusable LuxonisEval evaluation object so setup, evaluation, and cleanup are owned by a Python API instead of living entirely inside the CLI flow.
  • Keeps the CLI path intact by turning eval_run into a thin wrapper around the new object-based lifecycle.
  • Hardens engine/resource lifecycle handling and fixes class-index mapping/report rendering issues that could affect metric correctness.

What Changed

  • Adds luxonis_eval/core.py with setup(), evaluate(), and close() methods, runtime component creation, compatibility checks, and structured result output.
  • Refactors luxonis_eval/__main__.py so eval_run(...) can accept config inputs directly, returns results, and always closes resources in a finally block.
  • Exports LuxonisEval from luxonis_eval/__init__.py and updates the README Python API/docs to cover both one-shot usage and explicit lifecycle control.
  • Refactors BaseEngine to use framework-managed setup() plus subclass _setup_impl(), and replaces teardown() with close().
  • Updates the DepthAI engine and ONNX engine to support explicit setup/close, guard inference before setup, and clear runtime metadata on close.
  • Replaces the old LuxonisLoader monkey-patching path with resolve_luxonis_loader_class_mapping() and builds metric contexts once during evaluator setup.
  • Fixes segmentation/classification metrics so class_index_map is only applied when it actually exists, avoiding incorrect remapping in DiceCoefficient, MIoU, and TopKAccuracy.
  • Fixes report generation in make_report_table() so rendering no longer mutates metric result dictionaries by removing the "metric" key.

Migration Notes

  • Custom engine implementations now need to implement _setup_impl() and close() instead of the previous setup() / teardown() contract.
  • Programmatic callers can continue using eval_run(...), but it now returns a structured results dictionary instead of being CLI-only.

Specification

None / not applicable

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

AI Usage

Assisted-by: AGENT_NAME: Codex

Submitted code was reviewed by a human: YES

The author is taking the responsibility for the contribution: YES

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a08df7f1-f1c0-443b-a79f-0c398006c4dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/luxonis_eval_object

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 and usage tips.

@klemen1999 klemen1999 requested a review from dtronmans June 9, 2026 10:03
@klemen1999 klemen1999 changed the base branch from main to develop-v0.1.0 June 12, 2026 13:58
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.

1 participant