Skip to content

moose-lab/watermark-eraser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watermark Eraser

High-precision, 100% coverage watermark removal tool powered by a V3 detector and LaMa inpainting.

License: MIT Python 3.8+

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.

Comparison


🚀 Usage with Code Agents (Manus Skill)

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.

How It Works

  1. Provide the GitHub URL: Give the agent the URL to this repository: https://github.com/moose-lab/watermark-eraser.git
  2. Assign the Task: Instruct the agent to process a directory of images.

Example Prompt for a Code Agent

"Use the skill from https://github.com/moose-lab/watermark-eraser.git to remove the watermarks from all images in the /path/to/my/images directory. Save the clean images to /path/to/my/output."

Agent Workflow

The agent will automatically perform the following steps:

  1. Clone the Repository: git clone https://github.com/moose-lab/watermark-eraser.git
  2. Install Dependencies: pip install -r requirements.txt
  3. Execute Batch Processing: Run the batch_processor.py script 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
  1. 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.txt list for easy integration.

本地部署 (Local Deployment for Agents)

For advanced users who want to pre-install the skill in their local environment.

1. One-Step Installation

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.

2. Instruct Your Agent

Once installed, you can instruct your agent to use the local skill:

"Use the local watermark-remover skill to process the images in /input/dir/ and save them to /output/dir/."

3. Manual Installation

For detailed steps, see the Local Deployment Guide.


✨ Key Features

  • 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.

🛠️ Standalone Usage

For local development or integration into non-agent workflows.

1. Installation

# Clone the repository
git clone https://github.com/moose-lab/watermark-eraser.git
cd watermark-eraser

# Install dependencies
pip install -r requirements.txt

2. Basic Usage

Process a single image:

python src/batch_processor.py \
  --input /path/to/your/image.jpg \
  --output /path/to/output/result.jpg

Process a directory of images:

python src/batch_processor.py \
  --input /path/to/your/images/ \
  --output /path/to/output/results/ \
  --batch

🔧 Advanced Options

GPU Acceleration

Use the --device flag to specify a processing device (cuda, mps, or cpu).

# Use NVIDIA GPU
python src/batch_processor.py --batch --device cuda ...

Quality Assurance

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

📚 Documentation

📊 Performance

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

🤝 Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Remove watermarks, logos, and text overlays from your images effortlessly with AI-powered technology. Perfect for cleaning product photos and creating pristine visuals in seconds.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors