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

why does it access google driver? #9

Closed OsmondGao closed 2 years ago

OsmondGao commented 3 years ago

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

nadermx commented 3 years ago

It access google drive to download them, if you do not have the u2net models in your ~/.u2net path. You can get them from baidu here. https://pan.baidu.com/s/1WjwyEwDiaUjBbx_QxcXBwQ I'll see if I can add a fallback for baidu, but I don't have any experience with them..

nadermx commented 3 years ago

I'm working on a pull request, and i reopened the issue I have with the, but in the mean time, you can get u2net from here https://video.backgroundremover.app/static/u2net/u2net.pth https://video.backgroundremover.app/static/u2net/u2net_human_seg.pth

StKyr commented 2 years ago

Seeing a message from CLI tool that says it downloads some misc-extension file from Google Drive may give a security issue heart attack to certain people, especially to ones who don't realize this is a DL-powered tool. Then again, if your code were (is) indeed malicious, I highly doubt you would be so kind as to notify the victim. I would suggest edit the README to at least inform the users until the pull request is closed.

nadermx commented 2 years ago

@StKyr I'll close the request here pretty soon. I do actually mention it on the read me https://github.com/nadermx/backgroundremover#installation, right before the actual pip install. The issue is the models are over the 100 MB size limit of github. I'll try and think of another soltuion, maybe break up the models intwo two and have the script merge them together.

StKyr commented 2 years ago

@nadermx You are right, it is mentioned and I didn't see it. Then, considering the size limit you could simply modify the README to add something more striking like:

The program requires the u2net model to be downloaded in your local system.
If it is already installed, you can specify its location using the XXX argument. Otherwise, the program will attempt to download it from my Google Drive and save it to ~/.u2net/.

nadermx commented 2 years ago

@StKyr It's okay, I broke up the file and put it in the git. So it shouldn't be pulling google anymore. I haven't bumped the version yet, as want to close out a few other bugs on this release.

nadermx commented 2 years ago

Went ahead and closed this, as I got the model in the github repo, and had a typo in the actual function to fix it, so it did not work before.

liujin163 commented 1 year ago

It access google drive to download them, if you do not have the u2net models in your ~/.u2net path. You can get them from baidu here. https://pan.baidu.com/s/1WjwyEwDiaUjBbx_QxcXBwQ I'll see if I can add a fallback for baidu, but I don't have any experience with them..

the download url need access code, cloud you please send it for me?