BackgroundRemover lets you Remove Background from images and video with a simple command line interface

Overview

BackgroundRemover

Background Remover background remover video
BackgroundRemover is a command line tool to remove background from video and image, made by nadermx to power https://BackgroundRemover.app. 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 using
  • torch and torchvision stable version (https://pytorch.org)
  • ffmpeg 4.4+

How to install torch and fmpeg

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 get them from u2net's google drive, as they say too here, and in this repo the code that pulls it is here

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 diferent 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 -tv "/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 premier

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"

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 diferent background removal methods between u2netp, u2net, or u2net_human_seg

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

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 BackgroundRemover.app 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

Licensed under MIT License

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

    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)

    opened by AhmedEwis 19
  • -tov/--transparentvideoovervideo: invalid <lambda> value:

    -tov/--transparentvideoovervideo: invalid 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?

    opened by j2l 16
  • Installation succeeds, running fails

    Installation succeeds, running fails

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

    [[email protected]: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.

    opened by av01d 13
  • transparentvideo mode is not working

    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

    opened by Mombin 12
  • [Windows] no file output after ffmpeg frame conversion complete

    [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

    opened by Chad90b 11
  • using the -tv argument does not work from WSL

    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?

    opened by edouard-mangel 11
  • Error: Trimap did not contain foreground values

    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)
    
    
    
    opened by byteshiva 8
  • why does it access google driver?

    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] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。',))

    opened by OsmondGao 7
  • API docs or JavaScript example

    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

    opened by aubergene 5
  • How does it work?

    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!

    opened by rubyFeedback 4
  • Intermittently, an image will yield the error:

    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!

    opened by Slapbox 3
  • Error

    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.

    opened by hakxcore 0
  • unable to install

    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 https://github.com/pypa/pip/issues/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.

    opened by Praveensenpai 0
  • Alpha channel lags behind video

    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.

    opened by RenaKunisaki 0
  • ModuleNotFoundError: No module named 'backgroundremover'

    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'

    opened by jcdives 0
  • Video/gif output not working.

    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.

    opened by LuckyDarms 6
Releases(v0.1.9)
QilingLab challenge writeup

qiling lab writeup shielder 在 2021/7/21 發布了 QilingLab 來幫助學習 qiling framwork 的用法,剛好最近有用到,順手解了一下並寫了一下 writeup。 前情提要 Qiling 是一款功能強大的模擬框架,和 qemu user mode

Yuan 17 Nov 17, 2022
A PyTorch implementation for Unsupervised Domain Adaptation by Backpropagation(DANN), support Office-31 and Office-Home dataset

DANN A PyTorch implementation for Unsupervised Domain Adaptation by Backpropagation Prerequisites Linux or OSX NVIDIA GPU + CUDA (may CuDNN) and corre

8 Apr 16, 2022
[ICCV 2021 Oral] Mining Latent Classes for Few-shot Segmentation

Mining Latent Classes for Few-shot Segmentation Lihe Yang, Wei Zhuo, Lei Qi, Yinghuan Shi, Yang Gao. This codebase contains baseline of our paper Mini

Lihe Yang 66 Nov 29, 2022
Codes for CVPR2021 paper "PWCLO-Net: Deep LiDAR Odometry in 3D Point Clouds Using Hierarchical Embedding Mask Optimization"

PWCLO-Net: Deep LiDAR Odometry in 3D Point Clouds Using Hierarchical Embedding Mask Optimization (CVPR 2021) This is the official implementation of PW

Intelligent Robotics and Machine Vision Lab 42 Dec 18, 2022
Unit-Convertor - Unit Convertor Built With Python

Python Unit Converter This project can convert Weigth,length and ... units for y

Mahdis Esmaeelian 1 May 31, 2022
DeepStochlog Package For Python

DeepStochLog Installation Installing SWI Prolog DeepStochLog requires SWI Prolog to run. Run the following commands to install: sudo apt-add-repositor

