Conversation
Every detector node does the same three things with a model's raw output: drop low-confidence predictions, suppress overlapping boxes, and turn what survives into the loop's dataclasses. None of it depends on the model, yet each node repository had grown its own copy, and the copies had drifted: clip_point was byte-identical in three places, while clip_box existed in the same three plus a fourth that used a centre-based convention under the same name. Move that code here as detector/postprocess.py and detector/geometry.py, and give the centre-based variant its own name (clip_box_centered) so the two conventions can no longer be confused. The library also carried two containers for the same detections: a detector reports ImageMetadata, a trainer's auto-detection pass reports Detections. to_image_metadata and to_detections now build both from one routine, so the two paths clip and filter identically instead of diverging. The scalar arguments of non_max_suppression and post_process are keyword-only: transposing origin_h and origin_w was too easy to do. Add tests/unit, the first suite that runs without a Learning Loop, and gate the credential-dependent jobs on it in CI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 20, 2026
klangenk
changed the base branch from
unify-contributing-and-agent-docs
to
main
August 21, 2026 06:42
klangenk
changed the base branch from
main
to
unify-contributing-and-agent-docs
August 21, 2026 06:44
Contributor
Author
|
Superseded by #94, which combines all three phases into one PR per repository. The commits are unchanged and still readable in order. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Every detector node does the same three things with a model's raw output: drop low-confidence predictions, suppress overlapping boxes, and turn what survives into the loop's dataclasses. None of that depends on the model, yet each node repository grew its own copy — and the copies drifted.
clip_pointis byte-identical in three places acrossdfine_nodeandyolov5_node, whileclip_boxexists in those same three plus a fourth inyolov5_node's trainer that uses a centre-based convention under the same name. A fourth node would have copied it again.This is the first of several changes moving the model-agnostic parts of node development into this library.
Implementation
detector/geometry.pywithclip_box(top-left anchored),clip_point, andclip_box_centered— the centre-based variant gets its own name so the two conventions can no longer be confuseddetector/postprocess.pywithDetection,MIN_BOX_SIZE,bbox_iou,non_max_suppression,post_processanddetections_from_xyxy, taken from thedfine_nodeimplementationto_image_metadata(what a detector node reports) andto_detections(what a trainer's auto-detection pass reports) now share one_append_detectionsroutine, so both paths clip and filter identicallycategory_by_index/category_by_name, which raiseValueErrorwith a helpful message instead ofIndexErroror a bareassert— a model/metadata mismatch is a real error, not a detection to skip quietlynon_max_suppressionandpost_processkeyword-only: transposingorigin_handorigin_wwas too easylearning_loop_node/tests/unit/, the first suite that runs without a Learning Loop, with 31 tests covering clipping, suppression, category resolution and trainer/detector parityunitjob, which needs no secretsAGENTS.mdNotes for the reviewer
post_processkeeps truncating box corners withint()so detector output stays bit-identical to what nodes reported before this change.detections_from_xyxy, which serves the trainer path, rounds instead — matching the code it replaces. The difference is deliberate and documented.clip_boxclamps a corner only at the lower bound, so a box entirely outside the image keeps its origin and collapses to zero size. That is inherited behaviour, unreachable frompost_process(which clips first), and it is captured by a test rather than changed here.dfine_nodePR is where it becomes observable.learning_loop_node==0.21.0until this is released.⬛ claude-opus-5[1m] · 265k tokens · $6.40