explaingit

zuruoke/watermark-removal

4,539PythonAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A Python tool that uses machine learning to remove watermarks from images by filling in the watermarked area so it looks like the original, running on a pre-trained model via Docker or a Python script.

Mindmap

mindmap
  root((repo))
    What it does
      Watermark removal
      Image inpainting
      Pre-trained model
    How it works
      Contextual attention
      Gated convolution
      TensorFlow 1.15
    Run Options
      Docker container
      Python script
      Google Colab
    Limitations
      Non-commercial only
      iStock watermarks
      TF 1.15 required
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Remove iStock-style semi-transparent watermarks from images automatically using the pre-trained inpainting model

USE CASE 2

Run watermark removal inside a Docker container to avoid manually configuring TensorFlow 1.15 dependencies

USE CASE 3

Process images through the inpainting model to reconstruct what the original unwatermarked image would have looked like

USE CASE 4

Experiment with gated convolution inpainting techniques by running and modifying the pre-trained model on custom inputs

Tech stack

PythonTensorFlowDocker

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires TensorFlow 1.15 (an older version) and a separate pre-trained model download from Google Drive, Docker is the easiest path.

Free to use and share for personal or research purposes, but commercial use is not permitted.

In plain English

This project is a Python-based tool that removes watermarks from images using machine learning. The goal is to produce a clean version of an image that looks as though the watermark was never there, as close as possible to what the original unwatermarked image would have looked like. The technique at work is called image inpainting, which means filling in missing or unwanted parts of an image in a visually plausible way. Rather than simply blending nearby pixels, the model draws on patterns it learned during training to reconstruct what should be underneath the watermark. The project was built on ideas from two academic papers: one from a 2018 computer vision conference focused on using contextual attention during inpainting, and another from a 2019 conference that introduced gated convolution as a way to better handle irregular regions in images. The tool is implemented using TensorFlow 1.15 and requires a pre-trained model that the user downloads separately from Google Drive. It can be run two ways: through Docker, where you build a container image and run the tool against an input image, specifying paths for the model, the input, and the output, or through a Python script directly. A Google Colab notebook path is also mentioned in the README, though it is noted as currently broken. The watermark type must be specified when running the tool. The examples shown in the repository use iStock-style watermarks, which are a well-known type of semi-transparent overlay used to protect stock photography. The license is Creative Commons Attribution-NonCommercial, meaning it can be used and shared freely but not for commercial purposes. The project is a personal open-source work by Chimzuruoke Okafor.

Copy-paste prompts

Prompt 1
Guide me through setting up the zuruoke watermark-removal project with Docker: how do I build the container, download the pre-trained model from Google Drive, and run it on a test image?
Prompt 2
I have a folder of images with iStock watermarks. Write a Python script that loops through the folder, runs each image through the watermark-removal model, and saves the cleaned versions.
Prompt 3
The watermark-removal model is not producing clean results on my images. What image preprocessing steps can I apply before running inpainting to improve the output quality?
Prompt 4
Help me adapt the watermark-removal codebase to remove a logo watermark in a fixed corner position by generating an automatic mask for that region before running the model.
Open on GitHub → Explain another repo

← zuruoke on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.