zuruoke/watermark-removal

不可用

Opened this issue · 2 comments

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

自己的图片用不了 用了主页的示例图片也报错不知道是什么原因
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()

If using the sample picture and the default mask.png file, this error will be reported.
Because the size of sample picture and mask.png is not equal.
image size: (682, 1024, 3)
mask image size: (683, 1024, 3)

I commented out this "assert" line from the preprocess_image.py. Then the program could run.

you should update the assert
https://github.com/zuruoke/watermark-removal/blob/fe4369278d374ecf89a4ae71d593e442ebf16128/preprocess_image.py#L42C9-L42C54
to <--- assert image.shape == preprocessed_mask_image.shape