Skip to content

Address internals imported from Supervision#1951

Merged
PawelPeczek-Roboflow merged 9 commits intomainfrom
fix/supervision-imports
Jan 28, 2026
Merged

Address internals imported from Supervision#1951
PawelPeczek-Roboflow merged 9 commits intomainfrom
fix/supervision-imports

Conversation

@grzegorz-roboflow
Copy link
Collaborator

@grzegorz-roboflow grzegorz-roboflow commented Jan 28, 2026

What does this PR do?

Address internals imported from Supervision; modules not exposed through main namespace are not (and have never been) guaranteed to be available in future releases of Supervision

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

CI passing

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

N/A


Note

Introduces new visualization blocks and migrates annotators to use Supervision’s public API surface.

  • Adds roboflow_core/halo_visualization@v2 and roboflow_core/polygon_visualization@v2 with cached annotator construction, extended manifest docs, and parameters (opacity, kernel_size for halo; thickness for polygon)
  • Registers new v2 blocks in loader.py
  • Refactors common annotators (visualizations/common/annotators/halo.py, polygon.py) to import ColorLookup, ColorPalette, draw_polygon, mask_to_polygons from public supervision namespace; replaces direct ImageType with a TypeVar supporting numpy.ndarray and PIL.Image.Image; keeps conversion fallback for ensure_cv2_image_for_annotation
  • Updates/extends unit tests to validate manifests and runtime for both v1 and v2 (tests/.../test_halo.py, test_polygon.py)

Written by Cursor Bugbot for commit b5aa41c. This will update automatically on new commits. Configure here.

@codeflash-ai
Copy link
Contributor

codeflash-ai bot commented Jan 28, 2026

⚡️ Codeflash found optimizations for this PR

📄 1,057% (10.57x) speedup for HaloVisualizationBlockV1.getAnnotator in inference/core/workflows/core_steps/visualizations/halo/v2.py

⏱️ Runtime : 2.16 milliseconds 187 microseconds (best of 5 runs)

A dependent PR with the suggested changes has been created. Please review:

If you approve, it will be merged into this PR (branch fix/supervision-imports).

Static Badge

@grzegorz-roboflow
Copy link
Collaborator Author

bugbot review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@PawelPeczek-Roboflow PawelPeczek-Roboflow merged commit b1c06cb into main Jan 28, 2026
52 checks passed
@PawelPeczek-Roboflow PawelPeczek-Roboflow deleted the fix/supervision-imports branch January 28, 2026 15:48
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.

2 participants