0.1.2 • Published 1 year ago
modern-rembg v0.1.2
📦 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 |