0.0.2 • Published 5 months ago

modern-rembg v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

📦 Install

npm i modern-rembg

# peerDependencies
npm i onnxruntime-web

🦄 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

OutputModelResolutionSize(MB)From
u2net.onnx320168danielgatis/rembg
u2netp.onnx3204danielgatis/rembg
u2net_human_seg.onnx320168danielgatis/rembg
u2net_cloth_seg.onnx768168danielgatis/rembg
silueta.onnx32042danielgatis/rembg
isnet-general-use.onnx320170danielgatis/rembg
isnet-anime.onnx1024168danielgatis/rembg
large1024176imgly/background-removal-js
medium102488imgly/background-removal-js
small102444imgly/background-removal-js