<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://zxdd.com/index.php?action=history&amp;feed=atom&amp;title=Rembg</id>
	<title>Rembg - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://zxdd.com/index.php?action=history&amp;feed=atom&amp;title=Rembg"/>
	<link rel="alternate" type="text/html" href="https://zxdd.com/index.php?title=Rembg&amp;action=history"/>
	<updated>2026-06-02T19:45:37Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://zxdd.com/index.php?title=Rembg&amp;diff=1318&amp;oldid=prev</id>
		<title>Eric：​创建页面，内容为“Rembg是一个开源的Python软件包，用于自动去除图片背景。 默认使用U²-Net进行前景检测，使用PyMatting进行抠图。  ==简介== ===时间轴===  ===安装=== 仅使用cpu计算，安装rembg版本：  pip install rembg  使用GPU加速，   ==Python中使用== 使用pillow库进行，PIL的图片的操作。 &lt;syntaxhighlight lang=&quot;python&quot; &gt; from rembg import remove from PIL import Image  input_path = &#039;input.png&#039; out…”</title>
		<link rel="alternate" type="text/html" href="https://zxdd.com/index.php?title=Rembg&amp;diff=1318&amp;oldid=prev"/>
		<updated>2023-05-05T09:06:38Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“Rembg是一个开源的&lt;a href=&quot;/Python&quot; title=&quot;Python&quot;&gt;Python&lt;/a&gt;软件包，用于自动去除图片背景。 默认使用&lt;a href=&quot;/index.php?title=U%C2%B2-Net&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;U²-Net（页面不存在）&quot;&gt;U²-Net&lt;/a&gt;进行前景检测，使用&lt;a href=&quot;/index.php?title=PyMatting&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;PyMatting（页面不存在）&quot;&gt;PyMatting&lt;/a&gt;进行抠图。  ==简介== ===时间轴===  ===安装=== 仅使用cpu计算，安装rembg版本：  pip install rembg  使用GPU加速，   ==Python中使用== 使用&lt;a href=&quot;/Pillow&quot; title=&quot;Pillow&quot;&gt;pillow&lt;/a&gt;库进行，PIL的图片的操作。 &amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; &amp;gt; from rembg import remove from PIL import Image  input_path = &amp;#039;input.png&amp;#039; out…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Rembg是一个开源的[[Python]]软件包，用于自动去除图片背景。 默认使用[[U²-Net]]进行前景检测，使用[[PyMatting]]进行抠图。&lt;br /&gt;
&lt;br /&gt;
==简介==&lt;br /&gt;
===时间轴===&lt;br /&gt;
&lt;br /&gt;
===安装===&lt;br /&gt;
仅使用cpu计算，安装rembg版本：&lt;br /&gt;
 pip install rembg&lt;br /&gt;
&lt;br /&gt;
使用GPU加速，&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Python中使用==&lt;br /&gt;
使用[[pillow]]库进行，PIL的图片的操作。&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; &amp;gt;&lt;br /&gt;
from rembg import remove&lt;br /&gt;
from PIL import Image&lt;br /&gt;
&lt;br /&gt;
input_path = &amp;#039;input.png&amp;#039;&lt;br /&gt;
output_path = &amp;#039;output.png&amp;#039;&lt;br /&gt;
&lt;br /&gt;
input = Image.open(input_path)&lt;br /&gt;
output = remove(input)&lt;br /&gt;
output.save(output_path)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==命令行中使用==&lt;br /&gt;
&lt;br /&gt;
==参数==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! 名称&lt;br /&gt;
! 描述&lt;br /&gt;
! 示例&lt;br /&gt;
|-&lt;br /&gt;
| alpha_matting&lt;br /&gt;
| 是否使用alpha matting参数，默认False，&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| alpha_matting_foreground_threshold&lt;br /&gt;
| 前景阈值，默认240&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| alpha_matting_background_threshold&lt;br /&gt;
| 背景阈值，默认10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| alpha_matting_erode_size&lt;br /&gt;
| 默认10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|only_mask&lt;br /&gt;
| 默认False&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==资源==&lt;br /&gt;
===官网===&lt;br /&gt;
* Rembg 官网：https://github.com/danielgatis/rembg&lt;br /&gt;
* Rembg 源代码：https://github.com/danielgatis/rembg&lt;br /&gt;
&lt;br /&gt;
===网站===&lt;br /&gt;
* https://github.com/xuebinqin/U-2-Net&lt;br /&gt;
* https://github.com/pymatting/pymatting&lt;br /&gt;
===文章===&lt;/div&gt;</summary>
		<author><name>Eric</name></author>
	</entry>
</feed>