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

Trained with Segmented Images, Results with Many Additional Black Ellipses Around the Object. #1039

Open
VichyTong opened this issue Oct 30, 2024 · 4 comments

Comments

@VichyTong
Copy link

Hi everyone,

I'm trying to train a .ply model for a single object, e.g., a sofa.

Here are the steps I took:

  1. Segmented the images of the sofa with SAM2. (Since some people mentioned there is an edge translucency issue, I also tried BiRefNet but got the same result.)
    Sample segmented image:

  2. Provided the segmented images with black backgrounds as .png files to Colmap.

  3. Trained the model using the Colmap dataset output.

The issue is that there are some additional black ellipses around the sofa.

There might be two ways to solve this issue:

  • Identify the cause of these additional ellipses and fix it.
  • Post-process the .ply file by filtering out the black ellipses using rule-based algorithms, similar to what supersplat does.

For the first method, I haven't yet figured out the reason for the ellipses.
For the second method, I've tried filtering by distance to the object center, by the tail end of the xyz axis, and by color, but none of these experiments worked. The result is either that the black ellipses remain, or some necessary points are removed.

I also find #542 seems related to my issue, but what I need is a model without the information in the mask.

If anyone has experience with this or suggestions on how to effectively remove these unwanted black ellipses without affecting the main object, I'd really appreciate any guidance. I'm open to trying different approaches or specific configurations in the segmentation or post-processing steps. Thanks in advance for your help!

@AsherJingkongChen
Copy link

AsherJingkongChen commented Oct 30, 2024

I saw this image has alpha channel and transparent background, which may lead to undesired background colors.

You can try converting the PNG to JPEG manually before training. The background should be black.

@VichyTong
Copy link
Author

VichyTong commented Oct 30, 2024

@AsherJingkongChen, thanks for the suggestion!

I converted my dataset from PNG to JPG (dataset link) and trained the model. It seems the background color still has some messy points.
image

However, the black points are different from the results from PNG dataset. I think it's matter to set images to JPG. I'm going to try to find out the reason of generating these annoying balck dots today.

Update: If I train the model with the original background, the result seems to be perfect:

{C3486156-F603-462C-B34B-AACE6955F348}

@AsherJingkongChen
Copy link

AsherJingkongChen commented Oct 30, 2024

@VichyTong

The original Gaussian Splatting does not respect the opacity on PNG images. It does not learn anything from the transparent or fake background. Moreover, it may move splats onto the clean background.

It converts images from any format to RGB in two phases: One is COLMAP preprocessing, and another is Pillow's image reader. Both processes are destructive for RGBA or HDR images.

It is recommended to find other implementations to actually learn from your images. I found this issue is pretty common (Transparent image for training splats), so I'll figure out some solutions in the future, too.

@VichyTong
Copy link
Author

@AsherJingkongChen

It converts images from any format to RGB in two phases: One is COLMAP preprocessing, and another is Pillow's image reader. Both processes are destructive for RGBA or HDR images.

This explanation makes sense for my results. Thank you for you help!

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

No branches or pull requests

2 participants