High-precision, 100% coverage watermark removal tool powered by a V3 detector and LaMa inpainting.
This tool automatically detects and erases watermarks from images with pixel-perfect precision. It can be used as a standalone Python project or as a Manus Skill for direct integration with Code Agents.
This is the recommended way to use the tool for automated, large-scale processing. A Code Agent can directly use this repository as a skill to process images.
- Provide the GitHub URL: Give the agent the URL to this repository:
https://github.com/moose-lab/watermark-eraser.git - Assign the Task: Instruct the agent to process a directory of images.
"Use the skill from
https://github.com/moose-lab/watermark-eraser.gitto remove the watermarks from all images in the/path/to/my/imagesdirectory. Save the clean images to/path/to/my/output."
The agent will automatically perform the following steps:
- Clone the Repository:
git clone https://github.com/moose-lab/watermark-eraser.git - Install Dependencies:
pip install -r requirements.txt - Execute Batch Processing: Run the
batch_processor.pyscript with the specified input and output directories.
# Agent will run this command
python watermark-eraser/src/batch_processor.py \
--input /path/to/my/images/ \
--output /path/to/my/output/ \
--batch- Deliver Results: The agent will provide a link to the output directory containing:
- Clean, watermark-free images.
- A detailed
processing_report.json. - An
output_files.txtlist for easy integration.
For advanced users who want to pre-install the skill in their local environment.
Run this command to clone the repository and install all dependencies:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/moose-lab/watermark-eraser/main/install.sh)"This will:
- Clone the repository to
/home/ubuntu/skills/watermark-eraser. - Install all necessary Python packages.
- Download the LaMa model.
Once installed, you can instruct your agent to use the local skill:
"Use the local
watermark-removerskill to process the images in/input/dir/and save them to/output/dir/."
For detailed steps, see the Local Deployment Guide.
- 100% Coverage V3 Detector: A custom-built, three-stage detector that guarantees every pixel of the target watermark is identified.
- Zero Residue: By providing a perfect mask to the inpainting model, it leaves no dark edges or blurry artifacts.
- LaMa Inpainting: Utilizes the state-of-the-art LaMa (Large Mask Inpainting) model for seamless, high-quality background reconstruction.
- Batch Processing: Process entire directories of images with a single command.
- Detailed Reporting: Generates a JSON report with statistics for each image, including mask coverage and processing time.
- GPU Acceleration: Supports CUDA and MPS for significantly faster processing.
For local development or integration into non-agent workflows.
# Clone the repository
git clone https://github.com/moose-lab/watermark-eraser.git
cd watermark-eraser
# Install dependencies
pip install -r requirements.txtProcess a single image:
python src/batch_processor.py \
--input /path/to/your/image.jpg \
--output /path/to/output/result.jpgProcess a directory of images:
python src/batch_processor.py \
--input /path/to/your/images/ \
--output /path/to/output/results/ \
--batchUse the --device flag to specify a processing device (cuda, mps, or cpu).
# Use NVIDIA GPU
python src/batch_processor.py --batch --device cuda ...Save the detection mask and a visualization image for quality checks.
python src/batch_processor.py \
--input ./images/ \
--output ./qa_results/ \
--batch \
--save-masks \
--visualize- Local Deployment Guide: Step-by-step instructions for setting up the skill locally.
- Architecture: A detailed look at the system components and data flow.
- Development History: The story of how the V3 detector was built.
- Examples: Basic and advanced usage scripts.
Based on a test set of 72 images with consistent watermarks:
| Metric | Result |
|---|---|
| Success Rate | 100% (72/72) |
| Mask Coverage | 100.00% |
| False Positives | 0% |
| Residue/Artifacts | 0% |
| Avg. Time (CPU) | 5.8 sec/image |
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE file for details.
