Git Product home page Git Product logo

watermark-removal's Introduction

Waving hand animated gif Hi, I'm Chimzuruoke Okafor

A Software Engineer, AI Scientist, and Content Creator!

  • 🎗️ I just bagged my M.Sc. program in Artificial Intelligence at the University of Surrey, UK 🇬🇧. My research focuses on Self-Supervised Learning (SSL) and Large Language Models.
  • 🔭 Launched a comprehensive Data Structures and Algorithms course at Tunga Academy: Data Structures and Algorithms!.
  • 🌱 Constantly expanding my expertise in cloud technologies and backend engineering, particularly in the realm of computer networking.
  • 🤖 Passionate about staying abreast of the latest AI and tech trends, I am actively involved in cutting-edge research. I'm in the process of publishing a paper on SSL applications in the medical field for leading conferences like ICCV and CVPR.
  • 🌌 Deeply intrigued by the Metaverse, AI, Explainable AI and Human-AI Teaming, exploring how these technologies interplay and shape our digital future.
  • 👯 Looking to collaborate with other content creators and software developers to exchange knowledge and innovate.
  • 🔖 Open to working on freelance projects.
  • 🥅 2024 Goals: Contribute more to Open Source projects and delve deeper into AI research.
  • ⚡ Fun fact: I'm an avid football fan and FPL player. I developed a FPL analytics app, blending my sports passion with tech. Check it out here.
  • 🫥 Interested in discussing AI, SSL, MetaVerse or tech trends? Book a chat with me: 30-minutes meeting with Zuruoke.

🛠 I code using

Node.js Python Typescript Golang Dart Flutter Docker Terraform PostgreSQL MongoDB Tensorflow

Zuruoke's GitHub stats Top Langs

watermark-removal's People

Contributors

cnukaus avatar simdanonline avatar zuruoke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

watermark-removal's Issues

No module named 'PIL'

Traceback (most recent call last):
File "main.py", line 3, in
from PIL import Image
ModuleNotFoundError: No module named 'PIL'

ERROR: Config File doesn't exist

When running this code on Google Colab, I get the following:

WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/neuralgym/ops/layers.py:142: The name tf.image.resize_bilinear is deprecated. Please use tf.compat.v1.image.resize_bilinear instead.

WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/neuralgym/callbacks/npz_model_loader.py:31: The name tf.get_variable_scope is deprecated. Please use tf.compat.v1.get_variable_scope instead.

WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/neuralgym/ops/gan_ops.py:138: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead.

Traceback (most recent call last):
  File "watermark-removal/main.py", line 26, in <module>
    FLAGS = ng.Config('inpaint.yml')
  File "/usr/local/lib/python3.7/dist-packages/neuralgym/utils/config.py", line 82, in __init__
    assert os.path.exists(filename), "ERROR: Config File doesn't exist."
AssertionError: ERROR: Config File doesn't exist.

No module named PIL on Ubuntu 22.04

I'm facing this issue on the Ubuntu server. Where I'm trying to setup this python project. Could you please make a setup guide for Ubuntu? I can't do anything. I tried it on my mac as well. No module found cv2, PIL

image

Tensor Flow > 2.0

How do I run the code using stand alone python on my laptop?

Unable to install tensor flow 1.15 as the default is 2.0 onwards now.

How do I go about it, as neuralgym has 1.15

Trying to remove watermarks from scanned documents: Image size not supported

I'm removing watermarks from scanned documents and don't have control over the image size, and I'm getting this error:

image size: (2287, 1394, 3)
mask image size: (683, 1024, 3)
Image size not supported!!!

all of my docments are different sizes.

Is there a way to change this? I didn't see anything in the docs about size limitations.

tensorflow.python.framework.errors_impl.OutOfRangeError: Read less bytes than requested

Traceback (most recent call last):
File "main.py", line 51, in
args.checkpoint_dir, from_name)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/contrib/framework/python/framework/checkpoint_utils.py", line 81, in load_variable
return reader.get_tensor(name)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 915, in get_tensor
return CheckpointReader_GetTensor(self, compat.as_bytes(tensor_str))
tensorflow.python.framework.errors_impl.OutOfRangeError: Read less bytes than requested

such a rubbish project

can't running at all due to verious compatible issue.
why are you make this rubbish project.. waste my time...

Are the pretrained models specific to the istock mask?

A lot of issues have been created asking for how to create a custom mask, and I've ran into the same problem.

I created a custom mask (png, black background, with just the watermark transparent) and put it into the correct directory. The script runs without issues, but the output image is exactly the same as the input image, just with some parameters changed (like it went from being 48-bit color to 24-bit color) so it's clear that something is being done. Just not the thing I'd like it to do.

So are the models provided through the google drive link just specific to the istock mask? And if so, how can we train them ourselves? Or should the models be universal?

Where is the mask?

