omrysendik / DCor

Deep Correlations for Texture Synthesis
BSD 3-Clause "New" or "Revised" License
18 stars 10 forks source link

How can I upscale the output image size ? #2

Closed attitudt closed 6 years ago

attitudt commented 6 years ago

Hello , I just try this code in matlab , the result is awesome and I also want to output different scale , when I changed the params.USFac from "1" to "2" , it said " If the output image size is larger than the input (params.USFac=2.000000), the Diversity loss shouldnt be used (params.DiversityLossWeight=-0.000001) "

Then I change the params.DiversityLossWeight in GetSynthParams.m from "-11E-6" to "0", it Appear error "Cell contents reference from a non-cell array object. Error in CombineGrads (line 19) grads{k} = grads{k}+params.DiversityLossWeightsingle(DiversityGrads{auxInd}); Error in CalcErrorLoss (line 30) Grads = CombineGrads(StyleGrads,ACorrGrads,DiversityGrads,SmoothnessGrads,params); ..."

Can you tell me how to change the output size just like the paper Results ? Thank you.

omrysendik commented 6 years ago

Hi,

I believe you're using it correctly. Only that the US factor can't be 2. It must be <2 (the mathematical limit is <2). Please start by trying 1.2 or 1.5 and let me know if that works. I must emphasize that this is the exact code I used for producing the results in the paper so this should work for you.

It's important that you set the diversity loss to 0 if you synthesize large outputs using the correlation matrix trick because this loss isn't defined in such cases.

attitudt commented 6 years ago

First, I change the US factor to 1.2 and 1.5 , it appear the same error again, " Cell contents reference from a non-cell array object. Error in CombineGrads (line 19) grads{k} = grads{k}+params.DiversityLossWeightsingle(DiversityGrads{auxInd}); ... " Then I comment out "grads{k} = grads{k}+params.DiversityLossWeightsingle(DiversityGrads{auxInd});" in CombineGrads.m (line 19) , and it works!

omrysendik commented 6 years ago

I understand the bug and fixed it. Please retry with the new version of CombineGrads.m

Thanks!!!