Skip to content

Parser, metrics and pre-processing consistency#17

Draft
dtronmans wants to merge 21 commits into
feat/abstract-enginesfrom
fix/normalize
Draft

Parser, metrics and pre-processing consistency#17
dtronmans wants to merge 21 commits into
feat/abstract-enginesfrom
fix/normalize

Conversation

@dtronmans

Copy link
Copy Markdown
Contributor

Purpose

Note that this branches off feat/abstract-engines

This are a collection of fixes that were needed to account for:

  • New DAI-nodes changes to segmentation parser using dai.SegmentationMask here
  • strides now being passable and possibly non-default
  • Previous inconsistencies in the normalization: keep_aspect_ratio should match the default in LuxonisTrain (true) and some changes had to be made to normalization (don't skip if "identity normalization" is detected since this is not the same as LuxonisTrain identity normalization, skip normalization if we're on depthai engine otherwise it is performed twice)
  • Changes to segmentation metric names and computation to make them equivalent to LuxonisTrain

As a result, now we have metric consistency between LuxonisTrain .ckpt, ONNX NNArchive and FP16 RVC4 NNArchive for detection, instance segmentation, keypoints and semantic segmentation (tested with this depthai-nodes branch installed)

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:MODEL_VERSION [TOOL1] [TOOL2]

Submitted code was reviewed by a human: YES/NO

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

@coderabbitai

coderabbitai Bot commented Jul 10, 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: 1c7a7521-0b27-4ab6-9341-78c23b3e0b19

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 fix/normalize

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.

@dtronmans dtronmans changed the title Parser, metrics and Parser, metrics and pre-processing consistency Jul 10, 2026
@dtronmans dtronmans marked this pull request as draft July 13, 2026 11:23
@dtronmans

Copy link
Copy Markdown
Contributor Author

@klemen1999 just for bookkeeping this is the trace through that confirms that removing _is_identity_normalization is correct. Let's assume that we start with mean = [0, 0, 0] and std = [1, 1, 1] on the LuxonisTrain side, so this is YOLO-style normalization that pushes pixels from 0 -> 255 to 0 -> 1.

For an ONNX NNArchive:

  1. LuxonisTrain multiplies by 255 when exporting archive preprocessing here so we end up with mean = [0, 0, 0] and scale = [255, 255, 255]
  2. luxonis-eval converts it back to mean = [0, 0, 0] and std = [1, 1, 1] through the division here
  3. This is still intended to be 0 -> 1 normalization from 0 -> 255, but _is_identity_normalization sees mean=[0, 0, 0] and scale=[1, 1, 1] and incorrectly skips it.

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