sungyoonahn / Hint-based-image-colorization-using-Attention-Unet

2 stars 0 forks source link

How to test a gray image using the trained model #2

Open MrRainbowYoo opened 2 years ago

MrRainbowYoo commented 2 years ago

Thanks for your code, could you teach me how to test a gray image using the trained model? When I run the test.py, the program told me missed the directory of 'mask', I have build a folder called 'test_data/hint', what's the difference bewteen 'hint' and 'mask'? Thanks, waiting for your reply.

sungyoonahn commented 2 years ago

Hi, sorry for the late reply. So this repo is actually a "hint" based image colorization code, NOT a normal colorization code where you can color a 1D grayscale image to a 3D color image. It takes 3D hint images where hint images look like grayscale images but has some pixels with colors. The mask is a 1D salt pepper filter indicating where the hints (pixels with color) are. There was a paper published on this topic I recommend you check it out!

MrRainbowYoo commented 2 years ago

Sincere thanks! After your explanation, I have understood the difference between them.

But I still have a question, If I want to colorize a gray image, I need to get a 1D mask image and a 3D hint image from it. So how could I GET 'mask' and 'hint' images FROM the given gray image? Is there any codes or tools?

Finally, could you tell me the name of the paper you just mentioned~

sungyoonahn commented 2 years ago

if you would like to color a 1D gray image, this is NOT the repo you are looking for! creating a mask image and 3d hint image is not needed for image coloriaztion. about the paper... I forgot its name... But here are some articles on image colorization you may find helpful! https://pyimagesearch.com/2019/02/25/black-and-white-image-colorization-with-opencv-and-deep-learning/ https://colab.research.google.com/github/moein-shariatnia/Deep-Learning/blob/main/Image%20Colorization%20Tutorial/Image%20Colorization%20with%20U-Net%20and%20GAN%20Tutorial.ipynb

MrRainbowYoo commented 2 years ago

Thank you for your patience. When I run the 'test.py', what images should I put into the 'test_data/hint/' and 'test_data/mask/' folders?

sungyoonahn commented 2 years ago

As this repo is part of a challenge I cannot provide you with the hint and mask images but as I have written in my previous comments you can create your own hint and mask images. Though if you are trying image colorization I recommend you alter the code so that it doesn't use 3d inputs.