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.45k stars 535 forks source link

Tested on Windows 10: Try decreasing discard_threshold or start with a larger shift #69

Closed 343intact closed 1 year ago

343intact commented 1 year ago
          Hey man, sorry for taking so long to reply. Just ran everything, updated bgremover, reinstalled Pillow, ran Poweshell in admin mode and got the same issue. Same image as the last time and everything's the same:

PS D:\Programs\backgroundremover-main> python -m backgroundremover.cmd.cli -i "D:\Downloads\Telegram\photo_2023-01-11_12-17-09.jpg" -a -ae 15 -o "meow.png" meow.png downloading part 1 of u2net finished downloading part 1 of u2net downloading part 2 of u2net finished downloading part 2 of u2net downloading part 3 of u2net finished downloading part 3 of u2net downloading part 4 of u2net finished downloading part 4 of u2net PERFORMANCE WARNING: Thresholded incomplete Cholesky decomposition failed due to insufficient positive-definiteness of matrix A with parameters: discard_threshold = 1.000000e-04 shift = 0.000000e+00 Try decreasing discard_threshold or start with a larger shift

Originally posted by @343intact in https://github.com/nadermx/backgroundremover/issues/55#issuecomment-1538089276

nadermx commented 1 year ago

Can you upload the image here?

343intact commented 1 year ago

photo_2023-01-11_12-17-09

343intact commented 1 year ago

I believe that's how it's done, unless there's a way to upload it as a file

nadermx commented 1 year ago

Cute cat, I was able to get it to work on the site catremoved I think it may be one of two, either the image is too large for your system to process it, or your system does not meet min requirement specs. Perhaps try shrinking the image and see if it works.

343intact commented 1 year ago

Yeah, it works all good on site. Which part processes the image, cpu or gpu? You're right, if I crop it a bit and remove the upper part it works, even though hat gets deleted too. But what limits performance? Also, I've just remembered that I can try to remove bg for videos too, and got this after quick test: python -m backgroundremover.cmd.cli -i "D:\Downloads\Telegram\video_2023-04-19_14-28-14.mp4" -mk -o "vid.mov" D:\Downloads\Telegram\video_2023-04-19_14-28-14.mp4 FRAME RATE DETECTED: 30/1 (if this looks wrong, override the frame rate) FRAME RATE: 30 TOTAL FRAMES: 210 WORKER FRAMERIPPER ONLINE WORKER 0 ONLINE Process Process-3: Traceback (most recent call last): File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "D:\Programs\backgroundremover-main\backgroundremover\utilities.py", line 29, in worker net = Net(model_name) File "D:\Programs\backgroundremover-main\backgroundremover\bg.py", line 64, in init utilities.download_downloadfiles_from_github( AttributeError: module 'backgroundremover.utilities' has no attribute 'download_downloadfiles_from_github'

nadermx commented 1 year ago

did you upgrade? That seems like an old binary you are using. pip install --upgrade pip since I fixed that typo of the 'download_downloadfiles_from_github'

nadermx commented 1 year ago

And I mean upgrade backgroundremover, pip install --upgrade backgroundremover

343intact commented 1 year ago

Yeah, for some reason it seems it didn't update the first time I've ran the command. Ok, videos are working, images are working until a certain limit, thank you

nadermx commented 1 year ago

Perhaps try putting a border around the original image. I will close the issue for now, seems new version fixes it to a point.

nadermx commented 1 year ago

I'm going to leave it open on second though, in case I figure out how to drop resource use more or some one else does

343intact commented 1 year ago

Oke, thank you for your app

nadermx commented 1 year ago

Closing this, if some one finds it and wants to reopen jst @ me as in general will keep tying to reduce footprint anyways