nadermx / backgroundremover

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

using the -tv argument does not work from WSL #8

Closed edouard-mangel closed 1 year ago

edouard-mangel commented 2 years ago

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?

nadermx commented 2 years ago

Not sure what WSL is? Windows? Also, what version of FFMPEG do you have, this needs 4.4+

edouard-mangel commented 2 years ago

Yes, it's Windows Subsystem for Linux. I did in fact not have the 4.4 version of ffmpeg (forgot I could add a PPA myself, it's been a while since I used GNU/Linux), but I do now have ffmpeg-4.4 and the problem stays the same.

nadermx commented 2 years ago

I think it has to do something with the temporary files created in windows. Seems the temporary directory does this in ubuntu vs windows

On Windows, the directories C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order.
On all other platforms, the directories /tmp, /var/tmp, and /usr/tmp, in that order.

So it might be something with where I'm saving the directory that works fine on ubuntu but windows is changing location

nadermx commented 2 years ago

also, did you install the python3-x-dev (x being what ever version you are using)?

edouard-mangel commented 2 years ago

Hello, Yes I have the ffmpeg4.4, python3.9-dev packages, but I don't have a C:\TMP or TEMP folder, but the console outputs "Output #0, mp4, to '/tmp/tmpdexkumo3/matte.mp4':" I tried copying the file in a folder I have access to, and the file keeps a size of 44bytes.

How can I investigate some more ?

edouard-mangel commented 2 years ago

the problem does not lie in the file i'm trying to remove the background from, because it works if I use your website by the way.

nadermx commented 2 years ago

try apt-get install -y build-essential

edouard-mangel commented 2 years ago

I'm sorry I tried it but my subsystem already had the latest version of this package

nadermx commented 2 years ago

@edouard-mangel I think I found this, if you can edit it locally and try? Seem it is a issue with temp file and windows, https://stackoverflow.com/a/8577226/4180276

nadermx commented 2 years ago

@edouard-mangel I'm going to try and push a commit later that add's something of this sort to everything. See if it's a bit more platform agnotstic.

nadermx commented 1 year ago

Let me know if this fixes it pip install git+https://github.com/nadermx/backgroundremover.git@09c142c8ebcaee035dbd867248957bfbc87e8e3f