当前位置: 首页>前端>正文

本地去水印神器 lama-cleaner

硬件要求

lama-cleaner 支持 GPU 和 CPU 运行,对于 GPU,需要约 2G 显存。

anaconda 的安装和使用

见 https://www.jianshu.com/p/adb1c163af46?v=1684159234141

创建虚拟环境 lama-cleaner

打开 anaconda navigator 软件,新建虚拟环境 lama-cleaner,进入终端。
之后浏览器打开进入 lama-cleaner 官网 ,按照官网提示安装。

安装 cuda 版本的 pytorch

官网提示:In order to use the GPU, install cuda version of pytorch first.

(lama-cleaner) conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

安装依赖

(lama-cleaner) pip install lama-cleaner

启动服务

(lama-cleaner) lama-cleaner --model=lama --model-dir D:\project\lama-cleaner\models --output-dir D:\project\lama-cleaner\outputs --device=cuda --port=8888

启动过程中首先打印相关核心软件版本,之后,下载模型。

- Platform: Windows-10-10.0.22621-SP0
- Python version: 3.10.11
- torch: 2.0.1
- Pillow: 9.4.0
- diffusers: 0.14.0
- transformers: 4.27.4
- opencv-python: 4.7.0.72
- xformers: N/A
- accelerate: 0.19.0
- lama-cleaner: 1.1.2
Downloading: "https://github.com/Sanster/models/releases/download/add_big_lama/big-lama.pt" to D:\project\lama-cleaner\models\torch\hub\checkpoints\big-lama.pt
lama_cleaner.helper:download_model:52 - Download model success, md5: e3aa4aaa15225a33ec84f9f4bc47e500
lama_cleaner.helper:load_jit_model:102 - Loading model from: D:\project\lama-cleaner\models\torch\hub\checkpoints\big-lama.pt
Running on http://127.0.0.1:8888/

启动参数见:
https://lama-cleaner-docs.vercel.app/install/pip

使用服务

浏览器打开 http://127.0.0.1:8888/,上传图片,涂抹水印,涂抹后等待水印去除即可。


本地去水印神器 lama-cleaner,第1张

https://www.xamrdz.com/web/2aa1883027.html

相关文章: