Skip to content

Kitti OD export plugin#10

Merged
JonasWurst merged 5 commits into
mainfrom
jonas-lig-8824-export-to-kitti-od-format
Jun 19, 2026
Merged

Kitti OD export plugin#10
JonasWurst merged 5 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

Adds a new KITTI object-detection export plugin to lightly-studio-plugins, allowing users to export the currently filtered image view’s detection annotations into KITTI .txt label files while preserving nested image folder structure in the exported label filenames.

Changes

  • Plugin implementation: New ExportKittiOperator (IMAGE scope) and KittiObjectDetectionInput to write KITTI-formatted labels, including KITTI-relative filename mapping via an optional images_root and computation of a common parent directory for outputs.
  • Behavior tweak: Export behavior was updated to remove/adjust normalization (per commit intent).
  • Documentation & registration: Updated README.md “Available Plugins” and appended the plugin entry to plugins.toml.
  • Packaging/config: Added plugins/kitti_export_object_detection/pyproject.toml with dependencies and lightly_studio.plugins entry point registration.
  • Developer tooling: Added plugin Makefile (install/format/type-check).
  • Licensing: Included Apache License 2.0 for the plugin.

Validated via local installation testing.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new lightly_plugins_kitti_export_object_detection plugin package. The plugin introduces KittiObjectDetectionInput and ExportKittiOperator, which resolve filtered image samples, rewrite filenames relative to a computed common image root, and write KITTI .txt label files. Package scaffolding, registry entry, and README documentation are included.

Changes

KITTI Export Object Detection Plugin

Layer / File(s) Summary
Package scaffolding and entry-point wiring
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/Makefile, plugins/kitti_export_object_detection/LICENSE
pyproject.toml defines metadata, runtime dependencies (lightly_studio, labelformat, sqlmodel), the kitti_export_object_detection entry-point mapping to ExportKittiOperator, and Hatch build config. Makefile adds install, format, and type-check targets. LICENSE is Apache 2.0.
KittiObjectDetectionInput, ExportKittiOperator, and helpers
plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py
KittiObjectDetectionInput extends the base object-detection input, rewriting image and label filenames relative to a computed common root with basename fallback. ExportKittiOperator is an IMAGE-scoped operator that loads the collection, derives an ImageFilter from context, resolves samples, and writes KITTI output via KittiObjectDetectionOutput.save. Helper functions handle filter derivation, common-root computation, and filename generation.
Plugin registry entry and README documentation
plugins.toml, README.md
Appends the lightly_plugins_kitti_export_object_detection block to plugins.toml and adds a KITTI export entry in the README "Available Plugins" section with scope, I/O details, maintainer, and install command.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 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 and concisely summarizes the main change: adding a new plugin for exporting Kitti Object Detection format files.
Description check ✅ Passed The pull request description covers the required template sections: what changed (new Kitti OD export plugin), how it was tested (local installation), and confirmation that README.md and plugins.toml were updated as required.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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

@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 84: The `objects=label.objects` parameter at line 84 now passes class
names unchanged without normalization, but KITTI format requires space-delimited
fields where spaces in class names break parsing and cause field misalignment.
To fix this, either restore the `_normalize_kitti_object_class_name` function to
normalize class names by replacing spaces with underscores (matching KITTI
benchmark conventions like "Person_sitting"), or add validation to ensure input
class names never contain spaces with clear error messages, or configure the
labelformat library with explicit category mapping to handle the transformation.
Additionally, add test cases with sample data containing spaces in class names
to verify the behavior is correct.
🪄 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: 925bcfcd-9252-45ba-ac20-b765615b207b

📥 Commits

Reviewing files that changed from the base of the PR and between d5ce930 and ea4439b.

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

@JonasWurst JonasWurst merged commit 4c01686 into main Jun 19, 2026
7 checks passed
@JonasWurst JonasWurst deleted the jonas-lig-8824-export-to-kitti-od-format branch June 19, 2026 09:11
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.

3 participants