r/computervision • • Dec 16 '18

We created a free, fully automatic tool to remove the background of a person image: remove.bg

It consists of multiple deep learning convnet architectures which also compute fine details such as hair

  • No user input is required

  • All the training data was manually generated with sweat and tears

  • Persons are extracted and the resulting images are scaled to max 500px

Its 100% free and you can try it here: remove.bg

Originally we planned to build a smartphone app which relied on this functionality. However, it worked exceptionally well, so that we decided to just publish it as a stand-alone version.

123 Upvotes

32 comments sorted by

6

u/badtyprr Dec 17 '18 edited Dec 17 '18

The results are pretty good. Thanks for sharing. My observations:

  • Works with photos of people only

  • Performs well on hair w/o lens blur (f/4 or narrower)

  • Performs poorly on hair w/ lens blur (f/3.5 or wider)

  • It's impressively fast

2

u/Tuxa13 Dec 17 '18

Thanks for the detailed evaluation!

4

u/dinovfx Dec 17 '18

Great! Thanks for sharing

But, why’s limited to 500px?

0

u/[deleted] Dec 17 '18

[deleted]

5

u/Tuxa13 Dec 17 '18

We use fully convoluational networks, so the 500px is not the network limit here. However, the computation time increases quadratically with the input size - therefore we need some limit.

Just using the upsampled output does not work, because the resulting image will be very blurry and does not look nice at all. Maybe you could use something simple as a guided filter to refine the result, but I did not experiment with it for now. Also, training a separate upscale-and-refine network would be possible.

5

u/StuartGray Dec 17 '18

I’m curious, could you not use this approach to output a 500px alpha mask, then upscale the mask and apply to original image dimensions?

Obviously you’d lose some quality for fine details, but depending on the degree of error, you could probably combine the mask with a smart cut, and mark a small amount of the edge as ‘unknown’ - that might work reliably enough while keeping computation time down?

2

u/bbhargav42 Dec 17 '18

Does the solution works if the image is in different perspective or having background noise. I have tried with simpler images,it works flawlessly. Thank you.

3

u/Tuxa13 Dec 17 '18

Just try it to see where the limits are :)

2

u/ale152 Dec 17 '18

I tried it on a few random images and it worked pretty well. Any chance you release the whole model? Even just a stand alone script would be fantastic, it would be very valuable for research. I'm working with silhouettes and this would be a very interesting approach to transform rgb images of people into binaries silhouettes

2

u/Tuxa13 Dec 17 '18

I am planning to release an API in near future. For low res images (500px) this will most certainly be free as it is right now.

1

u/ale152 Dec 17 '18

That'd be wonderful! Thank you

4

u/Genius38 Dec 17 '18

This is truly amazing work! Definitely fast and precise for graphic designing. The hair selection is just great. Thank you for this!

3

u/[deleted] Dec 17 '18

well done.

So does that mean that if too many people were using it at once it would crash?

Very impressive work though. I'm jealous

3

u/hejtjabo Dec 17 '18

This is looking really cool! What architectures are you using?

2

u/MildSadist Dec 17 '18

Wish this was open source

2

u/dubl0dude Jan 01 '19

I created a PHP package with Laravel support for developers to painlessly and quickly use the remove.bg api. You can find it here: https://github.com/mtownsend5512/remove-bg

1

u/davinnovation Dec 18 '18 edited Dec 18 '18

Wow! Thx for sharing exciting project.How many images are used for training this model?

1

u/Sau001 Dec 18 '18

Excellent

1

u/[deleted] Dec 18 '18

Wow this is amazing.

1

u/percocetpenguin Dec 21 '18

How opposed would you be to me using this to pre-process some datasets for research purposes?

1

u/maxfashko Jan 11 '19

You could achieve much more impressive results for example using this data set http://alphamattingdata.com/.

1

u/2nd-persona Dec 17 '18

Training data generated manually? You mean Photoshop?

Have you heard that many YouTubers use green screen?

3

u/Isvara Dec 17 '18

I'm not understanding your green screen comment. The point is to remove an arbitrary background, not one that can be trivially keyed out.

3

u/2nd-persona Dec 17 '18

You can generate dataset from green screening by adding arbitrary background to image/video. Then you don't need to Photoshop the background out to get dataset.

2

u/Isvara Dec 17 '18

What images would you start from, though? You'd have to set up a green screen in a lot of different lighting conditions with a lot of different people, and you'd still only be simulating cutting people out of a flat background.

1

u/[deleted] Dec 17 '18

Wouldn't that make a pixel pattern way to recognizable, and only a subset of all the possible backgrounds ?

1

u/2nd-persona Dec 17 '18

You can use whatever background...

0

u/CapeAndCowl Dec 17 '18

OR... You can very easily and successfully (and get images larger than 500px in width) do this in the newer versions of Photoshop CC using the Select and Mask option. Here's a quick video on getting started with it

-6

u/[deleted] Dec 17 '18

can I see your code in android? Thank you!

0

u/[deleted] Dec 17 '18

[deleted]

10

u/Tuxa13 Dec 17 '18

We did not publish a paper nor scientifically evaluate it. However, we will write a blog post about it in the future, if there is any interest.

13

u/DendiFaceNoSpace Dec 17 '18

This is some pretty big dick shit. You're literally doing better than Adobe Photoshop at filtering people from images. I've tested a few group photo pictures which would require me 10-15 seconds of manually refining boundaries with the "magic wand" tool and it still gives worse results than this.

You could probably approach some big companies with this.