marcbelmont / cnn-watermark-removal

Fully convolutional deep neural network to remove transparent overlays from images
1.24k stars 228 forks source link

how should I create corresponding selection pngs based on my own images? #22

Closed muyue1238 closed 5 years ago

muyue1238 commented 5 years ago

Hi, I ran a problem when trying to test your pre-trained model on my own image, and I'm a little confused by the cat-selection.png. I know that the model can work well when corresponding selection.png is provided. But I noticed that cat.png and cat-selection.png have completely different sizes. How does the model know the corresponding relationship between two images. I tried to change the size of cat-selection.png and the outcome did become worse, so I'm pretty sure that there's something I didn't notice. Can anyone answer my question?

marcbelmont commented 5 years ago

https://github.com/marcbelmont/cnn-watermark-removal/blob/master/dataset.py#L47 is what you are looking for. The image and the selection are cropped and resized using tf.image.resize_image_with_crop_or_pad before being fed to the network for inference. Not super intuitive. Do you have a pull request to make this cleaner?

Edwardmark commented 5 years ago

@marcbelmont so how to create the selection.png?

Edwardmark commented 5 years ago

@muyue1238 could you tell me how to create the selection.png?

kmrabhay commented 5 years ago

I have different sets of image with different text water mark. Could you please tell how to create the selection?