nadermx / backgroundremover

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.
https://www.backgroundremoverai.com
MIT License
6.46k stars 538 forks source link

Not so much an issue but a question regarding the output #26

Closed matthewkleinmann closed 1 year ago

matthewkleinmann commented 2 years ago

I am by no means an expert at anything but I am having a fun time playing. I found this project and I just finished an on line python class, and sadly they did not cover venvs until the end so I had all kind of crap in my environment and it literally got version locked, trying to do anything resulted in conflicts. So, I nuked everything and started afresh. Yahoo, and now every toy goes into it's own venv and things are a lot happier. I had no issued getting the background remover going, and I also got the drawing model for it.

So, I wanted to show a pal what I had been up to and it is neat seeing a photo go to the no background to the drawing. Only I was using gmail and it started telling me I was over 25 megs with 3 files. WTF, right? The input file was about 2 megs. So I had a look, the background removed flavor is over 3 and the drawing is like 16. I get the feeling that the output quality is set way higher than the input quality. That may be necessary for GFPGAN or Real-ESRGAN, but does the background removed do any sort of sharpening?

Also, this may not be correct, I am an old command line unix user and I used to use djpeg and cjpeg with the pbm utilities back in the day to fix things from the command line. I recently got the idea to try ffmpeg on images and it is happy to swallow them so if you need to or want to change say a png into a jpe, it is fast and easy from the command line. So I figured WTF, let me see if I zap one of the jpg's that is big into a jpg with ffmpeg, perhaps the default quality factor will be set more um, reasonable and the file will be smaller. The good news is that it is smaller. The bad news is that it is dark. I think there may be something wrong with the background, as far as an image goes and my Microsoft photos app sees the background as white but ffmpeg sees it as black. Not sure if that is a correct assumption or not of if it is a feature or a bug.

If you are curious, here is a dir listing of the files. The ones with the 1 in them are the ones ran back through ffmpeg to shrink them.

:\Users\sdr\Downloads\Playground\rmbg>dir dav. Volume in drive C has no label. Volume Serial Number is CE6D-DA90

Directory of C:\Users\sdr\Downloads\Playground\rmbg

02/05/2022 12:03 AM 2,033,132 Davids_House.jpg 02/05/2022 12:04 AM 16,211,639 Davids_House.jpg_drawing.jpg 02/05/2022 12:23 AM 592,604 Davids_House.jpg_drawing1.jpg 02/05/2022 12:05 AM 3,806,480 Davids_House.jpg_rmbg.jpg 02/05/2022 12:22 AM 304,349 Davids_House.jpg_rmbg1.jpg 5 File(s) 22,948,204 bytes 0 Dir(s) 82,501,693,440 bytes free

C:\Users\sdr\Downloads\Playground\rmbg>

This is a really cool piece of work and I am having a good time with it. Thank you for putting the time into putting it out there.

--Matthew

nadermx commented 1 year ago

try newest release if you are having an issue, cause I'm not sure I understand https://github.com/nadermx/backgroundremover/releases/tag/v0.2.1