From Stamped to Clean: Transforming Watermarked Images into Clear Visuals

Have you wondered how you can remove watermarks from images using Python? It’s very simple! You should know Python and have a basic knowledge of computer vision models like CNN & TensorFlow DL framework to follow architectures if you are interested…


This content originally appeared on DEV Community and was authored by Yash Jivani

Have you wondered how you can remove watermarks from images using Python? It's very simple! You should know Python and have a basic knowledge of computer vision models like CNN & TensorFlow DL framework to follow architectures if you are interested!! Please make sure that you read the copyright laws of the images you want to remove watermarks before you run the code.

Steps to follow -

  1. Create a new Google Colab notebook. Change the runtime to T4 GPU to enhance computing power to run the inference pipeline.

  2. Install Conda packages, create and activate the Conda environment
    Since Google Colab uses the latest Tensorflow & Python versions and this project uses tensorflow=1.15.0 which is supported by Python 3.6, install miniconda inside the Colab environment

# set pythonpath
%env PYTHONPATH = # /env/python

# Set up miniconda and set the path '/usr/local'
!wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh
!chmod +x Miniconda3-py38_4.12.0-Linux-x86_64.sh
!./Miniconda3-py38_4.12.0-Linux-x86_64.sh -b -f -p /usr/local

import sys
sys.path.append('/usr/local/lib/python3.8/site-packages')

# create a new conda environment using Python 3.3
!conda create -n myenv python=3.6

3.Install Packages inside Env.

%%shell
eval "$(conda shell.bash hook)"
conda activate myenv
conda install -y tensorflow==1.15 pillow opencv matplotlib pyyaml
conda install -y tensorflow-gpu

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

4.Clone Repo

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

5.Download Model Files from drive and paste them into the /watermark-removal/model directory.

6.Execute Python code to remove the watermark from your istock image. If you have Alamy, Shutterstock, or your custom watermarked images, please add mask.png inside utils/<watermark-type>/<image-type>.

%%shell
eval "$(conda shell.bash hook)"
conda activate myenv

cd watermark-removal
python main.py --image path-to-input-image --output path-to-output-image --checkpoint_dir model/ --watermark_type istock

Reference


This content originally appeared on DEV Community and was authored by Yash Jivani


Print Share Comment Cite Upload Translate Updates
APA

Yash Jivani | Sciencx (2024-08-16T14:31:01+00:00) From Stamped to Clean: Transforming Watermarked Images into Clear Visuals. Retrieved from https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/

MLA
" » From Stamped to Clean: Transforming Watermarked Images into Clear Visuals." Yash Jivani | Sciencx - Friday August 16, 2024, https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/
HARVARD
Yash Jivani | Sciencx Friday August 16, 2024 » From Stamped to Clean: Transforming Watermarked Images into Clear Visuals., viewed ,<https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/>
VANCOUVER
Yash Jivani | Sciencx - » From Stamped to Clean: Transforming Watermarked Images into Clear Visuals. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/
CHICAGO
" » From Stamped to Clean: Transforming Watermarked Images into Clear Visuals." Yash Jivani | Sciencx - Accessed . https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/
IEEE
" » From Stamped to Clean: Transforming Watermarked Images into Clear Visuals." Yash Jivani | Sciencx [Online]. Available: https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/. [Accessed: ]
rf:citation
» From Stamped to Clean: Transforming Watermarked Images into Clear Visuals | Yash Jivani | Sciencx | https://www.scien.cx/2024/08/16/from-stamped-to-clean-transforming-watermarked-images-into-clear-visuals/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.