makidoll / rembg-node

Rembg lets you easily remove backgrounds from images using the U2-Net AI model
MIT License
36 stars 11 forks source link

Failed to download gdrive link #5

Open sohailskills opened 9 months ago

sohailskills commented 9 months ago

/home/Desktop/my_project/back-end/node_modules/rembg-node/dist/gdown.js:5 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } ^ Error: Failed to download gdrive link at /home/Desktop/my_project/back-end/node_modules/rembg-node/dist/gdown.js:84:23 at Generator.next () at fulfilled (/home/Desktop/my_project/back-end/node_modules/rembg-node/dist/gdown.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5)

Mustafa-Aswadi commented 8 months ago

same problem. @makidoll

konanleesoobin commented 8 months ago
  1. download https://drive.usercontent.google.com/download?id=1tCU5MM1LhRgGou5OpmpjBQbSrYIUoYab
  2. mkdir home directory > .u2net
  3. mv download u2net.onnx .u2net
favger commented 8 months ago

The u2net.onnx model is used to make the image transparent. Since this file is 170MB in size, I guess the developer didn't put it in the repo. There is a code in the code that tries to download this file from a Google Drive link, but I think that code is not working right now.

You can solve the problem this way;

Download the model: https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx change: path.resolve("u2net.onnx") in src/index.ts: line 96