Conversation
Adjust tests to call TF.all(); import Py for Python object handling and remove the module-level function registration in the apriltag family module.
Introduce PyTagFamily, PyQuickDecode and PySharpeningBuffer and implement into_family_kind to create TagFamilyKind::Custom from a PyTagFamily. Update TagFamilyKind.name to return the custom family's name and add tests covering the new conversion.
Expose decoder and related types to Python: PyDecodeTagsConfig, PyFitQuadConfig, PyAprilTagDecoder, PyDetection and PyQuad. Add conversions between Rust and Python tag family types and map decoder errors to PyException.
|
@haixuanTao are you guys interested in a dora node including this ? this is a quite crucial part for camera calibration |
I think it would definitely be interesting but I'm not familiar enough with the work to be able to give a precise feedback. And so we can wait for now if it requires a lot of work |
We can try and come up with some demos with this and dora if you're interested :) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
edgarriba
left a comment
There was a problem hiding this comment.
Are in the latest main ? weird that the C++ binding s are breaking while in main seems fine
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive AprilTag detection support to the kornia-py Python bindings by creating new Rust-Python wrappers for the kornia-apriltag crate. The implementation provides a complete API for configuring tag families, detecting tags in images, and accessing detection results including quad corners and homographies.
Key Changes:
- Added Python bindings for AprilTag detection with support for 9 predefined tag families and custom tag definitions
- Implemented configuration classes for detection parameters (decode config, quad fitting)
- Added structured detection results with tag metadata and geometric information
- Updated CI to recursively fetch test data submodules
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
kornia-py/Cargo.toml |
Adds kornia-apriltag crate dependency |
kornia-py/src/lib.rs |
Registers AprilTag module and submodules in Python package |
kornia-py/src/apriltag.rs |
Implements Python bindings for AprilTag detection classes and family management |
kornia-py/tests/test_apriltag.py |
Adds comprehensive tests for tag families and detection functionality |
.github/workflows/python_test.yml |
Enables recursive submodule checkout for test data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def test_all_tag_family_kind(): | ||
| all = TagFamilyKind.all() | ||
| all_expected = [ | ||
| TagFamilyKind("tag16_h5"), |
There was a problem hiding this comment.
How could we have exposed as normal python enums ?
There was a problem hiding this comment.
The problem would arise with data carrying enum variants i.e. ::Custom(...). The python doesn't support it.
This pull request introduces AprilTag detection support to the Python bindings by adding a new
kornia-apriltagcrate, implementing Python wrappers for AprilTag-related types and functionality, and exposing them in the Python module. It also adds comprehensive tests for the new features.AprilTag detection Python bindings:
kornia-apriltagcrate as a dependency inkornia-py/Cargo.tomlto enable AprilTag functionality.kornia-py/src/apriltag.rs, including classes for configuration, decoding, tag families, and detection results. This provides a full API for AprilTag detection in Python.Python module integration:
kornia-py/src/lib.rs, making them available underK.apriltagandK.apriltag.family. [1] [2]Testing and CI:
kornia-py/tests/test_apriltag.py, covering tag family kinds, custom families, and actual detection from images.