Skip to content

[AI] Clean up AI object mask post-processing#20954

Merged
TurboGit merged 2 commits intodarktable-org:masterfrom
andriiryzhkov:mask_improvement
May 8, 2026
Merged

[AI] Clean up AI object mask post-processing#20954
TurboGit merged 2 commits intodarktable-org:masterfrom
andriiryzhkov:mask_improvement

Conversation

@andriiryzhkov
Copy link
Copy Markdown
Collaborator

@andriiryzhkov andriiryzhkov commented May 7, 2026

Two post-processing steps were originally added to improve the AI mask quality. After testing and user feedback, both turned out to make things worse – removing them.

  • _morph_open_close clipped real fine details (hair tips, fingers) and filled real concavities (gaps the model correctly identified). Stamped pixels back to hard 0/1, destroying soft alpha.
  • _guided_filter_refine smoothed an already near-binary mask. Confirmed via live tuning: every non-zero radius softened the boundary without improving alignment.

The roles they played are already covered without side effects: _keep_seed_component handles disconnected blobs, potrace's turdsize handles tiny specks.

Result

Post-processing is now: decoder → _keep_seed_component → potrace → feather. Model output reaches the path without displacement or smoothing.

@TurboGit TurboGit added this to the 5.6 milestone May 7, 2026
@TurboGit TurboGit added priority: medium core features are degraded in a way that is still mostly usable, software stutters feature: redesign current features to rewrite scope: image processing correcting pixels labels May 7, 2026
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

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

Works for me, thanks!

@TurboGit TurboGit merged commit e0b0294 into darktable-org:master May 8, 2026
5 checks passed
@andriiryzhkov andriiryzhkov deleted the mask_improvement branch May 8, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: redesign current features to rewrite priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants