Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8eae71a08f
ℹ️ 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".
| from ..cv.geometry import compute_horizontal_rotation_angle, compute_min_area_rect, rotate_image | ||
|
|
||
|
|
||
| class AlignLongEdgeHorizontal(DualTransform): |
There was a problem hiding this comment.
Handle bbox/keypoint targets in AlignLongEdgeHorizontal
AlignLongEdgeHorizontal is declared as a DualTransform, so has_dual_transform marks it as spatial and the Ultralytics adapter passes bboxes/keypoints through this transform path, but this class only rotates image and mask and does not implement bbox/keypoint rotation. In detection/keypoint pipelines this will either leave annotations unrotated (misaligned labels) or raise at runtime depending on Albumentations internals, which can corrupt training results as soon as this transform is used with instances.
Useful? React with 👍 / 👎.
src/excvish/cv/geometry.py
Outdated
| image, | ||
| rotation_matrix, | ||
| (new_w, new_h), | ||
| flags=cv2.INTER_LINEAR, |
There was a problem hiding this comment.
Use nearest interpolation when rotating masks
rotate_image hard-codes cv2.INTER_LINEAR, but this helper is also used for mask rotation (AlignLongEdgeHorizontal.apply_to_mask and rotate_rgba_by_mask_long_edge). Linear interpolation introduces intermediate label values on mask edges, so binary/class masks become corrupted after rotation, which can change foreground area and degrade segmentation/detection preprocessing.
Useful? React with 👍 / 👎.
Summary
This PR reorganizes CV-related modules and adds initial pytest coverage for core utilities and geometry rotation behavior.
Changes
cv,albumentations,ultralytics) and updated exports.src/excvish/__init__.py,src/excvish/types.py, and rotation-focused paths insrc/excvish/cv/geometry.py.make testtarget and updated repository documentation, including structure and PR template docs.Testing
make formatmake lintmake testChecklist
docs/.