This guide explains how to deploy the watermark-eraser skill to your local environment, making it ready for AI agents to use directly.
After following this guide, you will have:
- The watermark-eraser skill installed at
~/skills/watermark-eraser/ - All dependencies (OpenCV, PyTorch, LaMa) installed and ready
- A working skill that AI agents can call with simple instructions
Run this command to automatically install everything:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/moose-lab/watermark-eraser/main/install.sh)"This will:
- Clone the repository to
~/skills/watermark-eraser/ - Install all Python dependencies
- Verify the installation
- Create a test script
After installation, run:
bash ~/skills/watermark-eraser/test.shIf you see ✅ Test passed!, the skill is ready to use.
If you prefer to install manually or need more control:
# Create the skills directory
mkdir -p ~/skills
# Clone to the correct location
git clone https://github.com/moose-lab/watermark-eraser.git ~/skills/watermark-erasercd ~/skills/watermark-eraser
pip install -r requirements.txtDependencies installed:
opencv-python- Image processingtorch- Deep learning frameworksimple-lama-inpainting- LaMa inpainting modelnumpy- Numerical operations
python3 -c "import cv2, torch, simple_lama_inpainting; print('✓ All dependencies installed')"If this prints ✓ All dependencies installed, you're ready to go.
Once installed, you can instruct your AI agent to use the skill with simple natural language commands.
Basic batch processing:
"Use the local
watermark-removerskill to process all images in/data/images/and save them to/data/clean/."
With GPU acceleration:
"Use the
watermark-removerskill with GPU acceleration to process the images in/input/and save to/output/."
With quality assurance:
"Use
watermark-removerto process images and save the detection masks for quality checking."
The agent will automatically run:
python ~/skills/watermark-eraser/src/batch_processor.py \
--input /data/images/ \
--output /data/clean/ \
--batchAnd deliver:
- Processed images (watermark-free)
processing_report.json(detailed statistics)output_files.txt(list of output files)
If you want to run the skill manually (without an agent):
python ~/skills/watermark-eraser/src/batch_processor.py \
--input /path/to/images/ \
--output /path/to/results/ \
--batch| Option | Description | Example |
|---|---|---|
--input |
Input directory or single image | /data/images/ |
--output |
Output directory or single image | /data/clean/ |
--batch |
Enable batch processing mode | (flag) |
--device |
Processing device (auto/cuda/mps/cpu) | --device cuda |
--save-masks |
Save detection masks | (flag) |
--visualize |
Save visualization images | (flag) |
Process a single image:
python ~/skills/watermark-eraser/src/batch_processor.py \
--input photo.jpg \
--output photo_clean.jpgBatch process with GPU:
python ~/skills/watermark-eraser/src/batch_processor.py \
--input ./images/ \
--output ./clean/ \
--batch \
--device cudaQuality assurance workflow:
python ~/skills/watermark-eraser/src/batch_processor.py \
--input ./images/ \
--output ./qa_results/ \
--batch \
--save-masks \
--visualizeAfter processing, your output directory will contain:
output/
├── image1.png # Processed images
├── image2.png
├── ...
├── processing_report.json # Detailed statistics
└── output_files.txt # List of all output files
{
"timestamp": "2026-02-22T12:00:00",
"input_dir": "/data/images/",
"output_dir": "/data/clean/",
"total_images": 28,
"successful": 28,
"failed": 0,
"detector_method": "V3 Complete Detector",
"average_coverage": 3.21,
"average_time": 5.8,
"results": [
{
"input": "/data/images/1.png",
"output": "/data/clean/1.png",
"success": true,
"mask_coverage": 3.21,
"processing_time": 5.8
}
]
}/data/clean/1.png
/data/clean/2.png
/data/clean/3.png
...
This file list can be used for:
- Uploading to cloud storage
- Further image processing
- Creating archives
- Integration with other tools
Solution:
cd ~/skills/watermark-eraser
pip install -r requirements.txtSolution:
# Manually download the model
mkdir -p ~/.cache/lama
cd ~/.cache/lama
wget https://github.com/enesmsahin/simple-lama-inpainting/releases/download/v0.1.0/big-lama.ptSolution: Use CPU mode instead:
python ~/skills/watermark-eraser/src/batch_processor.py \
--input /data/images/ \
--output /data/clean/ \
--batch \
--device cpuSolution:
- Save visualization to check detection:
python ~/skills/watermark-eraser/src/batch_processor.py \ --input /data/images/ \ --output /data/clean/ \ --batch \ --visualize - Check the
*_detection.pngfiles to see what was detected - If needed, adjust detection parameters in
src/complete_watermark_detector.py
If you need to process different types of watermarks, you can modify the detector:
# Edit the detector configuration
nano ~/skills/watermark-eraser/src/complete_watermark_detector.pyKey parameters:
search_height_ratio: Height of search area (default: 0.15 = bottom 15%)search_width_ratio: Width of search area (default: 0.50 = right 50%)bg_color_lower/upper: Color range for watermark detectionmin_width/max_width: Expected watermark width rangemin_height/max_height: Expected watermark height range
Example: Process and upload to S3
import subprocess
import boto3
from pathlib import Path
# Process images
subprocess.run([
'python', '~/skills/watermark-eraser/src/batch_processor.py',
'--input', '/data/images/',
'--output', '/data/clean/',
'--batch'
])
# Upload to S3
s3 = boto3.client('s3')
output_files = Path('/data/clean/output_files.txt').read_text().splitlines()
for file_path in output_files:
s3.upload_file(file_path, 'my-bucket', Path(file_path).name)- Architecture: Technical details of the V3 detector and LaMa inpainting
- Development History: How the 100% coverage detector was built
- Examples: Python scripts for basic and advanced usage
- GitHub Repository: Source code and issues
After installation, verify that:
- Repository is cloned to
~/skills/watermark-eraser/ - All dependencies are installed (
python3 -c "import cv2, torch, simple_lama_inpainting") - Test script passes (
bash ~/skills/watermark-eraser/test.sh) - AI agent can find and use the skill
- Batch processing works on sample images
Your watermark-eraser skill is now deployed and ready for AI agents to use. Simply instruct your agent to use the skill, and it will handle the rest automatically.
Example instruction:
"Use the local watermark-remover skill to process all images in
/my/images/and save to/my/clean_images/."
The agent will take care of everything from detection to inpainting to delivering the results!