很多时候,遇到一张心仪的图片,但是上面总会有一些乱七八糟的水印,或者拍照时出现路人和其他违和的景物,这时候会很苦恼,但是现在,这个问题可以解决啦,Lama Cleaner内置了多种AI 模型构建,功能相当的齐全。可用于快速去除图像中各种水印、物品、人物、字体、等对象,并支持老照片修复、文本替换图像内容等。
接下来就让我带大家体验安装吧。
首先选购GPU服务器,当然你本地配置够好也可以本地,我这里选择腾讯云的竞价GPU。好处是价格低,如果你想长期使用可以选择包年包月。
注意需要pip环境,没有的可以去安装下python。
pip install lama-cleaner
# Models will be downloaded at first time used
lama-cleaner --model=lama --device=gpu --port=80
# Lama Cleaner is now running at http://localhost
首先使用pip install lama-cleaner命令安装,然后使用lama-cleaner --model=lama --device=gpu --port=80
使用方法:浏览器输入http://服务器ip即可访问(成功后会给出访问地址)
注意:
Run Docker (cpu)
docker run -p 80:8080 \
-v /path/to/torch_cache:/root/.cache/torch \
-v /path/to/huggingface_cache:/root/.cache/huggingface \
--rm cwq1913/lama-cleaner:cpu-0.26.1 \
lama-cleaner --device=cpu --port=80 --host=0.0.0.0
Run Docker (gpu)
docker run --gpus all -p 80:8080 \
-v /path/to/torch_cache:/root/.cache/torch \
-v /path/to/huggingface_cache:/root/.cache/huggingface \
--rm cwq1913/lama-cleaner:gpu-0.26.1 \
lama-cleaner --device=cuda --port=80 --host=0.0.0.0
cpu only
docker build -f --build-arg version=0.x.0 ./docker/CPUDockerfile -t lamacleaner .
gpu & cpu
docker build -f --build-arg version=0.x.0 ./docker/GPUDockerfile -t lamacleaner .
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。