Repository navigation
Report file, line and reason for skipped pose label lines (#873) - #876
Merged
Merged
Conversation
YOLOPoseDataset and PoseValidator dropped label lines behind a summary count that always blamed the field count, so a non-numeric field was misreported and no file or line was named. - quote the first 5 offending lines as file:line: reason - distinguish field count, non-numeric class id and non-numeric coordinate - hint how many keypoints a wrong-length line carries, and whether it matches the other kpt_shape keypoint dim - warn about ground-truth lines pose validation drops from its metrics - document the accepted xy / xyv layouts and the skip behaviour
int(float("inf")) raises OverflowError, not ValueError, so a label line
with class id inf / -inf / 1e400 crashed dataset construction and pose
validation instead of being skipped and reported. Greptile P1 on #876.
EHxuban11
force-pushed
the
873-pose-label-diagnostics
branch
from
September 17, 2026 18:28
7cc6ef8 to
447670b
Compare
EHxuban11
added a commit
that referenced
this pull request
Sep 26, 2026
int(float("inf")) raises OverflowError, not ValueError, so a label line
with class id inf / -inf / 1e400 crashed dataset construction and pose
validation instead of being skipped and reported. Greptile P1 on #876.
EHxuban11
added a commit
that referenced
this pull request
Sep 26, 2026
Report file, line and reason for skipped pose label lines (#873)
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.
Closes the logging request left open by #873. Parsing rules are unchanged: the
same lines are still rejected.
What changed
YOLOPoseDatasetnames the label file, the line number and the actual reasonfor each skipped line, quoting the first 5 and counting the rest.
except ValueErrorcovered both the length check and number parsing, so everyrejection printed "field count does not match", including ones that were not
about field count.
the other
kpt_shapekeypoint dim.PoseValidator._build_coco_gt_from_yolodropped malformed ground-truth lineswith no message at all, so reported mAP was computed over fewer objects than
the user expected with nothing in the log. It now warns. Not part of Pose dataset loader drops label lines without saying which ones #873.
docs/dataset_schema.mdand the module docstring state the accepted xy /xyvlayouts and that a bad row is skipped alone, not the whole file.
Review notes
bboxandkeypointsare now slices of one array instead of two separatenp.arraycalls; they are disjoint views, and both call sites copy.MAX_REPORTED_BAD_LINES = 5caps log volume on a dataset with many bad rows.format_bad_label_linesis imported by the validator, hence public.Verification
tests/unit/test_pose_label_diagnostics.py(9 tests): valid[K, 2]and[K, 3]layouts keep every line, the warning names file and line, a numericerror is not reported as field count, quoting is capped.
tests/unit/test_pose_validator.pyfor the dropped ground truth.pytest tests/unit -k "pose or dataset or validat": 876 passed, 29 skipped.Code provenance
Original code written for this PR. No third-party code was ported, adapted, or
derived. The changes are confined to error reporting in
libreyolo/data/pose_dataset.pyandlibreyolo/validation/pose_validator.py,their tests, and documentation.
The PR appears safe to merge; no actionable failures remain in the reviewed changes.
Summary
This PR adds bounded, line-specific diagnostics when malformed YOLO pose labels are skipped during dataset loading or validation.
OverflowErrorinto the parser's existingValueErrorcontract.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Pose label row] --> B{Field count valid?} B -->|No| E[Record file, line, and reason] B -->|Yes| C{Class and coordinates parse?} C -->|No| E C -->|Yes| D[Add pose annotation] E --> F[Skip only malformed row] F --> G[Emit bounded warning summary] D --> H[Training or pose evaluation]Reviews (2) · Last reviewed commit: "Skip non-finite pose class ids instead o..."