Giter Site home page Giter Site logo

qq15725 / modern-rembg Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 2.0 14.14 MB

๐Ÿ˜ Uses an AI model to remove image backgrounds. Only the ESM.

License: MIT License

HTML 4.73% TypeScript 81.68% JavaScript 13.60%
background-removal image-matting image-processing javascript onnx typescript

modern-rembg's Introduction

modern-rembg

Minzip Version Downloads Issues License

๐Ÿ“ฆ 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

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

modern-rembg's People

Contributors

qq15725 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tamdao

modern-rembg's Issues

Fail configuration

Hi, could you provide a full example to try the library, I have been trying it but I always have problems with CommonJS, modules, ...
It should be fine to have a full guide to try it.
Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.