Skip to content

Add sigmoid smoothing to instance segmentation post-processing of YOLO models family in inference-models#2217

Open
PawelPeczek-Roboflow wants to merge 6 commits intomainfrom
feature/add-sigmoid-smoothing-for-segmentation-masks
Open

Add sigmoid smoothing to instance segmentation post-processing of YOLO models family in inference-models#2217
PawelPeczek-Roboflow wants to merge 6 commits intomainfrom
feature/add-sigmoid-smoothing-for-segmentation-masks

Conversation

@PawelPeczek-Roboflow
Copy link
Copy Markdown
Collaborator

@PawelPeczek-Roboflow PawelPeczek-Roboflow commented Apr 9, 2026

What does this PR do?

Change to align post-processing for instance-segmentation with the state of old inference - using sigmoid(...) smoothing and 0.5 thresholding.

Type of Change

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

Testing

  • CI
  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

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

dkosowski87
dkosowski87 previously approved these changes Apr 9, 2026
size_after_pre_processing=image_meta.size_after_pre_processing,
inference_size=image_meta.inference_size,
static_crop_offset=image_meta.static_crop_offset,
binarization_threshold=0.5,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's move the binarization_threshold to a constant, as other INFERENCE_MODELS_YOLO_ULTRALYTICS_DEFAULT_... ones

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the other are configurable - does it make sense since the sigmoid is enabled?

Maybe it's actually valid to expose a knob to enable/disable smoothing and then this threshold being configurable makes more sense (on non smoothed distribution, cutoff point makes much more expression power)

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