Kitti OD export plugin#10
Conversation
📝 WalkthroughWalkthroughAdds a new ChangesKITTI Export Object Detection Plugin
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 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
🧹 Nitpick comments (1)
plugins/kitti_export/Makefile (1)
1-13: 💤 Low valueConsider 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.PHONYalready 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
📒 Files selected for processing (7)
README.mdplugins.tomlplugins/kitti_export/LICENSEplugins/kitti_export/Makefileplugins/kitti_export/pyproject.tomlplugins/kitti_export/src/lightly_plugins_kitti_export/__init__.pyplugins/kitti_export/src/lightly_plugins_kitti_export/operator.py
|
/review |
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 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
📒 Files selected for processing (1)
plugins/kitti_export_object_detection/src/lightly_plugins_kitti_export_object_detection/operator.py
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?
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
.txtlabel files while preserving nested image folder structure in the exported label filenames.Changes
ExportKittiOperator(IMAGE scope) andKittiObjectDetectionInputto write KITTI-formatted labels, including KITTI-relative filename mapping via an optionalimages_rootand computation of a common parent directory for outputs.README.md“Available Plugins” and appended the plugin entry toplugins.toml.plugins/kitti_export_object_detection/pyproject.tomlwith dependencies andlightly_studio.pluginsentry point registration.Makefile(install/format/type-check).Validated via local installation testing.