# zuruoke/watermark-removal: a TensorFlow 1.15 inpainting model for removing watermarks

> The repository pairs a Contextual Attention and Gated Convolution inpainting model with a Docker image and a checkpoint directory you download separately. It is a research-grade script, not a hosted service, and the README itself marks the Colab path as broken.

**zuruoke/watermark-removal** — a machine learning image inpainting task that instinctively removes watermarks from image indistinguishable from the ground truth image 

- Repository: https://github.com/zuruoke/watermark-removal
- Stars: 5,181 · Forks: 595
- Language: Python
- License: not declared
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/zuruoke-watermark-removal

## The problem it targets: removing a watermark by reconstructing pixels, not by cropping

Most quick watermark tools blur, clone or crop around the mark. That leaves a visible patch. This project takes the harder route: it treats the watermark region as missing and asks a neural network to invent plausible pixels there, the same task as image inpainting. The README describes the goal as removing watermarks in a way that is "totally indistinguishable from the ground truth version of the image", which is the ambition of the inpainting literature it cites rather than a measured result.

The intended user is someone comfortable with Python and command-line tooling who has a batch of images and a local machine or GPU box. There is no hosted demo, no web UI and no API service in the repository. The top-level entries are scripts and model code: main.py, batch_test.py, guided_batch_test.py, preprocess_image.py, inpaint_model.py, inpaint_ops.py, inpaint.yml and a model/ directory. If you want a drag-and-drop web page, this is the wrong shape of project. If you want a script you can call from a pipeline, it is the right shape.

## How the inpainting mechanism works: mask, generator, contextual attention

The architecture follows two papers the README credits: Contextual Attention (CVPR 2018) and Gated Convolution (ICCV 2019 Oral). The repository files reflect that. inpaint_model.py holds the network definition, inpaint_ops.py holds the layer operations, and inpaint.yml carries configuration. The checkpoint directory you supply is the trained weight set, so the repository ships code without weights; the README points to a Google Drive folder for the model directory.

The data flow implied by the entry points is a single image in, a single image out. main.py accepts --image, --output, --checkpoint_dir and --watermark_type. The batch scripts suggest the same pipeline can be looped over a directory. Two details matter for anyone reading the code before running it. First, the watermark type is a named parameter rather than a mask you draw, so the tool is built around known watermark layouts rather than arbitrary marks. Second, the README's example uses istock, which tells you the supported values are specific brand-shaped patterns, not a general detector. That is a real constraint: a watermark the model was not trained against is not covered by a documented flag.

## Installing with Docker and running a first removal

The README gives Docker as the primary path, and the Dockerfile backs it up. It starts from tensorflow/tensorflow:1.15.5-py3, installs git, clones JiahuiYu/neuralgym into /tmp and pip installs it, then adds opencv-python==4.9.0.80, Pillow, numpy and pyyaml. It creates a nonroot user, copies the repository to /repo and sets the entrypoint to run main.py. Note the version split: the README badge says tensorflow v1.15.0 while requirements.txt and the Dockerfile both pin 1.15.5.

Clone the repository, then build the image from its root:

```bash
docker build -t watermark-removal .
```

Download the model directory from the link in the README before running anything. Then mount three directories: the checkpoint, your input, and an output location. The README's own invocation is the reference for the argument names:

```bash
docker run --rm -v '<path_to_model_dir>:/repo/model' -v '<path_to_input_dir>:/input' -v '<path_to_output_dir>:/output' watermark-removal --checkpoint_dir /repo/model --image '/input/<input_image_file>' --output '/output/<output_image_file>' --watermark_type istock
```

If you skip Docker, the README's Colab route installs the same dependencies by hand. It pins tensorflow==1.15.0 and then installs neuralgym from GitHub:

```bash
pip install tensorflow==1.15.0
pip install git+https://github.com/JiahuiYu/neuralgym
```

After that, the README runs the script directly, with the same four arguments as the container:

```bash
python main.py --image path-to-input-image --output path-to-output-image --checkpoint_dir model/ --watermark_type istock
```

One gotcha is documented: Google Drive sometimes appends .txt, so rename checkpoint.txt to checkpoint inside the model directory. The README does not document what a successful run prints, and it does not document rollback or how to tell a failed inference from a successful one.

## The Colab path is marked broken, and TensorFlow 1.15 is the real cost

The README's own heading for the notebook route reads "Google colab (broken)". That is unusually honest and it should be taken literally. The instructions tell you to downgrade to TensorFlow 1.15.0 and restart the runtime, then hedge that newer Colab may not need the restart. A pinned 1.15 line also means the project sits outside the TensorFlow 2 ecosystem, so anything you build around it inherits that constraint.

