Giter Club home page Giter Club logo

nadermx / backgroundremover Goto Github PK

View Code? Open in Web Editor NEW
6.5K 48.0 538.0 326.07 MB

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.

Home Page: https://www.backgroundremoverai.com

License: MIT License

Python 99.11% Dockerfile 0.89%
background-remover backgroundremover removebackground remove-background remove-background-image remove-background-video background-removal python video pytorch

backgroundremover's Introduction

BackgroundRemover

Background Remover background remover video
BackgroundRemover is a command line tool to remove background from image and video using AI, made by nadermx to power https://BackgroundRemoverAI.com. If you wonder why it was made read this short blog post.

Requirements

  • python >= 3.6

  • python3.6-dev #or what ever version of python you use

  • torch and torchvision stable version (https://pytorch.org)

  • ffmpeg 4.4+

  • To clarify, you must install both python and whatever dev version of python you installed. IE; python3.10-dev with python3.10 or python3.8-dev with python3.8

How to install torch and ffmpeg

Go to https://pytorch.org and scroll down to INSTALL PYTORCH section and follow the instructions.

For example:

PyTorch Build: Stable (1.7.1)
Your OS: Windows
Package: Pip
Language: Python
CUDA: None

To install ffmpeg and python-dev

sudo apt install ffmpeg python3.6-dev

Installation

To Install backgroundremover, install it from pypi

pip install --upgrade pip
pip install backgroundremover

Please note that when you first run the program, it will check to see if you have the u2net models, if you do not, it will pull them from this repo

It is also possible to run this without installing it via pip, just clone the git to local start a virtual env and install requirements and run

python -m backgroundremover.cmd.cli -i "video.mp4" -mk -o "output.mov"

and for windows

python.exe -m backgroundremover.cmd.cli -i "video.mp4" -mk -o "output.mov"

Installation using Docker

git clone https://github.com/nadermx/backgroundremover.git
cd backgroundremover
docker build -t bgremover .
alias backgroundremover='docker run -it --rm -v "$(pwd):/tmp" bgremover:latest'

Usage as a cli

Image

Remove the background from a local file image

backgroundremover -i "/path/to/image.jpeg" -o "output.png"

Advance usage for image background removal

Sometimes it is possible to achieve better results by turning on alpha matting. Example:

backgroundremover -i "/path/to/image.jpeg" -a -ae 15 -o "output.png"

change the model for different background removal methods between u2netp, u2net, or u2net_human_seg

backgroundremover -i "/path/to/image.jpeg" -m "u2net_human_seg" -o "output.png"

Video

remove background from video and make transparent mov

backgroundremover -i "/path/to/video.mp4" -tv -o "output.mov"

remove background from local video and overlay it over other video

backgroundremover -i "/path/to/video.mp4" -tov "/path/to/videtobeoverlayed.mp4" -o "output.mov"

remove background from local video and overlay it over an image

backgroundremover -i "/path/to/video.mp4" -toi "/path/to/videtobeoverlayed.mp4" -o "output.mov"

remove background from video and make transparent gif

backgroundremover -i "/path/to/video.mp4" -tg -o "output.gif"

Make matte key file (green screen overlay)

Make a matte file for premiere

backgroundremover -i "/path/to/video.mp4" -mk -o "output.matte.mp4"

Advance usage for video

Change the framerate of the video (default is set to 30)

backgroundremover -i "/path/to/video.mp4" -fr 30 -tv -o "output.mov"

Set total number of frames of the video (default is set to -1, ie the remove background from full video)

backgroundremover -i "/path/to/video.mp4" -fl 150 -tv -o "output.mov"

Change the gpu batch size of the video (default is set to 1)

backgroundremover -i "/path/to/video.mp4" -gb 4 -tv -o "output.mov"

Change the number of workers working on video (default is set to 1)

backgroundremover -i "/path/to/video.mp4" -wn 4 -tv -o "output.mov"

change the model for different background removal methods between u2netp, u2net, or u2net_human_seg and limit the frames to 150

backgroundremover -i "/path/to/video.mp4" -m "u2net_human_seg" -fl 150 -tv -o "output.mov"

As a library

Remove background image

from backgroundremover.bg import remove
def remove_bg(src_img_path, out_img_path):
    model_choices = ["u2net", "u2net_human_seg", "u2netp"]
    f = open(src_img_path, "rb")
    data = f.read()
    img = remove(data, model_name=model_choices[0],
                 alpha_matting=True,
                 alpha_matting_foreground_threshold=240,
                 alpha_matting_background_threshold=10,
                 alpha_matting_erode_structure_size=10,
                 alpha_matting_base_size=1000)
    f.close()
    f = open(out_img_path, "wb")
    f.write(img)
    f.close()

Todo

  • convert logic from video to image to utilize more GPU on image removal
  • clean up documentation a bit more
  • add ability to adjust and give feedback images or videos to datasets
  • add ability to realtime background removal for videos, for streaming
  • finish flask server api
  • add ability to use other models than u2net, ie your own
  • other

Pull requests

Accepted

If you like this library

Give a link to our project BackgroundRemoverAI.com or this git, telling people that you like it or use it.

Reason for project

We made it our own package after merging together parts of others, adding in a few features of our own via posting parts as bounty questions on superuser, etc. As well as asked on hackernews earlier to open source the image part, so decided to add in video, and a bit more.

References

License

Code Licensed under MIT License Models Licensed under Apache License 2.0

backgroundremover's People

Contributors

ahmad88me avatar by321 avatar edouard-mangel avatar greydoubt avatar isalia20 avatar kianmeng avatar mindsocket avatar mingeee avatar mjy9088 avatar nadermx avatar olshansk avatar ravnoor avatar ya0guang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backgroundremover's Issues

Intermittently, an image will yield the error: "cannot identify image file"

Traceback (most recent call last):
  File "/home/me/.local/bin/backgroundremover", line 8, in <module>
    sys.exit(main())
  File "/home/me/.local/lib/python3.10/site-packages/backgroundremover/cmd/cli.py", line 241, in main
    remove(
  File "/home/me/.local/lib/python3.10/site-packages/backgroundremover/bg.py", line 183, in remove
    img = Image.open(io.BytesIO(data)).convert("RGB")
  File "/home/me/.local/lib/python3.10/site-packages/PIL/Image.py", line 2958, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fd279fa6520>

I wonder what could cause this? It's caused by the same set of images on every run (reproducible.) The resulting file size is 0 bytes.

PS: Thanks for sharing this awesome project!

No longer active?

Looks like backgroundremover is no longer maintained and the service is not active. I paid up front for access to the service but it remains stuck in status "inactive". Also there seems to be no engagement on Github issues including bugs where the output from sample code is corrupted.

It's a shame it looks promising.

Unsupported hardware error is misleading

[W NNPACK.cpp:79] Could not initialize NNPACK! Reason: Unsupported hardware.

CPU: AMD A8-7650K Radeon R7 4C+6G (4) @ 3.300GHz
GPU: AMD ATI Radeon RX 5500/5500M / Pro 5500M
OS: Manjaro Linux
Drivers: free

How does it work?

How does it work?

Would it be possible to add a paragraph to the main README.md?

I am not looking for a detailed 1:1 source code explanation, but just
the main gist of how the correct pixels are determined and whether
the program may also pick the "wrong pixels" (I assume some
backgrounds will be harder). If you have some time in the future,
a paragraph would be nice in this regard - does not have to be
overly long eithers. Thanks for reading!

using the -tv argument does not work from WSL

Hi,
I've been trying to use the soft from WSL, the mask creation with -mk argument seems fine, but everytime I try to remove background with the -tv argument, the output file weighs 0kB.

I don't have error in the console, or anything like that, how do you think I can fix this?

why does it access google driver?

File "d:\prog\python\36\lib\site-packages\backgroundremover\utilities.py", line 295, in download_file_from_google_drive gdown.download(URL, path, quiet=False) File "d:\prog\python\36\lib\site-packages\gdown\download.py", line 114, in download res = sess.get(url, headers=headers, stream=True) File "d:\prog\python\36\lib\site-packages\requests\sessions.py", line 555, in get return self.request('GET', url, **kwargs) File "d:\prog\python\36\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "d:\prog\python\36\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "d:\prog\python\36\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=1ao1ovG1Qtx4b7EoskHXmi2E9rp5CHLcZ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002225602D4E0>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。',))

ModuleNotFoundError: No module named 'backgroundremover'

When I run

backgroundremover -i "c:/temp/maxresdefault.jpg" -o "output.png"

getting following error....

Traceback (most recent call last):
File "C:\Users\CorreaJ\AppData\Local\Programs\Python\Python310\Scripts\backgroundremover-script.py", line 33, in
sys.exit(load_entry_point('backgroundremover==0.2.0', 'console_scripts', 'backgroundremover')())
File "C:\Users\CorreaJ\AppData\Local\Programs\Python\Python310\Scripts\backgroundremover-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:\Users\CorreaJ\AppData\Local\Programs\Python\Python310\lib\importlib\metadata_init_.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Users\CorreaJ\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'backgroundremover'

Can't run bg remover on windows, "process cannot access the file"

PS D:\Programs\backgroundremover-main> python -m backgroundremover.cmd.cli -i "D:\Downloads\Telegram\photo_2023-01-11_14-01-01.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
Traceback (most recent call last):
File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\Programs\backgroundremover-main\backgroundremover\cmd\cli.py", line 253, in
main()
File "D:\Programs\backgroundremover-main\backgroundremover\cmd\cli.py", line 239, in main
remove(
File "D:\Programs\backgroundremover-main\backgroundremover\bg.py", line 179, in remove
model = get_model(model_name)
File "D:\Programs\backgroundremover-main\backgroundremover\bg.py", line 167, in get_model
return detect.load_model(model_name="u2net")
File "D:\Programs\backgroundremover-main\backgroundremover\u2net\detect.py", line 55, in load_model
utilities.download_files_from_github(
File "D:\Programs\backgroundremover-main\backgroundremover\utilities.py", line 347, in download_files_from_github
os.remove(part.name)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\aboba\AppData\Local\Temp\tmpq378j2qx'
PS D:\Programs\backgroundremover-main> python -m backgroundremover.cmd.cli -i "D:\Downloads\Telegram\photo_2023-01-11_14-01-01.jpg" -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
Traceback (most recent call last):
File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\Programs\backgroundremover-main\backgroundremover\cmd\cli.py", line 253, in
main()
File "D:\Programs\backgroundremover-main\backgroundremover\cmd\cli.py", line 239, in main
remove(
File "D:\Programs\backgroundremover-main\backgroundremover\bg.py", line 179, in remove
model = get_model(model_name)
File "D:\Programs\backgroundremover-main\backgroundremover\bg.py", line 167, in get_model
return detect.load_model(model_name="u2net")
File "D:\Programs\backgroundremover-main\backgroundremover\u2net\detect.py", line 55, in load_model
utilities.download_files_from_github(
File "D:\Programs\backgroundremover-main\backgroundremover\utilities.py", line 347, in download_files_from_github
os.remove(part.name)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\aboba\AppData\Local\Temp\tmpsbhw0_8x'
PS D:\Programs\backgroundremover-main>

Alpha channel lags behind video

With some videos, the generated alpha channel is out of sync with the image. Example in this image.
2022-12-11-210847_1920x1080_scrot
You can see at the legs and head, the alpha mask is in the shape it should have been a handful of frames ago.

Command used: ~/.local/bin/backgroundremover -i '568925567_3AXGeHborlS4Ew02v_Source.mp4' -tv -o test.mov and mpv test.mov - so far only mpv seems able to play these back at all.

JSONDecodeError: Expecting value: line 2 column 1 (char 1) "Remove the background from a video"

Hello

Thanks for this great effort!

I am running the below code to remove a background from a video, but I am getting the below error.

JSONDecodeError: Expecting value: line 2 column 1 (char 1)

import requests

file_names = ["/path/to/file.mp4"]
api_key = '<YOUR_API_KEY>'

domain = 'https://video.backgroundremover.app'
api_version = 'api/v1/'
headers = {'Authorization': api_key}
def videos():
files = [('video', open(f, 'rb')) for f in file_names]
r = requests.post("%s/%svideo/" % (domain, api_version), files=files, headers=headers)
return r.json()

def get_results(job_name, count, type):
r = requests.post("%s/%sresults/" % (domain, api_version), data={'job_name': job_name, 'count': count, "type": type})
return r.json()

def download_file(url):
local_filename = url.split('/')[-1]
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)

image = videos()
if not image.get('error'):
results = get_results(image['job_name'], image['count'], image['type'])
while not results['finished'] or not results['error']:
results = get_results(word['job_name'], word['count'], word['type'])
results['finished'] = results['finished']
time.sleep(5)
if results['finished']:
print(results['finished'])
break
for f in results['files']:
file = download_file(f[0])
print(file)

Bulk command

Is there any command to do bulk background removing?

transparentvideo mode is not working

thank you for share this code and model.

I tested with a single image and it worked.
but when i tested in video, it failed. (use -tv option).
output video have 0kb.

I try to upgrade ffmpeg version to 4.4.1
but it isn't work...

ubuntu 18.04
python3.6
torch 1.10.1
cuda 11.3

-tov/--transparentvideoovervideo: invalid <lambda> value:

Hi,
I tried multiple way to get a -tv working an example video to work with a background and it always throws the error in the title.

For instance, backgroundremover -i "./stress.mp4" -tov "vert.mp4" -o "output.mp4" results in:
backgroundremover: error: argument -tov/--transparentvideoovervideo: invalid <lambda> value: 'vert.mp4'

Weirdly enough backgroundremover -i "./stress.mp4" -tov -o "output.mp4" "works" ... but there's no overlay video input so I get:
/<stdin>: No such file or directory Process finished

Any idea?

[Docker] Migrating app to docker

I have created a docker image, if there is enough interest in it (likes) and @nadermx wants to support this kind of deployment I'll create a PR. So far the image processing works fine with all the models and other options, videos seem to work but the output file size is 0 Byte so this will still need some investigation.

colab noterbook and flask api

Hi @nadermx ,

Hope you are all well !

I was wondering if it is possible to make a google colab for backgroundremover and is a flask rest api possible ?

Thanks for any insights or inputs on that.

Cheers,
Luc Michalski

unable to install

DEPRECATION: Pillow is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for Pillow ... error
error: subprocess-exited-with-error

× Running setup.py install for Pillow did not run successfully.
│ exit code: 1
╰─> [192 lines of output]
running install
C:\Apps\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ContainerIO.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ExifTags.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\features.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GdImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Image.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageChops.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageCms.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageColor.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageDraw.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFilter.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFont.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageGrab.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMath.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMode.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMorph.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageOps.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImagePalette.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImagePath.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageQt.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageSequence.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageShow.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageStat.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageTk.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageTransform.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageWin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\JpegPresets.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PaletteFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PdfParser.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PSDraw.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PyAccess.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TarIO.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TiffTags.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WalImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL_binary.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL_tkinter_finder.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL_util.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL_version.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL_init_.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL_main_.py -> build\lib.win-amd64-cpython-310\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '
.h'
warning: no files found matching '.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git
' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
no previously-included directories found matching '.ci'
adding license file 'LICENSE'
writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
running build_ext

  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "C:\Users\Senpai\AppData\Local\Temp\pip-install-gd05bu7l\pillow_2e009652622f47769adc0b882b02cfc5\setup.py", line 865, in <module>
      setup(
    File "C:\Apps\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\core.py", line 177, in setup
      return run_commands(dist)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\core.py", line 193, in run_commands
      dist.run_commands()
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "C:\Apps\Python310\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Apps\Python310\lib\site-packages\setuptools\command\install.py", line 68, in run
      return orig.install.run(self)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\command\install.py", line 695, in run
      self.run_command('build')
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 317, in run_command
      self.distribution.run_command(command)
    File "C:\Apps\Python310\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Apps\Python310\lib\site-packages\setuptools\command\build.py", line 24, in run
      super().run()
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
      self.run_command(cmd_name)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\cmd.py", line 317, in run_command
      self.distribution.run_command(command)
    File "C:\Apps\Python310\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Apps\Python310\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
      _build_ext.run(self)
    File "C:\Apps\Python310\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
      _build_ext.build_ext.run(self)
    File "C:\Apps\Python310\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 339, in run
      self.build_extensions()
    File "C:\Users\Senpai\AppData\Local\Temp\pip-install-gd05bu7l\pillow_2e009652622f47769adc0b882b02cfc5\setup.py", line 702, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: zlib

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\Senpai\AppData\Local\Temp\pip-install-gd05bu7l\pillow_2e009652622f47769adc0b882b02cfc5\setup.py", line 922, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:

  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html


  C:\Users\Senpai\AppData\Local\Temp\pip-install-gd05bu7l\pillow_2e009652622f47769adc0b882b02cfc5\setup.py:44: RuntimeWarning: Pillow 8.1.1 does not support Python 3.10 and does not provide prebuilt Windows binaries. We do not recommend building from source on Windows.
    lambda: warnings.warn(
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of Pillow
Moving to c:\apps\python310\lib\site-packages\pil
from C:\Apps\Python310\Lib\site-packages~il
Moving to c:\apps\python310\lib\site-packages\pillow-9.3.0.dist-info
from C:\Apps\Python310\Lib\site-packages~illow-9.3.0.dist-info
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> Pillow

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

The issue of “failed with exit status 2”

Hi nadermx and everyone

I try to run the backgroundremover on windows. My version is python 3.6 64bit. I have the following problems.

I have reinstalled the Visual Studio. The error still occurs.

........................
File "d:\backgroundremover-main\lib\site-packages\numpy\distutils\ccompiler.py", line 174, in CCompiler_spawn
(cmd, s, msg))
distutils.errors.DistutilsExecError: Command "D:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W
3 /GL /DNDEBUG /MT -DPYCC_MODULE_NAME=aot -DPYCC_USE_NRT=1 -Id:\backgroundremover-main\include -ID:\Program Files\Python36\include -ID:\Program Files\Python36\include -Id:\ba
ckgroundremover-main\lib\site-packages\numpy\core\include -ID:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /Tcd:\backgro
undremover-main\lib\site-packages\numba\pycc\modulemixin.c /FoC:\Users\sw820\AppData\Local\Temp\pycc-build-aot-2_frh03u\backgroundremover-main\lib\site-packages\numba\pycc\mod
ulemixin.obj" failed with exit status 2

During handling of the above exception, another exception occurred:

........................................
.......................................
File "D:\Program Files\Python36\lib\distutils_msvccompiler.py", line 425, in compile
raise CompileError(msg)
distutils.errors.CompileError: Command "D:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL
/DNDEBUG /MT -DPYCC_MODULE_NAME=aot -DPYCC_USE_NRT=1 -Id:\backgroundremover-main\include -ID:\Program Files\Python36\include -ID:\Program Files\Python36\include -Id:\backgrou
ndremover-main\lib\site-packages\numpy\core\include -ID:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include /Tcd:\backgroundrem
over-main\lib\site-packages\numba\pycc\modulemixin.c /FoC:\Users\sw820\AppData\Local\Temp\pycc-build-aot-2_frh03u\backgroundremover-main\lib\site-packages\numba\pycc\modulemix
in.obj" failed with exit status 2

Speed: Very slow processing and GPU hardly used?

Hi, OK I have successfully processed a 8 minute clip. It was a real slow process, and took a couple of hours.

How is it that Zoom en MS Teams can do basically the same job in real-time?

I have tried this on my M1 Mac but also on my PC with a GeFOrce GTX 1060 / 6 GB. (Yah I know this isn't mind-blowing but still, it's a proper GPU I'd reckon?) CUDA drivers all the latest. (V11.x)

In both cases, processing speeds were slow as molasses M1 and PC alike.

On PC I monitored the GPU usage and "Python" was never taking more than 1% of GPU resources available. Is that even right?
It feels it hardly use dteh CPU at all?

In any case, it feels that the whole process could be done much faster, near real time no, given Zoom, Teams etc can do it? WHere is the bottleneck?

-o oprion

Is it possible to make the default output option something like Originalname-nobackground.jpg.

MOV conversion creates an absolutely gargantuan file that's unreadable on Mac

Hi using the docs I ran this command successfully

backgroundremover -i "/path/to/video.mp4" -tv -o "output.mov"

I had an input file created from an

iPhone, 15MB, 1440x1440, Linear PCM, Timed Metadata, HEVC. 7 seconds, 15MB

The output file when I ran the local copy of this was

1.22GB (that's GIGABYTES, nearly 100x the original size), 1440x1440, MPEG-A AAC, Animation, encoding software Lavf59.27.100

Most crucially, when I open it in QuickTime I get this error "This file contains some media that isn’t compatible with QuickTime Player."

What can I do to get this working so a) it's readable on a Mac and b) it's hopefully approximately the same size 🙂

API docs or JavaScript example

I'm trying to use the service from the browser with JavaScript and am having trouble understanding the API from the Python example. Would it be possible to add a JavaScript example using fetch or perhaps general http request documentation. Thanks

How to generate binary mask instead of cutout

Hello,

Is there any option to generate a mask instead of cutout? I wanted to check if there is any command line option. I wanted to create background of different colors like RED, White, Blue, Black etc

Thanks
Shailender Jain

Any way to increase speed ?

I have 8 GB RAM Ubuntu in EC2. The image background removal command is taking time around 6-10 seconds but My CPU & RAM is utilizing only 1-10 %

Is there any option to increase the speed via utilizing more resources?

I really appreciate the support of this repo.

[Windows] no file output after ffmpeg frame conversion complete

backgroundremover -i t1.mp4 -tv -o t2.mp4

FINISHED ALL FRAMES (135)!
Starting alphamerge
after call

on windows after completing all frames and about to merge nothing happens. temp dir is cleaned. no error occurs but the user is thrown out of the program from the terminal and the output file remains empty at 0 bytes. its like the program forgot to actually write the data to the output location before ending

image

[BUG] Unable to install via pip due to corrupt package

Hi there. The Pillow package is corrupt.
I installed the python3-willow package, hoping it'd solve the problem and allow me to install backgroundremover, because willow essentially includes pillow.
Do you think you could fix this in the installation script so that it recognizes either?
I doubt there's an issue on my end, but here's my terminal output:

❯ sudo pip3 install backgroundremover
Collecting backgroundremover
  Using cached backgroundremover-0.1.9-py3-none-any.whl
Collecting hsh>=1.1.0
  Using cached hsh-1.1.0-py2.py3-none-any.whl (9.0 kB)
Requirement already satisfied: pymatting>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (1.1.8)
Collecting Pillow==8.1.1
  Using cached Pillow-8.1.1.tar.gz (45.0 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: filelock>=3.0.12 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (3.8.0)
Collecting more-itertools==8.7.0
  Using cached more_itertools-8.7.0-py3-none-any.whl (48 kB)
Collecting ffmpeg-python
  Using cached ffmpeg_python-0.2.0-py3-none-any.whl (25 kB)
Requirement already satisfied: torchvision>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (0.13.1)
Requirement already satisfied: scikit-image>=0.17.2 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (0.19.3)
Requirement already satisfied: numpy>=1.19.4 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (1.21.6)
Requirement already satisfied: tqdm>=4.51.0 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (4.64.0)
Requirement already satisfied: filetype>=1.0.7 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (1.1.0)
Requirement already satisfied: six==1.16.0 in /usr/lib/python3/dist-packages (from backgroundremover) (1.16.0)
Collecting moviepy==1.0.3
  Using cached moviepy-1.0.3-py3-none-any.whl
Collecting certifi>=2021.5.30
  Using cached certifi-2022.6.15-py3-none-any.whl (160 kB)
Requirement already satisfied: urllib3==1.26.6 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (1.26.6)
Requirement already satisfied: torch>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (1.12.1)
Requirement already satisfied: waitress>=1.4.4 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (2.1.2)
Requirement already satisfied: PySocks>=1.7.1 in /usr/lib/python3/dist-packages (from backgroundremover) (1.7.1)
Requirement already satisfied: scipy>=1.5.4 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (1.7.3)
Requirement already satisfied: gdown>=3.13.0 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (4.5.1)
Requirement already satisfied: requests>=2.24.0 in /usr/lib/python3/dist-packages (from backgroundremover) (2.25.1)
Requirement already satisfied: idna>=3.2 in /usr/lib/python3/dist-packages (from backgroundremover) (3.3)
Requirement already satisfied: charset-normalizer>=2.0.4 in /usr/local/lib/python3.10/dist-packages (from backgroundremover) (2.1.0)
Requirement already satisfied: proglog<=1.0.0 in /usr/local/lib/python3.10/dist-packages (from moviepy==1.0.3->backgroundremover) (0.1.10)
Collecting imageio-ffmpeg>=0.2.0
  Using cached imageio_ffmpeg-0.4.7-py3-none-manylinux2010_x86_64.whl (26.9 MB)
Requirement already satisfied: imageio<3.0,>=2.5 in /usr/local/lib/python3.10/dist-packages (from moviepy==1.0.3->backgroundremover) (2.21.2)
Collecting decorator<5.0,>=4.0.2
  Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Requirement already satisfied: beautifulsoup4 in /usr/lib/python3/dist-packages (from gdown>=3.13.0->backgroundremover) (4.10.0)
Requirement already satisfied: commandlines in /usr/local/lib/python3.10/dist-packages (from hsh>=1.1.0->backgroundremover) (0.4.1)
Requirement already satisfied: numba!=0.49.0 in /usr/local/lib/python3.10/dist-packages (from pymatting>=1.1.1->backgroundremover) (0.56.0)
Requirement already satisfied: PyWavelets>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-image>=0.17.2->backgroundremover) (1.3.0)
Requirement already satisfied: tifffile>=2019.7.26 in /usr/local/lib/python3.10/dist-packages (from scikit-image>=0.17.2->backgroundremover) (2022.8.12)
Requirement already satisfied: networkx>=2.2 in /usr/local/lib/python3.10/dist-packages (from scikit-image>=0.17.2->backgroundremover) (2.8.6)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from scikit-image>=0.17.2->backgroundremover) (21.3)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=1.7.0->backgroundremover) (4.3.0)
Requirement already satisfied: future in /usr/lib/python3/dist-packages (from ffmpeg-python->backgroundremover) (0.18.2)
Collecting imageio<3.0,>=2.5
  Using cached imageio-2.21.1-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.21.0-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.20.0-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.19.5-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.19.3-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.19.2-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.19.1-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.19.0-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.18.0-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.17.0-py3-none-any.whl (3.4 MB)
  Using cached imageio-2.16.2-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.16.1-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.15.0-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.14.1-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.14.0-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.13.5-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.13.4-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.13.3-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.13.2-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.13.1-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.13.0-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.12.0-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.11.1-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.11.0-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.10.5-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.10.4-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.10.3-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.10.2-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.10.1-py3-none-any.whl (3.3 MB)
  Using cached imageio-2.9.0-py3-none-any.whl (3.3 MB)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from numba!=0.49.0->pymatting>=1.1.1->backgroundremover) (59.6.0)
Requirement already satisfied: llvmlite<0.40,>=0.39.0dev0 in /usr/local/lib/python3.10/dist-packages (from numba!=0.49.0->pymatting>=1.1.1->backgroundremover) (0.39.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3/dist-packages (from packaging>=20.0->scikit-image>=0.17.2->backgroundremover) (2.4.7)
Using legacy 'setup.py install' for Pillow, since package 'wheel' is not installed.
Installing collected packages: Pillow, more-itertools, imageio-ffmpeg, hsh, ffmpeg-python, decorator, certifi, imageio, moviepy, backgroundremover
  Attempting uninstall: Pillow
    Found existing installation: Pillow 9.0.1
    Uninstalling Pillow-9.0.1:
      Successfully uninstalled Pillow-9.0.1
  Running setup.py install for Pillow ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for Pillow did not run successfully.
  │ exit code: 1
  ╰─> [178 lines of output]
      running install
      /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/Image.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/features.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/_util.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/_version.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.10/PIL
      copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.10/PIL
      running egg_info
      writing src/Pillow.egg-info/PKG-INFO
      writing dependency_links to src/Pillow.egg-info/dependency_links.txt
      writing top-level names to src/Pillow.egg-info/top_level.txt
      reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.c'
      warning: no files found matching '*.h'
      warning: no files found matching '*.sh'
      warning: no previously-included files found matching '.appveyor.yml'
      warning: no previously-included files found matching '.coveragerc'
      warning: no previously-included files found matching '.editorconfig'
      warning: no previously-included files found matching '.readthedocs.yml'
      warning: no previously-included files found matching 'codecov.yml'
      warning: no previously-included files matching '.git*' found anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      no previously-included directories found matching '.ci'
      adding license file 'LICENSE'
      writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
      running build_ext
      
      
      The headers or library files could not be found for jpeg,
      a required dependency when compiling Pillow from source.
      
      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html
      
      Traceback (most recent call last):
        File "/tmp/pip-install-n2w58rcq/pillow_e49785be2a794d05bf5c4eac9eb632c0/setup.py", line 865, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 68, in run
          return orig.install.run(self)
        File "/usr/lib/python3.10/distutils/command/install.py", line 619, in run
          self.run_command('build')
        File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 79, in run
          _build_ext.run(self)
        File "/usr/lib/python3.10/distutils/command/build_ext.py", line 340, in run
          self.build_extensions()
        File "/tmp/pip-install-n2w58rcq/pillow_e49785be2a794d05bf5c4eac9eb632c0/setup.py", line 702, in build_extensions
          raise RequiredDependencyException(f)
      __main__.RequiredDependencyException: jpeg
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-n2w58rcq/pillow_e49785be2a794d05bf5c4eac9eb632c0/setup.py", line 922, in <module>
          raise RequiredDependencyException(msg)
      __main__.RequiredDependencyException:
      
      The headers or library files could not be found for jpeg,
      a required dependency when compiling Pillow from source.
      
      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html
      
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Rolling back uninstall of Pillow
  Moving to /usr/lib/python3/dist-packages/PIL
   from /usr/lib/python3/dist-packages/~IL
  Moving to /usr/lib/python3/dist-packages/Pillow-9.0.1.egg-info
   from /usr/lib/python3/dist-packages/~illow-9.0.1.egg-info
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> Pillow

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
~ ❯                                                                         10s


Video Error / Failed

I'm trying to test video but I get some errors.
Any idea how can I fix this and make it work?

I'm not a programmer so please help / guide step-by-step if possible,
Thanks ahead! 💙

  • I use Anaconda on Windows 10

cmd_2023-01-14_06-01-08

Pickle Error

Pickle is not the best choice for storing data like this. The problem is that pickle differs between Python versions. With Python 3.9 I'm getting this for example:

[...]/python3.9/site-packages/torch/serialization.py", line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

See here and here for more in depths explanations.

I have not tried those myself but it might be worth looking into cPickle or Joblib as an alternative. Not sure if they have the same issues.

Installation succeeds, running fails

After successfully installing backroundremover, I am running into the following issue when running it:

[arjan@cure:bgRemove]% backgroundremover -i 'input.jpg' 'out.png'
Failed to import ahead-of-time-compiled modules.
This is expected on first import.
Compiling modules and trying again.
This might take a minute.
Traceback (most recent call last):
  File "/home/arjan/.local/lib/python3.7/site-packages/pymatting_aot/cc.py", line 36, in <module>
    import pymatting_aot.aot
ModuleNotFoundError: No module named 'pymatting_aot.aot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/arjan/.local/bin/backgroundremover", line 5, in <module>
    from backgroundremover.cmd.cli import main
  File "/home/arjan/.local/lib/python3.7/site-packages/backgroundremover/cmd/cli.py", line 5, in <module>
    from .. import utilities
  File "/home/arjan/.local/lib/python3.7/site-packages/backgroundremover/utilities.py", line 10, in <module>
    from .bg import DEVICE, Net, iter_frames, remove_many
  File "/home/arjan/.local/lib/python3.7/site-packages/backgroundremover/bg.py", line 6, in <module>
    from pymatting.alpha.estimate_alpha_cf import estimate_alpha_cf
  File "/home/arjan/.local/lib/python3.7/site-packages/pymatting/__init__.py", line 2, in <module>
    import pymatting_aot.cc
  File "/home/arjan/.local/lib/python3.7/site-packages/pymatting_aot/cc.py", line 54, in <module>
    compile_modules()
  File "/home/arjan/.local/lib/python3.7/site-packages/pymatting_aot/cc.py", line 8, in compile_modules
    cc = CC("aot")
  File "/home/arjan/.local/lib/python3.7/site-packages/numba/pycc/cc.py", line 65, in __init__
    self._toolchain = Toolchain()
  File "/home/arjan/.local/lib/python3.7/site-packages/numba/pycc/platform.py", line 78, in __init__
    self._raise_external_compiler_error()
  File "/home/arjan/.local/lib/python3.7/site-packages/numba/pycc/platform.py", line 121, in _raise_external_compiler_error
    raise RuntimeError(msg)
RuntimeError: Attempted to compile AOT function without the compiler used by `numpy.distutils` present. If using conda try:

#> conda install gcc_linux-64 gxx_linux-64

Any idea? I'm on a Debian 10 system. gcc is installed.

Which Python version

What Python version should I use for this library to work?
On the github page it says (under Requirements): python <= 3.6
But browsing through some issues, it seems backgroundremover might work on newer versions as well?
What is the minimum (and maximum?) Python version for this tool?
While you're at it... maybe update the requirements section as well? Thanks!

Speed: Slow processing in ubuntu

I have 8 GB RAM Ubuntu in EC2. The image background removal command is taking time around 6-10 seconds but My CPU & RAM is utilizing only 1-10 %

Is there any option to increase the speed via utilizing more resources?

I really appreciate support of this repo.

It works fine from ssh buy not from PHP, why ?

Hello, i installed it successfully, it works without any issue from a ssh command line, but when i run it from a PHP page, there is no output, and there is no errors on the log file. Is there any settings to do ?

Error

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> Pillow

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Error: Trimap did not contain foreground values

failing out while removing background image

uname -a 
5.8.0-3-amd64 #1 SMP Debian 5.8.14-1~mx19+2 (2020-10-25) x86_64 GNU/Linux
backgroundremover -i ./final_sign.jpeg -a  -ae 15 -o final_sig4.png 


final_sig4.png
[W NNPACK.cpp:80] Could not initialize NNPACK! Reason: Unsupported hardware.
Traceback (most recent call last):
  File "/home/xyz/.asdf/installs/python/3.8.0/bin/backgroundremover", line 8, in <module>
    sys.exit(main())
  File "/home/xyz/.asdf/installs/python/3.8.0/lib/python3.8/site-packages/backgroundremover/cmd/cli.py", line 241, in main
    remove(
  File "/home/xyz/.asdf/installs/python/3.8.0/lib/python3.8/site-packages/backgroundremover/bg.py", line 187, in remove
    cutout = alpha_matting_cutout(
  File "/home/xyz/.asdf/installs/python/3.8.0/lib/python3.8/site-packages/backgroundremover/bg.py", line 147, in alpha_matting_cutout
    alpha = estimate_alpha_cf(img_normalized, trimap_normalized)
  File "/home/xyz/.asdf/installs/python/3.8.0/lib/python3.8/site-packages/pymatting/alpha/estimate_alpha_cf.py", line 51, in estimate_alpha_cf
    is_fg, is_bg, is_known, is_unknown = trimap_split(trimap)
  File "/home/xyz/.asdf/installs/python/3.8.0/lib/python3.8/site-packages/pymatting/util/util.py", line 495, in trimap_split
    raise ValueError(
ValueError: Trimap did not contain foreground values (values >= 0.900000)


moviepy==1.0.3

ERROR: Could not find a version that satisfies the requirement moviepy==1.0.3 (from backgroundremover) (from versions: 0
.2.1.6.3.linux-i686, 0.2.1, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.2.1.4, 0.2.1.5, 0.2.1.6, 0.2.1.6.1, 0.2.1.6.2, 0.2.1.6.3, 0.2.1
.6.4, 0.2.1.6.5, 0.2.1.6.7, 0.2.1.6.8, 0.2.1.6.9, 0.2.1.6.91, 0.2.1.6.92, 0.2.1.6.93, 0.2.1.7, 0.2.1.7.2, 0.2.1.7.3, 0.2
.1.7.8, 0.2.1.7.9, 0.2.1.7.10, 0.2.1.7.11, 0.2.1.7.12, 0.2.1.7.13, 0.2.1.7.14, 0.2.1.7.15, 0.2.1.7.16, 0.2.1.7.17, 0.2.1
.7.18, 0.2.1.7.19, 0.2.1.7.20, 0.2.1.7.21, 0.2.1.7.22, 0.2.1.8, 0.2.1.8.1, 0.2.1.8.2, 0.2.1.8.3, 0.2.1.8.4, 0.2.1.8.5, 0
.2.1.8.6, 0.2.1.8.7, 0.2.1.8.8, 0.2.1.8.9, 0.2.1.8.10, 0.2.1.8.11, 0.2.1.8.12, 0.2.1.9, 0.2.1.9.1, 0.2.1.9.2, 0.2.1.9.3,
0.2.1.9.4, 0.2.1.9.5, 0.2.1.9.7, 0.2.2, 0.2.2.1, 0.2.2.2, 0.2.2.3, 0.2.2.4, 0.2.2.5, 0.2.2.6, 0.2.2.7, 0.2.2.8, 0.2.2.9
, 0.2.2.10, 0.2.2.11, 0.2.2.12, 0.2.2.13, 0.2.3.1, 0.2.3.2, 0.2.3.3, 0.2.3.4, 0.2.3.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 2.0.0
.dev1, 2.0.0.dev2)
ERROR: No matching distribution found for moviepy==1.0.3

Video/gif output not working.

Been playing around with it for a couple hours now and I'm not having any luck outputting video or gif files. Every time it returns a 0kb file. Using ffmpeg 5.1.1. I'm happy to provide any other details you need, but I can say that when I run the command there's no apparent errors.

Not so much an issue but a question regarding the output

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

Pictures are -90 Degrees tilt

Unfortunately some pictures you upload on backgroundremover.app are -90 Degrees tilt when they are processed.

This happened when I uploaded a picture and choose the "Things option".

If you need a link to the picture don't hesitate contacting me.

Windows + Anaconda = Won't show process + Bulk Related Question

Just to be clear, I'm not a programmer but I've noticed that compare to other repos I tried on my local machine while testing your awesome repo.

Usually when processing (anything) it shows on Anaconda Prompt (or any console using) either progress bar with percentage and some information while it's "cooking" but in this one it won't show anything on windows and anaconda at least.

So when I run for example:
backgroundremover -i ./_SOURCE_/image.jpg -o ./_RESULT_/output.png

It will show the blinking underscore _

and it works but no indication how much time it takes, or any info that could be helpful while it's processing.

So either I'm doing something wrong, or it's just not in the code for now on windows at least?

If it's not there yet, will you please consider to add this process status, it sure give some indication such as time estimate or how long it runs and the percentage of each task (image, multiple images or video when it will work on windows of course).

Another question: (multiple images / bulk)
Please consider that I'm not a programmer so I don't know how to mess with the code.
Is there a parameter I can add when I run "backgroundremover " so it will run ALL images on my input directory?

If not, will you consider to add such parameter? (could be cool for both multiple images, and videos) instead of testing one by one.

Thanks ahead for replying, keep up the good work! 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.