modern-rembg
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

modern-rembg

Minzip Version Downloads Issues License

📦 Install

npm i modern-rembg

# peerDependencies
npm i onnxruntime-web@1.18.0

🦄 Usage

import { removeBackground } from 'modern-rembg'

removeBackground('/example.jpg').then(blob => {
  window.open(URL.createObjectURL(blob))
})

Use custom model

import { removeBackground } from 'modern-rembg'

removeBackground('/example.jpg', {
  debug: true,
  model: '/you-custom-model.onnx', // default use u2netp.onnx
  resolution: 320, // model resolution
}).then(blob => {
  window.open(URL.createObjectURL(blob))
})

Open source models

Output Model Resolution Size(MB) From
u2net.onnx 320 168 danielgatis/rembg
u2netp.onnx 320 4 danielgatis/rembg
u2net_human_seg.onnx 320 168 danielgatis/rembg
u2net_cloth_seg.onnx 768 168 danielgatis/rembg
silueta.onnx 320 42 danielgatis/rembg
isnet-general-use.onnx 320 170 danielgatis/rembg
isnet-anime.onnx 1024 168 danielgatis/rembg
large 1024 176 imgly/background-removal-js
medium 1024 88 imgly/background-removal-js
small 1024 44 imgly/background-removal-js
PPModnet_MobileNetV2.onnx 320 26 PaddlePaddle/FastDeploy

Package Sidebar

Install

npm i modern-rembg

Weekly Downloads

4

Version

0.1.2

License

MIT

Unpacked Size

106 MB

Total Files

15

Last publish

Collaborators

  • wengxiangmin