I am looking for a more reliable background removal library than rembg, removebg, backgroundremover and openCV (threshold on white pixels) for python. The library will be applied to product photos (car parts) on a mostly white background. Here are some symbolic example images:
Example image 2 bright product
Example image 3 multiple products
I tried using rembg as it is. I also played with post processing, but sometimes the general object selection was wrong. Then I also tried playing around with openCV white thresholding, this led to bad results regarding light colored products. I gave the segment anything model by Meta a try too but didnt get an interactive bounding box segmentation to work properly.
An ideal solution would be a reliable library that just segments a picture or removes the background on any picture. If that's not possible I would like to have a similar proccess like on https://segment-anything.com/demo using the bounding box input by the user.
Try to use Grounded-Segment-Anything with text prompt
car partsto segment out pixels you want to keep (see blue pixels in the image).Internally, the bounding box is generated by applying Grounding Dino to the image and text prompt, and then is fed into SAM as prompt to get the final segmentation.
Here is the comparison between Grounded SAM and U2Net on your images: