一个删除图像背景的工具Rembg

非常简洁干净的一个背景移除工具,可以命令行方式运行、也可以web方式运行,也可以python代码方式运行,安装运行都非常简单。原理是基于图像分割和Matting算法,支持u2net的一些列模型。

开源:https://github.com/danielgatis/rembg
# CPU版本
pip install rembg 
# 如果有GPU,也可以安装GPU版
pip install rembg[gpu]
# 命令行方式
rembg i path/to/input.png path/to/output.png

# web方式
rembg s
from rembg import remove

input_path = 'input.png'
output_path = 'output.png'

with open(input_path, 'rb') as i:
    with open(output_path, 'wb') as o:
        input = i.read()
        output = remove(input)
        o.write(output)
一个删除图像背景的工具Rembg

展开阅读全文

页面更新:2024-05-12

标签:图像   背景   算法   简洁   模型   例子   干净   原理   代码   方式   工具

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top