Repository navigation
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2537 +/- ##
=======================================
Coverage 94% 94%
=======================================
Files 83 83
Lines 13975 13975
=======================================
Hits 13206 13206
Misses 769 769 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The cookbook lacks required installation and publication metadata and contains misleading claims about universal keypoint ordering.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a self-contained cookbook demonstrating horizontal pose augmentation with COCO-17 left/right keypoint remapping.
Changes:
- Implements deterministic horizontal flipping and semantic row remapping.
- Adds numeric verification and comparative visualization.
- Uses Supervision keypoint annotators for rendering.
Review scores: Code quality 4/5 · Testing 3/5 · Documentation 2/5
File summaries
| File | Description |
|---|---|
docs/notebooks/pose-augmentation-left-right-remapping.ipynb |
Adds the pose-remapping cookbook and visualization. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
c4c7c4a to
6b7f782
Compare
|
addressed all 6 points from the copilot review:
|
|
the notebook now includes the install path, colab entry point, scoped coco notes, and the end-to-end pose augmentation example. outdated review threads are resolved and checks pass. ready for maintainer review. |
Items: - docs(notebooks): permute KeyPoints as a whole, not just xy, in pose-flip cookbook - docs(notebooks): explain how horizontal flip can destroy the (0,0) missing-keypoint sentinel - docs(notebooks): pin albumentations to its last release and note the AlbumentationsX license shift - docs(notebooks): note that hand-topology skeletons need no left/right permutation at all - docs(notebooks): derive LEFT_RIGHT_PAIRS from keypoint names instead of a hand-maintained index table - docs(notebooks): show the concrete label_mapping/label_fields shape AlbumentationsX needs - docs(notebooks): mark LEFT_RIGHT_PAIRS as cookbook-local, not canonical skeleton metadata - docs(changelog): add Unreleased entry for pose-flip cookbook (roboflow#2537) - docs(notebooks): link KeyPoints, EdgeAnnotator, VertexAnnotator, and plot_image to their docs pages - docs(notebooks): link the source issue and state the pose faces away from the viewer [resolve group] PR roboflow#2537 — items 8 9 10 11 12 13 14 15 16 17 --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: OpenAI Codex <[email protected]>
[resolve qa-fix] PR roboflow#2537 — Step 9 QA gate flagged the notebook's archive-date claim ("July 2025") against verified evidence (GitHub API archived_at / last push 2025-06-25); corrected to June 2025. --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Borda
left a comment
There was a problem hiding this comment.
Can we have a simple person silhouette under the keypoint to better undestand what is the front and what is the back side
|
added the silhouette, thanks. each panel now has a grey back-view body behind the skeleton with a thin line down the spine, so it's clear which side is the back. it faces away in all three panels since a flip mirrors the figure but never turns it around. also merged develop to fix the changelog conflict, checks are green. |
Closes roboflow#2519. sv.KeyPoints.xy has a fixed row order per skeleton (row 1 is always left_eye, row 2 always right_eye, and so on), but a horizontal flip only mirrors coordinates. Albumentations' HorizontalFlip has no notion of which row is semantically left or right, so after mirroring, row 1 still says left_eye even though its position is now where the right eye visually is. The cookbook builds a small deterministic pose (right arm raised, no model or dataset needed), flips it, and shows the fix: after mirroring coordinates, also swap each left/right pair's row so the label matches the mirrored side. AlbumentationsX's KeypointParams(label_mapping=...) automates this same swap inside the transform for larger pipelines; doing it explicitly here (rather than adding a hard torch dependency just to demonstrate one kwarg) shows exactly what that option does under the hood, and keeps the cookbook as self-contained as the issue asked for. Includes a numeric verification (every remapped row lands exactly where albumentations' own pixel-index mirror, width - 1 - x, says it should) and a rendered comparison (left joints blue, right red) that makes the bug visible: the naive flip still colors the raised arm red after mirroring, the corrected version colors it blue. Executed end-to-end via jupyter nbconvert before committing; matches the repo's existing notebooks in shipping baked-in outputs (mkdocs-jupyter's execute: false renders them as-is).
- add the missing install cell (supervision, albumentations, opencv-python) and open in colab badge, per CONTRIBUTING.md's cookbook checklist - add the cookbooks.html card so it's discoverable from the cookbooks page - scope the "row 1 is always left_eye" and "these converters return coco-17" claims to coco-17 specifically, since keypoint order actually comes from the source model/skeleton - clear the committed stderr output that leaked a local windows path and an unrelated tqdm warning (fixed at the source by installing ipywidgets, not just stripped from the diff) - add a docstring to the render() helper per agents.md - re-executed end to end so every output is real, not hand-edited
Items: - docs(notebooks): permute KeyPoints as a whole, not just xy, in pose-flip cookbook - docs(notebooks): explain how horizontal flip can destroy the (0,0) missing-keypoint sentinel - docs(notebooks): pin albumentations to its last release and note the AlbumentationsX license shift - docs(notebooks): note that hand-topology skeletons need no left/right permutation at all - docs(notebooks): derive LEFT_RIGHT_PAIRS from keypoint names instead of a hand-maintained index table - docs(notebooks): show the concrete label_mapping/label_fields shape AlbumentationsX needs - docs(notebooks): mark LEFT_RIGHT_PAIRS as cookbook-local, not canonical skeleton metadata - docs(changelog): add Unreleased entry for pose-flip cookbook (roboflow#2537) - docs(notebooks): link KeyPoints, EdgeAnnotator, VertexAnnotator, and plot_image to their docs pages - docs(notebooks): link the source issue and state the pose faces away from the viewer [resolve group] PR roboflow#2537 — items 8 9 10 11 12 13 14 15 16 17 --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: OpenAI Codex <[email protected]>
[resolve qa-fix] PR roboflow#2537 — Step 9 QA gate flagged the notebook's archive-date claim ("July 2025") against verified evidence (GitHub API archived_at / last push 2025-06-25); corrected to June 2025. --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
This had drifted into a real merge conflict against `develop` (shows as `CONFLICTING`). Rebased locally onto current `develop`: one conflict in `docs/theme/cookbooks.html`, where both this PR and `develop` had independently added a new cookbook card to the same list (mine: pose augmentation; theirs: depth maps). Resolved by keeping both cards. `merge-tree` against current `develop` now comes back clean. Ready to push once the force-push goes through on my end. |
940e6f6 to
6b530f9
Compare
Before submitting
Description
A self-contained cookbook showing how to augment
sv.KeyPointswith a horizontal flip while preserving left/right landmark semantics, as requested.Type of Change
Motivation and Context
Closes #2519.
sv.KeyPoints.xyhas a fixed row order per skeleton: for a COCO-17 pose, row 1 is alwaysleft_eye, row 2 alwaysright_eye, and so on. A horizontal flip mirrors coordinates, but Albumentations'HorizontalFliphas no notion of which row is semantically left or right, so after mirroring, row 1 still saysleft_eyeeven though its position is now where the right eye visually is. The cookbook makes this concrete and shows the fix.Changes Made
docs/notebooks/pose-augmentation-left-right-remapping.ipynbA.HorizontalFlip, then fixes the row order by swapping each left/right pair after mirroringwidth - 1 - x)Testing
jupyter nbconvert --executebefore committing; zero errors, all assertions passScreenshots/Videos (optional)
The notebook's own rendered output (visible in the Files changed diff): three panels — original pose, naive flip (still labels the raised arm "right" after mirroring), corrected flip (correctly relabels it "left").
Additional Notes
The issue mentions AlbumentationsX's
KeypointParams(label_mapping=...), which automates this exact row swap inside the transform. I deliberately didn't use it here: AlbumentationsX requirestorchunconditionally (even for a plainHorizontalFlip), which is a multi-GB install just to demonstrate one kwarg, and works against the issue's own stated goal of a cookbook that "needs no model or dataset download." Doing the remap explicitly with vanillaalbumentationskeeps the notebook self-contained and, I'd argue, is more instructive for a cookbook — it shows exactly what that option automates rather than hiding it behind a library flag. Happy to add an AlbumentationsX variant alongside this if that's preferred.