MCPcopy Index your code
hub / github.com/zuruoke/watermark-removal

github.com/zuruoke/watermark-removal @v1.0.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.0.0 ↗
29 symbols 117 edges 6 files 19 documented · 66%
README

Chimzuruoke Okafor

Watermark-Removal

Total Downloads

version pytorch license

Buy Me A Coffee

An open source project that uses a machine learning based image inpainting methodology to remove watermark from images which is totally indistinguishable from the ground truth version of the image.

This project was inspired by the Contextual Attention (CVPR 2018) and Gated Convolution (ICCV 2019 Oral).

And also a shoutout to Chu-Tak Li for his Medium article series that really gave me a deep insight into the image inpainting papers stated above

Run

Docker

  1. Clone this repository to your computer.
  2. From the repository root, build a Docker image with the command docker build -t watermark-removal .
  3. Download the model dir using this link.
  4. Create and run a docker container with the image you built using the command:
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

Google colab (broken)

  • use Google colab

  • First of all, clone this repo

    !git clone https://github.com/zuruoke/watermark-removal

  • Change Directory to the repo

    !cd watermark-removal

  • Since Google Colab uses the latest Tensorflow 2x version and this project uses 1.15.0, downgrade to Tensorflow 1.15.0 version and restart the runtime, (although the new version of Google Colab does not need you to restart the runtime).

    !pip install tensorflow==1.15.0

  • Install tensorflow toolkit neuralgym.

    !pip install git+https://github.com/JiahuiYu/neuralgym

  • Download the model dirs using this link and put it under model/ (rename checkpoint.txt to checkpoint because sometimes google drive automatically adds .txt after download)

And you're all Set!!

  • Now remove the watermark on the image by runing the main.py file

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

Citing

@article{yu2018generative,
  title={Generative Image Inpainting with Contextual Attention},
  author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S},
  journal={arXiv preprint arXiv:1801.07892},
  year={2018}
}

@article{yu2018free,
  title={Free-Form Image Inpainting with Gated Convolution},
  author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S},
  journal={arXiv preprint arXiv:1806.03589},
  year={2018}
}

<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=zuruoke/watermark-removal&type=Date" />

© Chimzuruoke Okafor

Core symbols most depended-on inside this repo

gen_conv
called by 39
inpaint_ops.py
dis_conv
called by 6
inpaint_ops.py
gen_deconv
called by 4
inpaint_ops.py
build_inpaint_net
called by 3
inpaint_model.py
build_server_graph
called by 3
inpaint_model.py
bbox2mask
called by 2
inpaint_ops.py
brush_stroke_mask
called by 2
inpaint_ops.py
contextual_attention
called by 2
inpaint_ops.py

Shape

Function 20
Method 8
Class 1

Languages

Python100%

Modules by API surface

inpaint_ops.py19 symbols
inpaint_model.py9 symbols
preprocess_image.py1 symbols

Dependencies from manifests, versioned

opencv-python4.9.0.80 · 1×
tensorflow1.15.5 · 1×

For agents

$ claude mcp add watermark-removal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact