Skip to content

Fix CI errors in KITTI and YOLO plugins - #22

Merged
mrpositron merged 5 commits into
mainfrom
nauryzbay-lig-10328-plugin-ci-failing-for-kitti-and-yolo-plugin
Aug 12, 2026
Merged

mrpositron merged 5 commits into
mainfrom
nauryzbay-lig-10328-plugin-ci-failing-for-kitti-and-yolo-plugin

Conversation

@mrpositron

@mrpositron mrpositron commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What has changed and why?

Fixes mypy failures in the kitti_export_object_detection and yolo_object_detection plugins. Both broke from upstream releases, neither pins an upper bound.

kitti - lightly_studio 1.0.4 added two required params to LightlyStudioInputBase.__init__. Pass annotation_collection_id (None = export all, as today) and sample_to_image.

yolo - ultralytics now ships py.typed: predict() is declared to return an iterator or tensors, and Boxes has no __iter__. Narrow with isinstance, iterate boxes by index.

How has it been tested?

make install type-check and ruff format --check pass on both plugins. Box iteration verified to yield identical class IDs, coordinates, and confidences.

Did you update Readme.md and plugins.toml?

  • Yes
  • Not needed
  • Fix mypy errors from upstream dependency changes.
  • Update KITTI initialization and require lightly_studio>=1.0.4.
  • Validate Ultralytics predict() results, including empty results.
  • Iterate Boxes by index while preserving class IDs, coordinates, and confidences.
  • Add warnings when YOLO images are skipped.
  • make install type-check and ruff format --check pass.

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>
@mrpositron
mrpositron marked this pull request as ready for review August 11, 2026 17:40
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mrpositron, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62a4de75-2d12-41d6-a6be-876e305d4428

📥 Commits

Reviewing files that changed from the base of the PR and between 01dcc3a and d0b5ba8.

📒 Files selected for processing (1)
  • plugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py
📝 Walkthrough

Walkthrough

The change updates KITTI input initialization and raises its minimum lightly_studio version. It also updates YOLO inference to use model.predict, validate results and boxes, and extract detection values from indexed tensors.

Changes

KITTI annotation input

Layer / File(s) Summary
KITTI input wiring
plugins/kitti_export_object_detection/pyproject.toml, plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py
The plugin requires lightly_studio version 1.0.4 or newer. KittiObjectDetectionInput passes image_sample_to_image and annotation_collection_id=None to its base initializer.

YOLO inference results

Layer / File(s) Summary
YOLO prediction handling
plugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py
The operator uses model.predict, validates the returned Results and boxes, skips images without boxes, and extracts detection values through indexed tensor access.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: jonaswurst

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies fixes to the KITTI and YOLO plugins, which match the primary changes.
Description check ✅ Passed The description covers the changes, motivation, dependency impact, testing, and required README/plugins.toml status.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nauryzbay-lig-10328-plugin-ci-failing-for-kitti-and-yolo-plugin

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Preserve positional-call compatibility.

If callers pass images_root positionally, the new parameter binds the path to annotation_collection_id and sets images_root to None. Move annotation_collection_id after images_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

📥 Commits

Reviewing files that changed from the base of the PR and between c0ad5c4 and 953f5d0.

📒 Files selected for processing (2)
  • plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py
  • plugins/yolo_object_detection/src/lightly_plugins_yolo_object_detection/operator.py

mrpositron and others added 2 commits August 11, 2026 19:55
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>
@mrpositron

Copy link
Copy Markdown
Contributor Author

/review

mrpositron and others added 2 commits August 11, 2026 20:42
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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 953f5d0 and 01dcc3a.

📒 Files selected for processing (3)
  • plugins/kitti_export_object_detection/pyproject.toml
  • plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py
  • plugins/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

@mrpositron
mrpositron merged commit 955b0f4 into main Aug 12, 2026
10 of 11 checks passed
@mrpositron
mrpositron deleted the nauryzbay-lig-10328-plugin-ci-failing-for-kitti-and-yolo-plugin branch August 12, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants