Skip to content

feat: adjust visualization to scale with image size#482

Merged
tybulewicz merged 2 commits intomasterfrom
mgumowsk/GETI-480-adjusting-visualization-to-image-size
Feb 24, 2026
Merged

feat: adjust visualization to scale with image size#482
tybulewicz merged 2 commits intomasterfrom
mgumowsk/GETI-480-adjusting-visualization-to-image-size

Conversation

@mgumowsk
Copy link
Contributor

@mgumowsk mgumowsk commented Feb 9, 2026

What does this PR do?

Add auto_scale parameter to Visualizer that automatically scales drawing primitives (font sizes, line widths, keypoint radius) relative to a 1280px baseline for large images, with centralized default constants in defaults.py.

Fixes #480

Before

2160p_no_scale

After

2160p_auto_scale

@mgumowsk mgumowsk requested a review from a team as a code owner February 9, 2026 09:38
@github-actions github-actions bot added tests Related to tests python python related changes labels Feb 9, 2026
@mgumowsk mgumowsk requested a review from tybulewicz February 9, 2026 15:08
@tybulewicz tybulewicz requested a review from Copilot February 12, 2026 08:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automatic scaling of visualization primitives so annotations remain readable on high-resolution images, using centralized default constants and propagating a computed scale factor through scenes/primitives.

Changes:

  • Introduces auto_scale to Visualizer and computes a scale factor from image size.
  • Propagates scale through scenes and applies it to font sizes, outline widths, keypoint sizes, and overlay labels.
  • Centralizes visualization defaults (font size, opacity, outline width, baseline) in defaults.py and adds unit tests.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/unit/visualizer/test_auto_scale.py Adds unit tests for scale-factor computation and scale propagation/rendering behavior.
src/model_api/visualizer/visualizer.py Adds auto_scale and scale-factor computation; passes scale into scenes.
src/model_api/visualizer/scene/segmentation/segmentation.py Scales overlay label font sizes in segmentation overlays.
src/model_api/visualizer/scene/segmentation/instance_segmentation.py Scales label, polygon outline, bbox outline, and overlay label font sizes.
src/model_api/visualizer/scene/keypoint.py Scales keypoint radius and score font size.
src/model_api/visualizer/scene/detection.py Scales bbox outline/font and overlay label font sizes.
src/model_api/visualizer/scene/classification.py Scales classification label sizes.
src/model_api/visualizer/scene/anomaly.py Scales anomaly overlays, bbox outline/font, label size, and polygon outline width.
src/model_api/visualizer/primitive/polygon.py Uses centralized default opacity/outline width constants.
src/model_api/visualizer/primitive/overlay.py Adds font_size and scales overlay label rendering parameters.
src/model_api/visualizer/primitive/label.py Uses centralized default font size constant.
src/model_api/visualizer/primitive/keypoints.py Adds configurable font size and uses centralized defaults.
src/model_api/visualizer/primitive/bounding_box.py Adds configurable outline width/font size for bbox rendering.
src/model_api/visualizer/layout/hstack.py Passes overlay font size into Overlay.overlay_labels().
src/model_api/visualizer/defaults.py Introduces centralized visualization default constants and baseline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tybulewicz tybulewicz mentioned this pull request Feb 12, 2026
@mgumowsk
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link

Copilot AI commented Feb 17, 2026

@mgumowsk I've opened a new pull request, #485, to work on those changes. Once the pull request is ready, I'll request review from you.

@mgumowsk mgumowsk added this pull request to the merge queue Feb 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 23, 2026
@tybulewicz tybulewicz added this pull request to the merge queue Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@tybulewicz tybulewicz added this pull request to the merge queue Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@tybulewicz tybulewicz added this pull request to the merge queue Feb 24, 2026
Merged via the queue into master with commit 6cd5ce5 Feb 24, 2026
44 of 46 checks passed
@tybulewicz tybulewicz deleted the mgumowsk/GETI-480-adjusting-visualization-to-image-size branch February 24, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python related changes tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too small labels on images with predictions

4 participants