The second limitation is scope. Every search phrase around this project is about video or a free online tool, and the repository addresses neither. There is no video handling in the file list, no ffmpeg step, and no web front end. It processes still images. The third is the watermark type parameter: because removal is keyed to a named watermark type rather than a user-supplied mask, a mark outside the supported set has no documented path. The README also does not state accuracy numbers on any evaluation set, so the claim of indistinguishability should be read as the project's stated goal, not a benchmark you can rely on.

## How it differs from LaMa and from hosted watermark removers

The closest research alternative is LaMa (Large Mask Inpainting), which is commonly used for the same still-image hole-filling job. The difference in approach is architectural: LaMa is built around Fourier convolutions and is designed to handle large masks, and it is typically run through current PyTorch tooling. This project instead implements Contextual Attention and Gated Convolution on TensorFlow 1.15.5, a stack that predates the current PyTorch default by several years. If your environment is already PyTorch and you want an inpainting model you can fine-tune, this repository's pinned TensorFlow dependency is friction you would not have with LaMa.

Against hosted removers, the difference is not the algorithm but the deployment. A web service takes an upload and returns a file with no local setup. This project takes a Docker build, a separate checkpoint download, three volume mounts and four command-line arguments. What you get in return is that the image never leaves your machine and the whole thing is scriptable. That trade is the entire reason to pick it.

## Licence, maintenance and what upgrading costs

The README carries a licence badge reading CC BY-NC. The repository has no LICENSE file in its top-level entries, so the badge is the only licence signal available. The NC component points to non-commercial use, and the badge is not a substitute for the full text, which the repository does not include. If your use is commercial, that is a question for your own counsel, not something the README resolves. The README also asks for a citation via the Zenodo DOI if you use the project in research.

The last push was on 2026-08-14, so the repository is not abandoned, and it is not archived. The only release is v1.0.0 from 2026-06-05. Upgrading is where the cost sits: requirements.txt pins tensorflow==1.15.5 and opencv-python==4.9.0.80, and the Dockerfile pins the same TensorFlow base image. Moving to TensorFlow 2 would mean rewriting inpaint_model.py and inpaint_ops.py, and the neuralgym dependency is installed from a GitHub URL rather than a released package, so a rebuild depends on that repository staying reachable. The README does not document a migration path.

## Conclusion

Adopt it if you need a local, scriptable inpainting pass over images and you are willing to run TensorFlow 1.15.5 inside the provided Docker image; the ENTRYPOINT calls main.py directly, so the container is the supported path. Do not adopt it for video, for a no-install browser tool, or if your only runtime is a current Colab notebook, which the README labels as broken. Before you rely on it, verify three things: that you have the checkpoint directory downloaded and that checkpoint.txt was renamed to checkpoint, that your chosen --watermark_type value is one the code accepts, and whether the CC BY-NC badge reflects terms you can live with for your use.

## FAQ

### How can I remove a watermark for free with zuruoke/watermark-removal?

The project itself is open source and the README links a Google Drive folder for the model directory, so no payment is described. You still supply the compute: a Docker build plus the checkpoint download. The README does not describe any paid tier or hosted service.

### Can I use ChatGPT to remove a watermark instead of zuruoke/watermark-removal?

The repository does not mention ChatGPT anywhere, so there is no documented comparison. What it does describe is a local TensorFlow 1.15.5 inpainting model run through main.py or the Docker image. Treat the two as unrelated approaches.

### Are removing watermarks illegal?

The README does not address legality. It does carry a CC BY-NC licence badge, and it asks researchers to cite the project via its Zenodo DOI. Questions about the legality of removing a specific watermark are outside what the repository documents.

### What is the best watermark remover?

The repository makes no comparison to other tools, so it offers no basis for ranking. What it states is its own method: a machine learning inpainting task inspired by Contextual Attention and Gated Convolution, with a --watermark_type argument such as istock.

### What is ChatGPT watermark removal?

The repository does not document ChatGPT watermark removal or any related feature. Its own scope is a TensorFlow 1.15.5 inpainting model that takes an image path, an output path, a checkpoint directory and a watermark type.

## Sources

- [Issues](https://github.com/zuruoke/watermark-removal/issues)
- [README](https://github.com/zuruoke/watermark-removal/blob/master/README.md)
- [Releases](https://github.com/zuruoke/watermark-removal/releases)
- [zuruoke/watermark-removal on GitHub](https://github.com/zuruoke/watermark-removal)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/zuruoke-watermark-removal
