17 U2Net Image Manipulation

20211014 Package: rembg by Yan Liu.

Removing the background from an image (referred to in the business as generating a cutout) can be a tedious task using traditional photo editing software. Using AI to do it for you it can be done in 5 minutes or less.

This MLHub package, rembg, demonstrates how to do a cutout and other image operations. Utilising the u2net framework, this rembg package can run a quick demo that visualises the results, for you to determine whether this package fits your needs. The capability is then provided as a command line tool, producing a cutout from any image file.

The rembg package will download the required pre-built model for the task, and then utilise the model to perform the cutout.

To install, configure, and demonstrate the package, renaming it as u2net (expecting other u2net capabilities to be added over time):

ml install   StafferOliver/rembg
ml rename    rembg u2net
ml configure u2net
ml readme    u2net
ml commands  u2net
ml demo      u2net

In addition to the demo command the package also supports cutout.

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0