-
Notifications
You must be signed in to change notification settings - Fork 25
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
quality of the generated images #2
Comments
I am currently still looking up the issues on why this might be. These are the some things that are different from the implementation of the paper:
If you have any suggestions, feel free to discuss them Having said that, this is an image that I just generated. I used more epochs for the optimiser at the last 2 blocks. |
notice there is difference about the deconv step between your implementation and the original code, not sure the impact but just raise a question about the deconv https://github.com/msracver/Deep-Image-Analogy/issues/30 |
here is another finding, there is a function avg_vote() used in 2 places in the official code while not appear in the pytorch code, I think it can make the image looks more smoothly, do you think so?
|
I think avg vote is done only after the last reconstruction. That I have done in the method called reconstruct avg, which you can find in patchmatchorig.py |
yes I can find reconstruct_avg(), but actually there is another method named avg_vote(), besides the method reconstruct_avg() |
Can you tell me where that is? |
Ok, It is invoked in line 520, 526, 566, 573 of this link: https://github.com/msracver/Deep-Image-Analogy/blob/linux/deep_image_analogy/source/DeepAnalogy.cu |
very well found detail! thanks a lot! So I will just reuse my reconstruct_avg() , and call it after the NNFs are computed. |
you are welcome! and it is also called before deconv happens |
I am currently implementing patchmath for GPU using pyCuda. This will increase speeds dramatically. |
I review the official code just now and it seems NO sigmoid function when blending. It seems the author just normalize |FA L−1(x)|2 to [0, 1], and compare it with 0.05. I guess it is used as a simplified version of the sigmoid function in that case. And I am expecting your GPU version of patchmatch |
gpu patchmatch using pycuda is more or less working. https://github.com/harveyslash/PatchMatch |
another finding which is likely relate to the quality issue is that, the official code contains one more layer besides conv5_1 to conv1_1, that is the input data layer , the feature match process (including deconv, blend, norm, patchmatch) is also applied to the input data layer to get the final nnf. so I guess there should be a "Process Block 0" in your implementation to solve the quality issue. |
I had tried to do that , but the quality just becomes worse |
for the GPU version of patchmatch, I use it in this project of deep image analogy, and it runs out of index when generate the image, do you know what is the problem? the error is as below: File "/home/li/Deep-Image_Analogy/src/../src/PatchMatch/PatchMatchCuda.py", line 131, in reconstruct_avg I print and check, just find the nnf is filled with big number where processing block 4: [ 8589934614 8589934615] [[ 0 3] ..., |
In reconstruction, you have to provide the dimension of the new resolution. |
the following line of code is added before sending the nnf to the patchmatch method, to fix the out of index issue listed above, acutually the patchmatch method itself is correct, but the args passed to it must be explictly ensure to be np.int32 in the python layer, thus to keep the correct memory layout in the cuda layer:
|
I believe I had done it. Maybe I did not push |
Thansk @harveyslash , with the gpu, the total time is decrease from 130s+ to 90s+ with my computer |
Did your quality improve? |
not yet improved. |
Any updates? |
Will you update it later? |
Wonderful job, I have been look for a python implementation of this project and glad to see this. but looks like the generated images are not as good as the examples in the original paper, is there any plan to improve it?
The text was updated successfully, but these errors were encountered: