llorz / SGA19_zoomOut

code for the paper "ZoomOut: Spectral Upsampling for Efficient Shape Correspondence"
https://arxiv.org/abs/1904.07865
43 stars 9 forks source link

Running results #1

Closed jayis520 closed 4 years ago

jayis520 commented 4 years ago

Hi, I ran the code and got the following results, which are not the same as those in your paper. image Best regards.

llorz commented 4 years ago

Hi,

Thanks for reaching out!

I just ran the code from myside (on mac and a windows machine), and I got the same results as follows:

test

It seems the problem comes from the initialization: we got very different initial map (fMap size: 4).

From your figure, we can see that the head of the cat is mapped to the tail of the wolf. In this case, I would guess, the LB solver in your machine have the opposite signs to my version.

Can you please check the Fig.1 that you got? Fig.1 visualizes the Laplace-Beltrami basis on both shapes. (The following figure is what I got in Fig. 1). My guess is that, in your machine, the Fig.1 you got, in the second column, you got different results from mine (e.g., the head of the cat is highlighted in yellow and the tail of the wolf is in yellow, or the other way around). In this case, line 27 (the identity initialization) is not feasible. Instead, you probably should try C12_ini = diag([1, -1, 1, 1]).

LB

(Sorry for the super long explanation......)

In a short summary, can you please compare your Fig.1. to mine as above to see if they are the same? If not, then please set C12_ini = diag([1, -1, 1, 1]) and see if this fix your problem or not.

Please let me know if this does not help. In this case, can you please also tell me about 1) you machine and Matlab version 2) attach your Fig.1 as well

Thanks :)

Hope this helps and thanks again for reaching out :)

Best regards, Jing

jayis520 commented 4 years ago

Hi @llorz the Fig.1 that I got is image The mapping between cats and wolves is really the opposite.I try C12_ini = diag([1, -1, 1, 1]),and I got the same results as follows: image My machine is Asus notebook,which cpu is i7.Matlab version is r2016b. Best regards.

llorz commented 4 years ago

Hi,

Thanks!

What this initialization C12_ini doing is trying to aligning the first 4 LB basis to get some approximate initial map to start with.

I.e., if LBx of the cat aligns with LBx of the wolf (x is the basis id), then the x-th diagonal value should be set to 1, otherwise it should be set to -1 (which means they are opposite to each other).

In your case, we can see that LB2,3,4 of the cat are all opposite to the corresponding LB2, 3, 4 of the wolf. (if you compare yours with mine). In this case, C12_ini should be set to [1, -1, -1, -1].

Please let me now if this initialization fix the problem or not.

Sorry for the confusion of the initialization, but this is the easiest way (we thought) to get some quick and reasonable initial map without any optimization.

Best regards, Jing

jayis520 commented 4 years ago

Hi, @llorz Thank you for your reply! I see what you mean.In this way, the problem can be solved. Best regards.

rFalque commented 3 years ago

Hi @llorz ,

I have tried to compute the initial map [4 by 4] from 3D descriptors and the outcome is not great. I need to automate it somehow so setting the initial map by hand is not ideal.

Using BCICP gives a good initialization but it is a bit too slow.

Do you have any recommendations? Maybe using a very strict mask (e.g., the slanted mask from the other repo)?

If you want to check what I tried, you can see my forked repo there: https://github.com/rFalque/SGA19_zoomOut/blob/master/test.m

Best regards, Raphael

llorz commented 3 years ago

Hi Raphael,

Thanks for reaching out :)

As for your question, a quick fix would be - trying to compute a larger functional map for initialization such as para.fmap_size = [20,20], instead a 4-by-4 one. You can find the following results:

image

The reason that computing a 4-by-4 fmap using the standard pipeline does not work so well is that the first four eigenfunctions are very global and the energies (also some operators represented only use 4 eigenfunctions would not be very informative) based on the first four eigenfunctions are not discriminative enough. It's better to try a larger functional map with more local details. But of course, the fmap size cannot be too large for two reasons, (1) we then have k^2 number of variables, larger search space, much more local minima (2) the high frequencies of two non-isometric shapes do not align with each other well, then the very basic assumption of the fmap framework does not work then. In general, I usually try to solve for a fmap with size from 20 to 50.

Btw, as you mentioned, that BCICP is very slow indeed but it can be much faster if you pre-process the shape and cache the pairwise geodesic distance in S.Gamma (otherwise, it will be computed several times). But of course, this only works for shapes with less than 20k vertices.

Hope this helps!

Best regards, Jing

llorz commented 3 years ago

Hi @llorz ,

I have tried to compute the initial map [4 by 4] from 3D descriptors and the outcome is not great. I need to automate it somehow so setting the initial map by hand is not ideal.

Using BCICP gives a good initialization but it is a bit too slow.

Do you have any recommendations? Maybe using a very strict mask (e.g., the slanted mask from the other repo)?

If you want to check what I tried, you can see my forked repo there: https://github.com/rFalque/SGA19_zoomOut/blob/master/test.m

Best regards, Raphael

Hi @rFalque ,

Really sorry! I just realized that I sent you the wrong figure (the explanation above is correct though). The figure that showed above is still from diagonal 4-by-4 fmap.

Please see the correct image here: image

The corresponding code is as follows, not that the descriptors are computed using 100 eigenfunctions and a 20-by-20 fmap is computed. Another slight difference from your version is that, instead set C21 = C12^T , I computed C21 directly since the shape pair is far from isometry, the adjoint/transpose fmap might not be a good function map from the other direction.

numTimes = 100;

fct1 = fMAP.waveKernelSignature(S1.evecs, S1.evals, S1.A, numTimes);
fct2 = fMAP.waveKernelSignature(S2.evecs, S2.evals, S2.A, numTimes);

fct1 = fct1(:,1:5:end);
fct2 = fct2(:,1:5:end);

para.type_orient = 'direct';
para.a = 2e-1; para.b = 1e-2;
para.c = 8e-4; para.d = 1e-1;
para.fMap_size = [20, 20];

C21 = fMAP.compute_fMap_from_descriptors(S2, S1, fct2, fct1, para);

T12_ini = fMAP.fMap2pMap(S2.evecs,S1.evecs,C21);

% apply zoomOut
para.k_init = 4;
para.k_step = 1;
para.k_final = 50;
para.sink_iter = 10;
para.num_samples = 500;

tic
T12_v1 = zoomOut_refine_fast(S1, S2, T12_ini, para,1);
t = toc;
fprintf('ZoomOut with sampling runtime: %.2f sec\n',t)

Hope this helps. Sorry for the confusion.

Best regards, Jing

rFalque commented 3 years ago

Hi @llorz (sorry I took forever to reply!), I recently got back to it and indeed using a larger (but not too large) number of eigenfunctions works well. I used 20 and the results provide a really good initialization.

It also matches what Huang et al are doing in Consistent ZoomOut. Thanks for taking the time to reply :)

Edit: I just realised you were one of the authors for Consistent ZoomOut ... (nice work ;) )