Repository navigation
docs(cookbooks): add pose estimation evaluation cookbook - #2842
Merged
Borda merged 6 commits intoNov 16, 2026
Merged
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 #2842 +/- ##
=======================================
Coverage 95% 95%
=======================================
Files 84 84
Lines 15365 15365
=======================================
Hits 14625 14625
Misses 740 740 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The changes require human validation beyond the automated review.
No open issues 🎉
What changed in this PR
Adds a cookbook for evaluating pose estimation with Supervision’s COCO keypoint mAP metric and makes it discoverable from the cookbook gallery.
Changes:
- Introduces an RF-DETR Keypoint evaluation walkthrough, including common scoring mistakes.
- Adds a gallery card tagged
KEYPOINTS,METRICS, andEVALUATION, markedv0.31.2.
Review coverage was limited to the gallery change; the notebook itself was not included.
| File | Description |
|---|---|
docs/theme/cookbooks.html |
Adds the pose evaluation cookbook link and card metadata. |
Review effort: Balanced
8rulerstar
force-pushed
the
docs/cookbook-pose-keypoint-map
branch
from
November 16, 2026 00:19
f5d3b07 to
ec75027
Compare
- Plot the mAP scores from `to_pandas` as a 6x3.5 inch bar chart with shortened labels instead of the fixed 10x6 inch `result.plot()`, and add a short markdown cell before and after it - Set `figure.autolayout` so every figure, including the `sv.plot_images_grid` sample grid, uses tight layout - Convert COCO boxes with `sv.xywh_to_xyxy` instead of the manual in-place add - Pass whole prediction and target lists to `KeyPointMeanAveragePrecision().update` instead of looping per image - Remap class ids with `dataclasses.replace` instead of rebuilding `sv.KeyPoints` field by field - Annotate PIL images with `Image.fromarray` in the sample grid, dropping the BGR channel flip - Replace the saved grid and chart images with outputs from a fresh run --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
…-keypoint-map --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
- Keep only the file name from each COCO image annotation, require the images.cocodataset.org prefix for image URLs, and check the destination stays inside the images folder - Verify the downloaded annotations archive against a pinned SHA-256 and write the extracted JSON through a temporary file, removing the temporary archive in a finally block - Keep the target area in float64 so areas near 32² and 96² cannot fall into two size buckets - Require supervision 0.31.7 or newer in the install cell and update the cookbook card version to match - State the tested environment (a Mac with Apple silicon, MPS), drop the T4 GPU notebook metadata, and say the seed fixes only the image sample [resolve group] review items 1 2 3 4 5 6 7 of roboflow#2842 --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Codex <[email protected]>
- Plot ground truth and RF-DETR predictions as one 1x2 pair per image instead of a 2x2 grid with blank cells - Link rfdetr and supervision in the install cell - Draw a y-axis grid behind the mAP bars --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
- Re-run the notebook end to end with supervision 0.31.7 and rfdetr 1.11.2 - Replace stored plots with one ground truth and prediction pair per image - Replace the mAP bar chart with the version that has a y-axis grid - Print the installed supervision version as 0.31.7 --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Borda
approved these changes
Nov 16, 2026
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.
Description
Adds a cookbook that evaluates a pose model with
KeyPointMeanAveragePrecision. None of the published cookbooks covers keypoints or pose yet, and since 0.31.0 supervision can compute COCO keypoint mAP directly.It runs RF-DETR Keypoint (
RFDETRKeypointPreview) on a fixed-seed slice of 200 COCO val2017 images with people, converts the COCO annotations tosv.KeyPoints(witharea,iscrowdand the person boxes), scores the predictions, and plots the result. A last section reuses the same predictions to show two mistakes that change the score without an error:0.5) drops mAP50-95 from 0.729 to 0.6580while the COCO-pretrained model reports id1give 0.000Motivation and Context
KeyPointMeanAveragePrecisioncame in with #2687, and the metric docs show only a minimal loop. This gives a runnable example on real data.Changes Made
docs/notebooks/evaluate-pose-estimation.ipynb: the cookbook, with outputs.docs/theme/cookbooks.html: card at the end (KEYPOINTS,METRICS,EVALUATION,v0.31.2).Testing
Ran the notebook top to bottom in an empty folder (macOS, MPS) with
supervision==0.31.2andrfdetr==1.11.2: about 1.5 minutes including the 241 MB annotations download. The install cell output and localrf-detrlog lines were removed before committing.Scored the same 200 images and predictions with
pycocotools(iouType="keypoints",imgIdslimited to the slice, results including each prediction'sbbox). mAP50-95 / 50 / 75 / medium / large match to four decimals: 0.7286 / 0.9162 / 0.8004 / 0.6642 / 0.8200.uvx pre-commit run --files docs/notebooks/evaluate-pose-estimation.ipynb docs/theme/cookbooks.htmlpasses.Not tested: a free Colab runtime.
Added/updated tests, and the full suite passes locally (not applicable, docs only)
Updated docs (new cookbook; no public API change)
Added a changelog entry in
docs/changelog.mdunderUnreleased(skipped, docs-only change)Additional Notes
rfdetris pinned to1.11.2because the keypoint model is a preview whose API and weights may change; the numbers in the outputs are tied to that version.pycocotoolscomparison out of the notebook to keep it short. Happy to add it as an optional last cell if that would help.