jasonengage's picture
Updated README with metadata, tags, and test link
fdaa122
---
license: other
license_name: non-commercial
license_link: LICENSE
tags:
- image-to-image
- watermark-removal
- remove-watermark
- watermark
- torchscript
- computer-vision
- image-processing
- image-restoration
- image-cleaning
pipeline_tag: image-to-image
library_name: pytorch
---
# Fast Watermark Removal
A high-performance TorchScript model for removing watermarks from images. This model uses a dual-stage architecture optimized for speed and quality.
## Test the Model
Try the model instantly in your browser — no setup required:
**[Remove Watermarks → clearpics.ai](https://clearpics.ai/remove-watermarks)**
## Features
- **Fast inference**: ~500ms per image (RTX 4090)
- **High quality**: Preserves image details while effectively removing watermarks
- **Production-ready**: Compiled TorchScript model, no training code needed
- **Memory efficient**: Requires 11.5GB VRAM
## Technical Details
- **Architecture**: Dual-stage with Swin2 Transformers
- **Format**: TorchScript (.ts) compiled model
- **Input**: RGB images (any resolution)
- **Output**: RGB images (max 768px, aspect ratio preserved)
- **Precision**: FP32 with TensorFloat32 matmul on Ampere+ GPUs
- **Batch size**: 1
## Limitations
- **Output resolution**: Limited to 768px maximum dimension (aspect ratio preserved)
## Commercial License
A commercial license with **1536px maximum output resolution** is available for production use. The 1536px model maintains identical:
- VRAM requirements (11.5GB)
- Inference times (~500ms)
- Image Output
**Contact**: contact by email for commercial licensing inquiries
## Installation
### Requirements
- Python 3.10+
- CUDA-capable GPU with 11.5GB+ VRAM
- PyTorch 2.0+
### Setup
```bash
# Install dependencies
pip install -r requirements.txt
```
## Usage
### Single Image
```bash
python inference.py -i /path/to/watermarked/image.jpg -m model.ts -o output_folder
```
### Batch Processing
```bash
python inference.py -f /path/to/images/folder -m model.ts
```
### Arguments
- `-i, --image`: Path to single input watermarked image
- `-f, --folder`: Path to folder containing watermarked images (processes all .jpg and .webp files)
- `-m, --model_path`: Path to TorchScript model file (required)
- `-o, --output_folder`: Output folder for results (default: `tests`)
### Output
The script saves two files per input:
1. **Original image**: Copied to output folder with original filename
2. **Clean image**: Saved as WebP with `-clean.webp` suffix
Images are automatically resized to maintain aspect ratio while respecting the 768px maximum dimension.
## How It Works
The model uses a two-stage pipeline:
1. **Stage 1**: Removes 90-95% of watermarks
2. **Stage 2**: Removes remaining watermarks
3. **Post-processing**: Automatic resizing to original aspect ratio (capped at 768px)
All processing (including resizing and normalization) is performed within the compiled TorchScript model for optimal performance.
## Future Improvements
I'm actively exploring ways to enhance this model's capabilities. If you have suggestions, encounter issues, or are interested in collaborating on improvements, please reach out!
## License
This model is provided for **non-commercial research and personal use only**. For commercial applications, please contact by email for licensing options.
## Support
- **Issues**: Open an issue on the HuggingFace repository
- **Questions**: jason@engageify.com
- **Commercial licensing**: jason@engageify.com