Hi,
The script is failing in line 31 of the main.py
Traceback (most recent call last):
File "main.py", line 31, in
assert image.shape == mask.shape
AttributeError: 'NoneType' object has no attribute 'shape'

Looks like there is no folder file "mask.png" in the github repo?

Missing potrait/mask.png

Hi zuruoke,

That's a great tool you are putting out there. I have run the command all the commands, your package seems to detect that I want to clean up a portrait and is looking for "utils/portrait/mask.png", but the "portrait" folder does not even exist.

Here is the error message:

image size: (1730, 1155, 3)
Traceback (most recent call last):
  File "main.py", line 32, in <module>
    input_image = preprocess_image(image, args.watermark_type)
  File "/content/watermark-removal/preprocess_image.py", line 25, in preprocess_image
    "utils/{}/{}/mask.png".format(watermark_type, image_type))
  File "/usr/local/lib/python3.7/dist-packages/PIL/Image.py", line 2843, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'utils/istock/potrait/mask.png'

Should I run some code to generate the mask?

Only able to remove watermark from istock????

As the argument "--watermark_type istock" indicates, this project could only remove watermark of istock image???
is so, what's the value of this project???
and is it necessary to make a such complex solution to remove the watermark of istock???

pip install tensorflow==1.15.0 in colab ERROR

ERROR: Could not find a version that satisfies the requirement tensorflow==1.15.0 (from versions: 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.11.1, 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0)
ERROR: No matching distribution found for tensorflow==1.15.0

ValueError: Couldn't find 'checkpoint' file or checkpoints in given directory model/

Hello, hope you are doing well.

Im getting this issue even when i have the "checkpoint" file in the model/ folder. No it does not have the .txt on it, and i tried moving the model/ folder around. Here is my folder structure:

watermar-removal/
│ .gitignore
│ batch_test.py
│ guided_batch_test.py
│ image.png
│ inpaint.yml
│ inpaint_model.py
│ inpaint_ops.py
│ main.py
│ preprocess_image.py
│ README.md

├───model
│ checkpoint
│ txt.text

├───utils
│ └───istock
│ ├───landscape
│ │ mask.png
│ │
│ └───potrait
│ mask.png

└───__pycache__

I made the portrait version in photoshop, you can see it here if you want
" https://we.tl/t-VyVXJeQFRf "

Using python 3.7.0 and pip version 23.1.2, in a virtual env i installed all the required packages. I had to change one of the lines for the code to work, its this line in preprocess_image.py " assert image.shape == preprocessed_mask_image**.shape** "
Please write if you need more info.

Have a great rest of your day.

不可用

所以只能识别指定格式的水印?

自己的图片用不了 用了主页的示例图片也报错不知道是什么原因
Traceback (most recent call last):
File "main.py", line 32, in
input_image = preprocess_image(image, args.watermark_type)
File "/Users/fgg/code/projects/watermark-removal/preprocess_image.py", line 42, in preprocess_image
assert image.shape == preprocessed_mask_image
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

AttributeError: module 'tensorflow' has no attribute 'contrib'

I have installed tenserflow 2.11 with python 3.10

then when i run the code

!  python main.py --image pic1.jpeg --output res2.jpg --checkpoint_dir model/ --watermark_type istock

the following error will show

2022-12-01 17:24:41.275524: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-12-01 17:24:41.413694: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/cv2/../../lib64:
2022-12-01 17:24:41.413720: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2022-12-01 17:24:42.047465: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/cv2/../../lib64:
2022-12-01 17:24:42.047536: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/cv2/../../lib64:
2022-12-01 17:24:42.047547: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
  File "/home/user/fun/python/watermark-removal/main.py", line 8, in <module>
    import neuralgym as ng
  File "/home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/neuralgym/__init__.py", line 27, in <module>
    from . import callbacks
  File "/home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/neuralgym/callbacks/__init__.py", line 3, in <module>
    from .hyper_param_scheduler import HyperParamScheduler
  File "/home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/neuralgym/callbacks/hyper_param_scheduler.py", line 6, in <module>
    from ..ops.summary_ops import scalar_summary
  File "/home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/neuralgym/ops/__init__.py", line 4, in <module>
    from . import layers
  File "/home/user/fun/python/watermark-removal/venv/lib/python3.10/site-packages/neuralgym/ops/layers.py", line 93, in <module>
    activation_fn=None, w_init=tf.contrib.layers.xavier_initializer_conv2d(),
AttributeError: module 'tensorflow' has no attribute 'contrib'

How can i fix this problem?

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/PIL/Image.py", line 2847, in open fp.seek(0) AttributeError: 'str' object has no attribute 'seek'

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/PIL/Image.py", line 2847, in open
fp.seek(0)
AttributeError: 'str' object has no attribute 'seek'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 31, in
image = Image.open(args.image)
File "/usr/local/lib/python3.7/dist-packages/PIL/Image.py", line 2849, in open
fp = io.BytesIO(fp.read())
AttributeError: 'str' object has no attribute 'read'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.