gaolinorange / Automatic-Unpaired-Shape-Deformation-Transfer

SIGGRAPH ASIA 2018
Other
248 stars 44 forks source link

Linux support for ACAP Lib #9

Open sumukhbansal opened 4 years ago

sumukhbansal commented 4 years ago

Dear Authors, Congratulations on the beautiful work. Is there a Linux version of the ACAP code available? Regards,

MaxMayya commented 3 years ago

Looking for that too. @sumukhbansal Did you find a solution for it?

sumukhbansal commented 3 years ago

@MaxMayya No. I also tried to implement the paper, but it's hard to reproduce.

MaxMayya commented 3 years ago

@sumukhbansal thanks for the quick reply. Hope authors come with an update soon!

tommaoer commented 3 years ago

@MaxMayya @sumukhbansal Thanks for your interest. We have a Win version(x64) of the ACAP code. We will release a Linux version in a few days. Thanks for your patience.

MaxMayya commented 3 years ago

@tommaoer great news! looking forward to that release. BTW, the code that you mentioned is an implementation of ACAP or ARAP? I'm confused because of the naming (i.e. new_ARAPDeform.cpp). Thanks a lot for your responsiveness.

tommaoer commented 3 years ago

@MaxMayya The code actually is the implementation of ACAP, which is a part of our sparse deformation algorithm. The sparse deformation is based on ARAP. So we call the "ACAP" as "new_ARAP" in the early phase of the project. But I think it's not a problem, and we will fix it for easily reading.

MaxMayya commented 3 years ago

@tommaoer Thanks a lot for the clarification. This makes more sense.

tommaoer commented 3 years ago

@sumukhbansal @MaxMayya hi, it's a news that we have shared the Linux version of ACAP code! If you have further problems, please feel free to contact us.

MaxMayya commented 3 years ago

@tommaoer Many thanks for sharing the linux version! Looks neat! I've noticed that you use Gurobi which needs a license. Accepting sacrificing performance, can one run the code without Gurobi? Appreciate the effort

tommaoer commented 3 years ago

Yes, thanks to the better performance, we solve the mixed-integer optimization by Gurobi. You can use other libraries to achieve optimization. For the academic license, it's free (3 months) for academic organizations.

For our released code, you can calculate the ACAP feature without the optimization, which is the original deformation gradient.

MaxMayya commented 3 years ago

I could ask for a free trial as I'm not attached to any academic organisation but let's say I want to run the code without optimisation. Typically using ./main path-to-folder -opt 0 would use the original deformation gradient right?

I don't know if this is a related issue but after building everything (without the license grbgetkey call), calling ./main ../../test -opt 0 (or 1) ends up with the following error:

./main: error while loading shared libraries: libgurobi80.so: cannot open shared object file: No such file or directory

I checked that the libgurobi80.so is physically in the right place. So I'm not sure if this is a random issue or related to the license key. Any hints?

tommaoer commented 3 years ago

@MaxMayya If you only use the original deformation gradient, the mixed-integer optimization is unavailable. Hence, I think you can remove the GUROBI and Comiso library and its relative code. Then, re-compile the library to run it. You can try this. If you encounter some problems, you can let me know.

MaxMayya commented 3 years ago

I finally managed to replace Gurobi by CoinOR-CBC. Obviously, I wasn't waiting for bit-exact results compared to the test vector you've provided. The results are however far from _LOGRNEWGT (I've got a correct S). Anyway, when I print _LOGRNEWGT into 3x3 matrices I've noticed that it contains either zero matrices or matrices with only ones. An example for vertex 746 on mesh 2.obj is:

         0 0 1
Log(R) = 1 0 0
         1 0 0

which is not a skew-symmetric matrix as it would be expected according to equation 7 in the article. Beside, given the shape of 2.obj, it's not possible that the theta angle is always the same for all vetices. Right? Am I missing something? Can you please confirm that the test vector is generated by the provided code?

tommaoer commented 3 years ago

hi, thanks for your remind. This is an accident I uploaded two wrong files. We have uploaded the right files on the same path. Please check it. I will check if this error is caused by my code. I check the committed code, this is a code bug, I fix it now (you can see it from the commits). This is a right "}" is misplaced to another line. Thanks again!

MaxMayya commented 3 years ago

Thanks for updating the files so quickly! Now groundtruth rotation angles theta are coherent with their initial values. I tested the groundtruth theta for the vertex 1153 on 2.obj (last vertex of the cylinder) and found 18 deg. However, when I visualize 2.obj I can intuitively tell that vertex 1153 is rotated by (360-18) deg. Can you confirm?

EDIT

I forgot to investigate the sign of the axis w. Now I see that it is inverted for vertex 1153 which explains the theta value.

BTW, can you kindly provide or point me to a tool (or a way) to inverse the ACAP feature vector back to the target mesh? Thank you again

tommaoer commented 3 years ago

Sorry for the delayed reply. I check the optimized the 'logr' for the last vertex 1153.

         0       5.9691 0
Log(R) = -5.9691 0      0
         0       0      0

The optimized the direct of axis is consistent. so the rotation angle is 5.9691. In other words, the rotation angle may `2pi - 5.9691' when the direct of axis change. BTW, the provided 'LOGRNEW_GT' and 'S_GT' is without optimization, and also we have uploaded the 'GT' files with optimization. If you need it, please check it in same folder.

We also provide a complied script as follow line for reconstruct the ACAP feature back to the coordinates. https://github.com/gaolinorange/Automatic-Unpaired-Shape-Deformation-Transfer/blob/39eec6c18a744f9bf061beaaf600dd855059b14c/matlabscript/recon_from_random.m#L94

If you have some question on the above script, please feel free to contact us.

MaxMayya commented 3 years ago

I appreciate taking time to check this in details. I believe that you accidentally inverted file names in your last update (because I get identical results as _LOGRNEW_withoptGT and _S_withoptGT when I call the main with -opt 0). Thank you for the pointer on the script. Unfortunately, I don't have Matlab :(, so I cannot test the inverse of ACAP! BTW, does the inverse of ACAP depend on wether the feature vector was computed with or without optimisation?

tommaoer commented 3 years ago

Thank you for your reminder. The inverse of ACAP does not depend on the optimization, it is suitable for the feature vector that is computed with or without optimization. BTY, if you have a windows system, we can provide a complied exe for the ACAP feature reconstruction for convenience. We will provide the source code for the reconstruction of the ACAP feature because I am working on the other research. :)

MaxMayya commented 3 years ago

Unfortunately, I don't have a Windows system (otherwise I wouldn't bother you with all the linux stuff ^^). A code source for the reconstruction from ACAP is more than welcome! Thank you a lot for your availability

MaxMayya commented 3 years ago

@tommaoer back again with some news: I have sloved, for the test vector, the axis problem using coin-or Couenne solver and the angle problem using Bonmin. Without adding time limits or specifying any gaps, solvers had reached optimality after ~4.5min (30 sec for axis problem and 4 min for the angle problem). Can you share computation time values using the Gurobi optimizer? Side note: I think you accidentally inverted the names of the opt/noOpt test vectors.