Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why resize input image to 320x320 #17

Open
xiranwang opened this issue Dec 14, 2017 · 4 comments
Open

why resize input image to 320x320 #17

xiranwang opened this issue Dec 14, 2017 · 4 comments

Comments

@xiranwang
Copy link

xiranwang commented Dec 14, 2017

Based on the paper, I think you want to crop the entire image into 320x320 patches and then feed those with uncertain pixels into the neural network, but your code seems to just resize the entire input image into a single 320x320 image and feed into the neural network. This is totally different from what is done by the paper, which might explain why your results differ from theirs.

@Joker316701882
Copy link
Owner

Thank you for your suggestion! But I remember that crop has been down in this code, see funtion 'prreprocessing_single' in matting.py.

@xiranwang
Copy link
Author

xiranwang commented Dec 14, 2017

For line 25 and 26 in test.py, are you resizing the input images into size of 320x320 then feeding them into the neural network to predict the alpha matte?
You probably cropped training images into patches for training, but for testing you are supposed to do the same by cropping test images into patches and feeding them to the neural network. But if I'm understanding your code correctly, you just resize the whole image into a patch and feed it into the neural network. Instead, you should crop the test image into patches then feed each of them into neural network one by one then put the resultant alpha matte patches back into a complete alpha matte for the entire image.

My thinking is that if the neural network is trained to find alpha matte for a patch of a image, then you are supposed to use it to find the alpha matte of a patch only.

@Joker316701882
Copy link
Owner

@xiranwang
Sorry for late reply! Yeah, you are absolutely right about this: )

@xiranwang
Copy link
Author

Looking forward to your update :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants