Skip to content

Fix clean matte not actually removing some blobs on GPU#212

Merged
nikopueringer merged 4 commits intonikopueringer:mainfrom
MarcelLieb:fix-clean-matte
Apr 8, 2026
Merged

Fix clean matte not actually removing some blobs on GPU#212
nikopueringer merged 4 commits intonikopueringer:mainfrom
MarcelLieb:fix-clean-matte

Conversation

@MarcelLieb
Copy link
Copy Markdown
Contributor

What does this change?

  • fix despeckle not respecting background on GPU
  • add test variants for the torch implementations of clean_matte and despill
  • fix batch processing capability of clean_matte_torch
  • remove the convergence check of the connected component method because it will never actually hit in a real scenario (It usually converges after 2000-4000 iterations at 4k, while we usually only do ~50)
  • tweak alpha threshold and component distance to reduce speckle false positives

We could likely tune the alpha threshold and the minimum component distance even further to improve despeckle quality.
From my understanding the expected speckles are a result of tracking markers on the green screen, which means they are a continuous blob. If blobs are only a few pixels apart they are probably related and can be merged, which gives them a higher chance being preserved by the minimum speckle size.

Likewise we could probably lower the alpha threshold even more (I don't know if 0.5 was chosen for a specific reason).
We could probably lower the threshold to be just above the model noise floor. An optimal value would need more testing though.

How was it tested?

Difference between post-processing on main vs new update

02_3c_00000 02_3c_00000 diff_02_3c_00000

Checklist

  • uv run pytest passes
  • uv run ruff check passes
  • uv run ruff format --check passes

@nikopueringer nikopueringer merged commit 86d7cc1 into nikopueringer:main Apr 8, 2026
3 checks passed
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