* make pixel and kernel size dynamic * fix: zero-area guard and is-not-None check in Blur/PixelateAnnotator - Skip loop iteration when clip_boxes produces x2<=x1 or y2<=y1 (zero-area ROI) to prevent cv2.error crash in both annotators - Replace falsy `or` pattern with explicit `is not None` so kernel_size=0 / pixel_size=0 are not silently treated as dynamic - Replace hardcoded `cv2.mean(roi)[:3]` with ndim-aware fill: scalar for grayscale, channel-matched tuple for colour images; avoids shape mismatch broadcast error on single-channel frames - test_annotate_bbox_smaller_than_pixel_size_does_not_raise: guards against the OpenCV resize crash from issue #703 when bbox < pixel_size - test_annotate_grayscale_image_does_not_raise: normal pixelation path on 2-D grayscale frame - test_annotate_grayscale_image_small_roi_does_not_raise: avg-fill fallback on 2-D grayscale frame - Add ValueError guard in BlurAnnotator.__init__ and PixelateAnnotator.__init__ for explicit sizes < 1; previously passed straight to cv2 causing ZeroDivisionError or OpenCV assertion failures - Add parametrized tests for invalid sizes (0, -1, -10) and zero-area bbox skipping for both annotators --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: jirka <6035284+Borda@users.noreply.github.com> Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_core.py | ||
| test_utils.py | ||