Fix CI errors in KITTI and YOLO plugins - #22
mrpositron merged 5 commits into
Conversation
lightly_studio 1.0.4 added two required parameters to LightlyStudioInputBase.__init__. Pass annotation_collection_id and sample_to_image through from KittiObjectDetectionInput, reusing the existing image_sample_to_image strategy. ultralytics now ships py.typed, so mypy sees its real annotations: predict() is declared to return an iterator or tensors, and Boxes has no __iter__. Narrow the result with isinstance and iterate boxes by index instead. No behavior change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 57 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change updates KITTI input initialization and raises its minimum ChangesKITTI annotation input
YOLO inference results
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: 2
🧹 Nitpick comments (1)
plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py (1)
44-44: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPreserve positional-call compatibility.
If callers pass
images_rootpositionally, the new parameter binds the path toannotation_collection_idand setsimages_roottoNone. Moveannotation_collection_idafterimages_root, or make optional parameters keyword-only.🤖 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 `@plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py` at line 44, Update the affected function signature so existing positional calls still bind the path argument to images_root. Move annotation_collection_id after images_root, or make the optional parameters keyword-only, while preserving the current defaults and behavior.
🤖 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
`@plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py`:
- Around line 58-64: Raise the minimum lightly_studio dependency version to
>=1.0.4 so the superclass initialization in the operator supports
annotation_collection_id and sample_to_image; update the relevant dependency
declaration without adding a compatibility path.
In
`@plugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py`:
- Around line 161-165: Update the result-processing logic around the Results and
boxes checks to reject or explicitly report incompatible outputs instead of
silently continuing when boxes is None or the result type is unexpected. Track
skipped or invalid samples so the operator cannot return success with zero
annotations, and guard any results[0] access against an empty prediction list by
returning the appropriate failure or partial result.
---
Nitpick comments:
In
`@plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py`:
- Line 44: Update the affected function signature so existing positional calls
still bind the path argument to images_root. Move annotation_collection_id after
images_root, or make the optional parameters keyword-only, while preserving the
current defaults and behavior.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 155755d4-0b13-492d-9e60-f89004c44b2c
📒 Files selected for processing (2)
plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.pyplugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py
Bump lightly_studio floor to >=1.0.4 in both plugins. The kitti plugin imports image_sample_to_image, which does not exist before 1.0.4, so 1.0.0-1.0.3 installed cleanly and then failed with an ImportError when the entry point loaded. yolo: move results[0] back inside the try so an empty result list returns success=False instead of raising IndexError out of execute(), and log a warning on both skip branches. Pointing model_path at a classification checkpoint previously raised a visible TypeError; it now skips every image, so without a log the operator reports success with zero annotations and no way to diagnose it. Also drop the unused annotation_collection_id parameter from KittiObjectDetectionInput (no caller passes it) and the redundant Boxes annotation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The yolo plugin does not use the export API; all of its lightly_studio imports resolve on 1.0.3. Only kitti imports image_sample_to_image, so only kitti needs the >=1.0.4 floor. Bumping yolo would force an upgrade on users of a plugin that works fine on 1.0.0-1.0.3. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
/review |
predict() only returns tensors when embed= is passed, which this operator never does, so the non-Results branch cannot be reached. An assert documents the expectation and still narrows the type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
__call__ forwards to predict() with the same signature and return type, so the rename was a no-op that enlarged the diff. Reverting keeps )[0] on an unchanged context line and drops the intermediate variable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
`@plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py`:
- Line 59: Update the KittiObjectDetectionInput construction to pass the
selected annotation collection ID instead of None, preserving the user’s
collection selection through the export flow. If the all-collections behavior is
intentional, document it and add coverage confirming that behavior.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4d97c4d7-35dd-448e-af62-b276f502b2ba
📒 Files selected for processing (3)
plugins/kitti_export_object_detection/pyproject.tomlplugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.pyplugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py
🚧 Files skipped from review as they are similar to previous changes (1)
- plugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py
What has changed and why?
Fixes mypy failures in the
kitti_export_object_detectionandyolo_object_detectionplugins. Both broke from upstream releases, neither pins an upper bound.kitti -
lightly_studio1.0.4 added two required params toLightlyStudioInputBase.__init__. Passannotation_collection_id(None= export all, as today) andsample_to_image.yolo -
ultralyticsnow shipspy.typed:predict()is declared to return an iterator or tensors, andBoxeshas no__iter__. Narrow withisinstance, iterate boxes by index.How has it been tested?
make install type-checkandruff format --checkpass on both plugins. Box iteration verified to yield identical class IDs, coordinates, and confidences.Did you update Readme.md and plugins.toml?
lightly_studio>=1.0.4.predict()results, including empty results.Boxesby index while preserving class IDs, coordinates, and confidences.make install type-checkandruff format --checkpass.