Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In preprocess_image, using consistent cutoff value for bounding box and pre-multiplied alpha #186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gongminmin
Copy link

The alpha from rembg is not binary. A small foreground object make causing a transition region around the object due to resizing. Binarize the alpha channel with a cutoff value fixes the problem. Also, this cutoff is used in bounding box selection.

Here is an example. Before this change, a wide transition of alpha from 0 to 1 causing the system can't distinguish the foreground and background. The result is a quad shape.
image

After this change, it's much better in 3D shape.
image

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.

1 participant