Submodule upgrades#209
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Test Results 6 files 6 suites 23m 14s ⏱️ Results for commit e569cc6. ♻️ This comment has been updated with latest results. |
📝 WalkthroughWalkthroughDFL-based box decoding is applied across ChangesYOLOv26 DFL Decoding and Infrastructure Updates
Sequence Diagram(s)sequenceDiagram
participant forward as DetectV26/SegmentV26/PoseV26 forward
participant dfl as self.dfl
participant dist2bbox as dist2bbox
participant kpts_decode as _kpts_decode
rect rgba(70, 130, 180, 0.5)
note over forward,dist2bbox: Box decoding (all V26 heads)
forward->>forward: reshape boxes to 4*reg_max, cls to (bs,nc,-1)
forward->>dfl: preds["boxes"]
dfl-->>forward: decoded box deltas
forward->>dist2bbox: decoded deltas + anchors
dist2bbox-->>forward: scaled bboxes
end
rect rgba(180, 100, 60, 0.5)
note over forward,kpts_decode: Keypoint decoding (PoseV26 only)
forward->>forward: reshape kpts to (bs,nk,-1) per level
forward->>kpts_decode: kpts_cat (concatenated levels)
kpts_decode->>kpts_decode: sigmoid visibility (ndim==3)
kpts_decode->>kpts_decode: linear map x/y via anchors+strides
kpts_decode-->>forward: (bs, nk, num_anchors)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@requirements.txt`:
- Line 19: Update the requests package version constraint in requirements.txt
from `requests>=2.32.2` to `requests>=2.33.0` to patch known security
vulnerabilities (CVE-2024-47081 and CVE-2026-25645). Additionally, verify
whether the requests dependency is actually declared as a requirement by yolov5
or if this is an independent project dependency, as yolov5's submodule does not
appear to declare requests as a dependency.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7793a473-b1b0-4bf0-8064-287852ff0dc6
⛔ Files ignored due to path filters (1)
media/coverage_badge.svgis excluded by!**/*.svg
📒 Files selected for processing (5)
requirements.txttools/modules/heads.pytools/yolo/ultralyticstools/yolo/yolov5tools/yolo/yolov5_exporter.py
… to return_semantic
…tools into feat/upgrade-submodules
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tools/modules/heads.py (1)
830-846: 💤 Low valueConsider deriving
bsfrom input tensor to reduce parameter coupling.The
bsparameter is used only at line 846 for the view operation, but it can be derived directly fromkpts.shape[0]. This would make the method signature cleaner and avoid potential mismatches if caller passes an incorrect batch size.- def _kpts_decode(self, bs, kpts): + def _kpts_decode(self, kpts): """Decode keypoints from raw predictions to pixel coordinates. Emulate ultralytics.nn.modules.head.Pose26.kpts_decode. Args: kpts: Raw keypoint predictions (bs, nk, num_anchors) Returns: Decoded keypoints (bs, nk, num_anchors) with x, y in pixel coords """ ndim = self.kpt_shape[1] num_kpts = self.kpt_shape[0] + bs = kpts.shape[0] num_anchors = kpts.shape[2]And update the call site at line 825:
- kpts_decoded = self._kpts_decode(bs, kpts_cat) + kpts_decoded = self._kpts_decode(kpts_cat)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/modules/heads.py` around lines 830 - 846, The _kpts_decode method currently accepts bs as a parameter but can derive it directly from the input tensor to reduce coupling. Remove the bs parameter from the _kpts_decode method signature and instead derive it as bs = kpts.shape[0] at the beginning of the method. Then update the call site at line 825 where _kpts_decode is invoked to pass only the kpts argument instead of passing both bs and kpts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/modules/heads.py`:
- Line 744: The method call to self.proto() is passing an unsupported
return_semantic parameter that is not accepted by the Proto26.forward() method.
Remove the return_semantic=False keyword argument from the self.proto() call,
leaving only the x parameter to be passed to the method.
---
Nitpick comments:
In `@tools/modules/heads.py`:
- Around line 830-846: The _kpts_decode method currently accepts bs as a
parameter but can derive it directly from the input tensor to reduce coupling.
Remove the bs parameter from the _kpts_decode method signature and instead
derive it as bs = kpts.shape[0] at the beginning of the method. Then update the
call site at line 825 where _kpts_decode is invoked to pass only the kpts
argument instead of passing both bs and kpts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Purpose
ultralyticspackage is now a required package for yolov5Specification
Dependencies & Potential Impact
Deployment Plan
Testing & Validation
Summary by CodeRabbit
requests>=2.32.2as a new dependency