Skip to content

Kitti OD export plugin#10

Open
JonasWurst wants to merge 3 commits into
mainfrom
jonas-lig-8824-export-to-kitti-od-format
Open

Kitti OD export plugin#10
JonasWurst wants to merge 3 commits into
mainfrom
jonas-lig-8824-export-to-kitti-od-format

Conversation

@JonasWurst

@JonasWurst JonasWurst commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What has changed and why?

Adding a Plugin to export Kitti OD files.

How has it been tested?

Installed locally

Did you update Readme.md and plugins.toml?

  • Yes
  • Not needed

Summary

This pull request adds a new KITTI OD (Object Detection) export plugin to the lightly-studio-plugins repository.

Changes

  • Documentation: Updated README.md and plugins.toml to register the new KITTI export plugin
  • Plugin Implementation: Added a complete KITTI export plugin under plugins/kitti_export/ with:
    • ExportKittiOperator: Main operator class that exports filtered image samples to KITTI object-detection format
    • KittiObjectDetectionInput: Input handler that rewrites image and label filenames to KITTI-compatible relative paths
    • Helper functions for path computation and KITTI label file generation
    • Project configuration (pyproject.toml, Makefile) with build and development tasks
    • Apache 2.0 license

The plugin integrates with lightly-studio's operator framework and provides functionality to export collections as KITTI .txt label files while preserving nested folder structure.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JonasWurst, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 39 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2665117a-255f-4dd6-8b00-ecb30e9f0872

📥 Commits

Reviewing files that changed from the base of the PR and between 8459058 and baca84e.

📒 Files selected for processing (7)
  • README.md
  • plugins.toml
  • plugins/kitti_export_object_detection/LICENSE
  • plugins/kitti_export_object_detection/Makefile
  • plugins/kitti_export_object_detection/pyproject.toml
  • plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/__init__.py
  • plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py
📝 Walkthrough

Walkthrough

A new lightly_plugins_kitti_export plugin package is added under plugins/kitti_export/. It introduces KittiObjectDetectionInput and ExportKittiOperator that export filtered image samples to KITTI .txt label files, preserving nested folder structure. The plugin is registered in plugins.toml and documented in README.md.

Changes

KITTI Export Plugin

Layer / File(s) Summary
Package scaffolding and entry-point wiring
plugins/kitti_export/pyproject.toml, plugins/kitti_export/src/lightly_plugins_kitti_export/__init__.py, plugins/kitti_export/Makefile, plugins/kitti_export/LICENSE
pyproject.toml defines the package at version 0.1.0 with dependencies and the kitti_export entry-point wired to ExportKittiOperator; Makefile adds install, format, and type-check targets; LICENSE adds Apache 2.0.
KittiObjectDetectionInput and ExportKittiOperator
plugins/kitti_export/src/lightly_plugins_kitti_export/operator.py
KittiObjectDetectionInput overrides get_images/get_labels to produce KITTI-style relative paths from an optional common images root. ExportKittiOperator is an IMAGE-scoped operator that resolves filtered samples, builds the input, and saves KITTI .txt files via KittiObjectDetectionOutput.save. Helper functions _get_image_filter, _get_common_image_root, and _get_kitti_filename support the operator. The operator is registered in operator_registry at import time.
Plugin registry entry and README docs
plugins.toml, README.md
Appends the lightly_plugins_kitti_export block to plugins.toml and adds the KITTI export plugin entry to the README's "Available Plugins" section with scope, I/O, maintainer, and pip install command.

Sequence Diagram(s)

sequenceDiagram
  participant Studio as lightly-studio
  participant ExportKittiOperator
  participant KittiObjectDetectionInput
  participant KittiObjectDetectionOutput

  Studio->>ExportKittiOperator: execute(session, context, parameters)
  ExportKittiOperator->>ExportKittiOperator: fetch Collection, resolve ImageFilter via _get_image_filter
  ExportKittiOperator->>ExportKittiOperator: build ImageSample list, compute common root via _get_common_image_root
  ExportKittiOperator->>KittiObjectDetectionInput: __init__(session, dataset_id, samples, images_root)
  KittiObjectDetectionInput->>KittiObjectDetectionInput: get_images() — rewrite paths relative to images_root
  KittiObjectDetectionInput->>KittiObjectDetectionInput: get_labels() — emit ImageObjectDetection with _get_kitti_filename paths
  ExportKittiOperator->>KittiObjectDetectionOutput: save(kitti_input, output_folder)
  KittiObjectDetectionOutput-->>ExportKittiOperator: .txt label files written to output_folder
  ExportKittiOperator-->>Studio: OperatorResult(success/failure message)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Kitti OD export plugin' clearly describes the main change - adding a new plugin for exporting data in KITTI Object Detection format.
Description check ✅ Passed The description addresses the required template sections but lacks testing details and uses minimal explanation of changes.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonas-lig-8824-export-to-kitti-od-format

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 and usage tips.

@CLAassistant

CLAassistant commented Jun 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@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

🧹 Nitpick comments (1)
plugins/kitti_export/Makefile (1)

1-13: 💤 Low value

Consider adding standard Makefile targets.

While the current targets (install, format, type-check) cover essential plugin development workflows, Makefile conventions suggest including:

  • test: run the plugin's test suite (if tests exist or will be added)
  • clean: remove build artifacts and cache directories
  • .PHONY already covers the current targets ✓

This is a style improvement; the current setup is functional.

🤖 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/Makefile` around lines 1 - 13, Add two standard Makefile
targets following conventions: a test target that runs the plugin's test suite
using an appropriate test runner (such as uv run pytest), and a clean target
that removes build artifacts and cache directories (such as dist/, build/,
__pycache__/, .mypy_cache/, and .ruff_cache/). Update the .PHONY declaration at
the beginning of the Makefile to include both test and clean targets alongside
the existing install, format, and type-check targets.
🤖 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/pyproject.toml`:
- Around line 6-10: The dependencies list in the pyproject.toml file includes
labelformat and sqlmodel without version constraints, which could lead to
compatibility issues if incompatible versions are installed. Add version bounds
to both the labelformat and sqlmodel entries in the dependencies array using the
format "package>=minimum.version" (and optionally maximum versions like
"package>=minimum.version,<maximum.version") to ensure reproducible
installations and prevent API mismatches at runtime.

---

Nitpick comments:
In `@plugins/kitti_export/Makefile`:
- Around line 1-13: Add two standard Makefile targets following conventions: a
test target that runs the plugin's test suite using an appropriate test runner
(such as uv run pytest), and a clean target that removes build artifacts and
cache directories (such as dist/, build/, __pycache__/, .mypy_cache/, and
.ruff_cache/). Update the .PHONY declaration at the beginning of the Makefile to
include both test and clean targets alongside the existing install, format, and
type-check targets.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2804bdae-4e61-4e5d-83b9-19206d30c0fd

📥 Commits

Reviewing files that changed from the base of the PR and between f793b7d and 8459058.

📒 Files selected for processing (7)
  • README.md
  • plugins.toml
  • plugins/kitti_export/LICENSE
  • plugins/kitti_export/Makefile
  • plugins/kitti_export/pyproject.toml
  • plugins/kitti_export/src/lightly_plugins_kitti_export/__init__.py
  • plugins/kitti_export/src/lightly_plugins_kitti_export/operator.py

Comment thread plugins/kitti_export_object_detection/pyproject.toml
@JonasWurst

Copy link
Copy Markdown
Contributor Author

/review

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