图片背景消除

一、工具 rembg #

https://github.com/danielgatis/rembg

rembg i -m birefnet-massive 20241126-140049.jpg 49-max.png

默认使用u2net模型, 使用-m 可以指定模型运行

二、模型 #

Model NameDownload LinkSource LinkDescription描述
u2netDownloadSourceA pre-trained model for general use cases.用于通用用途的预训练模型。
u2netpDownloadSourceA lightweight version of u2net model.u2net模型的轻量版。
u2net_human_segDownloadSourceA pre-trained model for human segmentation.用于人类分割的预训练模型。
u2net_cloth_segDownloadSourceA pre-trained model for clothes parsing.用于服装解析的预训练模型(上衣、下衣、全身)。
siluetaDownloadSourceA reduced size version of u2net (43MB).u2net的精简版(43MB)。
isnet-general-useDownloadSourceA new pre-trained model for general use cases.新的通用预训练模型。
isnet-animeDownloadSourceHigh-accuracy segmentation for anime characters.高精度的动漫角色分割模型。
samDownload EncoderSourceA pre-trained model for any use cases.用于任何用途的预训练模型。
birefnet-generalDownloadSourceA pre-trained model for general use cases.用于通用用途的预训练模型。
birefnet-general-liteDownloadSourceA light pre-trained model for general use cases.轻量级的通用预训练模型。
birefnet-portraitDownloadSourceA pre-trained model for human portraits.用于人像的预训练模型。
birefnet-disDownloadSourceA pre-trained model for dichotomous image segmentation.用于二分图像分割的预训练模型。
birefnet-hrsodDownloadSourceA pre-trained model for high-resolution salient object detection.用于高分辨率显著目标检测的预训练模型。
birefnet-codDownloadSourceA pre-trained model for concealed object detection.用于隐蔽物体检测的预训练模型。
birefnet-massiveDownloadSourceA pre-trained model with a massive dataset.使用大规模数据集的预训练模型。

birefnet-massive #

效果最好, 最吃配置 大概用12G内存