rembg

使用 rembg AI 模型去除图片背景,生成透明背景的 PNG 图片。首次使用需运行 setup/install.py 初始化环境。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rembg" with this command: npx skills add JustZeroX/rembg

rembg - AI 抠图工具

使用 rembg(基于深度学习的背景去除工具)为图片去除背景。

快速开始

1. 初始化环境

首次使用必须先运行环境初始化:

cd <Skill目录>
python3 setup/install.py

初始化后会:

  • 在用户根目录 ~/.venv/rembg/ 创建虚拟环境
  • 自动安装 requirements.txt 中的依赖

2. 验证环境

python3 setup/check_env.py

3. 使用

# 单张图片处理
python3 scripts/remove_bg.py <输入图片路径>

# 批量处理
python3 scripts/batch_remove_bg.py <输入目录> [输出目录]

目录结构

rembg/
├── SKILL.md              # 本文件
├── _meta.json           # 元数据
├── setup/               # 环境初始化
│   ├── install.py       # 安装脚本(创建 ~/.venv/rembg/)
│   ├── requirements.txt  # 依赖声明
│   └── check_env.py     # 环境检查
├── scripts/             # 业务脚本
│   ├── remove_bg.py     # 单张处理
│   └── batch_remove_bg.py  # 批量处理
├── references/          # 参考文档
│   └── rembg-guide.md  # 详细指南
└── image_output/        # 输出目录(运行时生成)
    ├── single/          # 单张结果
    └── batch/           # 批量结果

环境说明

  • 虚拟环境位置~/.venv/rembg/(在用户根目录)
  • AI 模型位置~/.u2net/
  • 首次运行会自动下载 AI 模型(~176MB)
  • 所有脚本使用 ~/.venv/rembg/ 中的 Python 执行

安装后检查

# 验证环境是否就绪
python3 setup/check_env.py

# 应该看到:
# ✓ 虚拟环境存在
# ✓ rembg 已安装
# ✓ AI 模型已下载

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Ai Competitor Analyzer

提供AI驱动的竞争对手分析,支持批量自动处理,提升企业和专业团队分析效率与专业度。

Registry SourceRecently Updated
General

Ai Data Visualization

提供自动化AI分析与多格式批量处理,显著提升数据可视化效率,节省成本,适用企业和个人用户。

Registry SourceRecently Updated
General

Ai Cost Optimizer

提供基于预算和任务需求的AI模型成本优化方案,计算节省并指导OpenClaw配置与模型切换策略。

Registry SourceRecently Updated