zuruoke / watermark-removal

a machine learning image inpainting task that instinctively removes watermarks from image indistinguishable from the ground truth image
1.86k stars 291 forks source link

不可用 #26

Open byYufeng opened 9 months ago

byYufeng commented 9 months ago

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

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

bg1szd commented 9 months ago

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.

evin-zhang commented 6 months ago

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