Use the AI tool Lama Cleaner to remove watermarks, characters, backgrounds and other content in pictures with one click
foreword
- Due to my limited level, it is inevitable that there will be mistakes and omissions, please criticize and correct.
- For more exciting content, click to enter the YOLO series column, natural language processing
column or my personal homepage to view- YOLOv5: Add SE, CBAM, CoordAtt, ECA attention mechanism
- YOLOv5: Interpretation of yolov5s.yaml configuration file, adding small target detection layer
- YOLOv5:IoU、GIoU、DIoU、CIoU、EIoU
- YOLOv7 trains its own data set (mask detection)
- YOLOv8 trains its own data set (football detection)
- Playing with Jetson Nano (5): TensorRT accelerates YOLOv5 target detection
- YOLOv5: Use version 7.0 to train your own instance segmentation model (instance segmentation of vehicles, pedestrians, road signs, lane lines, etc.)
- Python converts the COCO format instance segmentation dataset to the YOLO format instance segmentation dataset
- Face Masquerade Detection Based on DETR
- Use Kaggle GPU resources to experience the Stable Diffusion open source project for free
- YOLOv5: TensorRT accelerates YOLOv5 model reasoning
prerequisite
- Familiar with Python
related introduction
- Python is a cross-platform computer programming language. It is a high-level scripting language that combines interpretability, compilation, interactivity and object-oriented. Originally designed for writing automation scripts (shell), as the version is continuously updated and new language features are added, it is more and more used for the development of independent and large-scale projects.
- PyTorch is a deep learning framework, which encapsulates many network and deep learning related tools for us to call, instead of writing them one by one. It is divided into CPU and GPU versions, and other frameworks include TensorFlow, Caffe, etc. PyTorch is launched by Facebook Artificial Intelligence Research Institute (FAIR) based on Torch. It is a Python-based sustainable computing package that provides two advanced features: 1. Tensor computing with powerful GPU acceleration (such as NumPy); 2. , Automatic differentiation mechanism when constructing deep neural network.
- Lama Cleaner is a completely free and open source image removal and repair tool with no resolution limit: Lama Cleaner has a variety of built-in AI model construction, and the functions are quite complete. It can be used to quickly remove various watermarks, items, characters, fonts, and other content in images.
Lama Cleaner
- Project address : https://github.com/Sanster/lama-cleaner.git
Environmental requirements
- torch>=1.9.0
- opencv-python
- flask==2.2.3
- flask-socketio
- simple-websocket
- flask_cors
- flaskwebgui==0.3.5
- pydantic
- rich
- window
- yacs
- diffusers==0.16.1
- transformers==4.27.4
- built
- piexif==1.1.3
- safetensors
- omegaconf
- controlnet-aux==0.0.3
Install Lama Cleaner
- Before installing pip, you need to install the Python environment
pip install lama-cleaner
或者
pip install lama-cleaner -i https://pypi.tuna.tsinghua.edu.cn/simple # 使用国内镜像源,下载速度更快。
Start Lama Cleaner
Start in CPU mode
lama-cleaner --model=lama --device=cpu --port=8080
GPU mode start
## 本机浏览
lama-cleaner --model=lama --device=cuda --port=8080 --model-dir E:\mytest\lama_cleaner\weight
## 局域网内浏览
lama-cleaner --model=lama --device=cuda --port=8080 --model-dir E:\mytest\lama_cleaner\weight --host 0.0.0.0
Use Lama Cleaner
- Open the URL in your browser:
http://IP地址:8080
Test Results
NO.1 Detection frame
- Open to the original picture
- Press and hold the mouse to remove the content in the picture (yellow track)
- renderings
NO.2 water mark
- Open to the original picture
- Press and hold the mouse to remove the content in the picture (yellow track)
- renderings
NO.3 Canton Tower
-
Open to the original picture
-
Press and hold the mouse to remove the content in the picture (yellow track)
-
renderings
NO.4 character background
-
Open to the original picture
-
Press and hold the mouse to remove the content in the picture (yellow track)
-
renderings
reference
[1] https://github.com/Sanster/lama-cleaner.git
- Due to my limited level, it is inevitable that there will be mistakes and omissions, please criticize and correct.
- For more exciting content, click to enter the YOLO series column, natural language processing
column or my personal homepage to view- YOLOv5: Add SE, CBAM, CoordAtt, ECA attention mechanism
- YOLOv5: Interpretation of yolov5s.yaml configuration file, adding small target detection layer
- YOLOv5:IoU、GIoU、DIoU、CIoU、EIoU
- YOLOv7 trains its own data set (mask detection)
- YOLOv8 trains its own data set (football detection)
- Playing with Jetson Nano (5): TensorRT accelerates YOLOv5 target detection
- YOLOv5: Use version 7.0 to train your own instance segmentation model (instance segmentation of vehicles, pedestrians, road signs, lane lines, etc.)
- Python converts the COCO format instance segmentation dataset to the YOLO format instance segmentation dataset
- Face Masquerade Detection Based on DETR
- Use Kaggle GPU resources to experience the Stable Diffusion open source project for free
- YOLOv5: TensorRT accelerates YOLOv5 model reasoning