KU Leuven Machine Learning Research Group 17 Dec 23, 2022
Test-Time Personalization with a Transformer for Human Pose Estimation, NeurIPS 2021

Transforming Self-Supervision in Test Time for Personalizing Human Pose Estimation This is an official implementation of the NeurIPS 2021 paper: Trans

41 Nov 28, 2022
Chinese Mandarin tts text-to-speech 中文 (普通话) 语音 合成 , by fastspeech 2 , implemented in pytorch, using waveglow as vocoder,

Chinese mandarin text to speech based on Fastspeech2 and Unet This is a modification and adpation of fastspeech2 to mandrin(普通话). Many modifications t

291 Jan 02, 2023
PyTorch Implementation of Spatially Consistent Representation Learning(SCRL)

Spatially Consistent Representation Learning (CVPR'21) Official PyTorch implementation of Spatially Consistent Representation Learning (SCRL). This re

Kakao Brain 102 Nov 03, 2022
A foreign language learning aid using a neural network to predict probability of translating foreign words

Langy Langy is a reading-focused foreign language learning aid orientated towards young children. Reading is an activity that every child knows. It is

Shona Lowden 6 Nov 17, 2021
Inference code for "StylePeople: A Generative Model of Fullbody Human Avatars" paper. This code is for the part of the paper describing video-based avatars.

NeuralTextures This is repository with inference code for paper "StylePeople: A Generative Model of Fullbody Human Avatars" (CVPR21). This code is for

Visual Understanding Lab @ Samsung AI Center Moscow 18 Oct 06, 2022
Ontologysim: a Owlready2 library for applied production simulation

Ontologysim: a Owlready2 library for applied production simulation Ontologysim is an open-source deep production simulation framework, with an emphasi

10 Nov 30, 2022
Let's Git - Versionsverwaltung & Open Source Hausaufgabe

Let's Git - Versionsverwaltung & Open Source Hausaufgabe Herzlich Willkommen zu dieser Hausaufgabe für unseren MOOC: Let's Git! Wir hoffen, dass Du vi

1 Dec 13, 2021
Official Pytorch implementation of RePOSE (ICCV2021)

RePOSE: Iterative Rendering and Refinement for 6D Object Detection (ICCV2021) [Link] Abstract We present RePOSE, a fast iterative refinement method fo

Shun Iwase 68 Nov 15, 2022
SatelliteSfM - A library for solving the satellite structure from motion problem

Satellite Structure from Motion Maintained by Kai Zhang. Overview This is a libr

Kai Zhang 190 Dec 08, 2022
A pytorch implementation of Reading Wikipedia to Answer Open-Domain Questions.

DrQA A pytorch implementation of the ACL 2017 paper Reading Wikipedia to Answer Open-Domain Questions (DrQA). Reading comprehension is a task to produ

Runqi Yang 394 Nov 08, 2022
Program your own vulkan.gpuinfo.org query in Python. Used to determine baseline hardware for WebGPU.

query-gpuinfo-data License This software is not presently released under a license. The data in data/ is obtained under CC BY 4.0 as specified there.

Kai Ninomiya 5 Jul 18, 2022
ROS-UGV-Control-Interface - Control interface which can be used in any UGV

ROS-UGV-Control-Interface Cam Closed: Cam Opened:

Ahmet Fatih Akcan 1 Nov 04, 2022
Implementation of Axial attention - attending to multi-dimensional data efficiently

Axial Attention Implementation of Axial attention in Pytorch. A simple but powerful technique to attend to multi-dimensional data efficiently. It has

Phil Wang 250 Dec 25, 2022
Code to accompany our paper "Continual Learning Through Synaptic Intelligence" ICML 2017

Continual Learning Through Synaptic Intelligence This repository contains code to reproduce the key findings of our path integral approach to prevent

Ganguli Lab 82 Nov 03, 2022