Manifolds.jl icon indicating copy to clipboard operation
Manifolds.jl copied to clipboard

Kendall Shape Space

Open jakubMitura14 opened this issue 2 years ago • 5 comments

Hello I have a lot of small shapes that I need to compare and I need invariance to scale and rotation, I consider comparing them in Kendall shape space like for example in [1] and [2] Can it be done in Julia? are there any metrics describing shape similarity implemented?

[1] https://github.com/geomstats/geomstats/blob/dafcbed9e4148733cdc63ae8ff1ce93fc660e09c/geomstats/geometry/pre_shape.py [2] https://geomstats.github.io/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.html

Thanks!

jakubMitura14 avatar Jul 20 '22 18:07 jakubMitura14

Sure, in general this can be implemented.

But for now these are not yet implemented, since we are only here main developers (compared to for example geomstats whose paper lists 20). If you would like to try we can surely help, but at the moment I personally do not have the time to implement that for you.

kellertuer avatar Jul 20 '22 19:07 kellertuer

Ok, I understand , I will surely try and get back to you when having problems, so just to start which Manifold class should I inherit AbstractManifold, or some of its subclass?

Thanks !

jakubMitura14 avatar Jul 20 '22 19:07 jakubMitura14

Ok, I understand , I will surely try and get back to you when having problems, so just to start which Manifold class should I inherit AbstractManifold, or some of its subclass?

Thanks !

Cool that you want to start that! Just AbstractManifold should be the right struct to start, we have a few tricks here and there with AbstractDecoratorManifold but that makes a few things just easier later on :)

Familiarize yourself with https://juliamanifolds.github.io/ManifoldsBase.jl/stable/types.html and maybe https://juliamanifolds.github.io/ManifoldsBase.jl/stable/functions.html

In short the Manifold itself should store things it should “know” by itself. And starting with a subtype of AbstractManifold is then the best start, other subtypes we can use later to make everything nicer, faster, or something (we will see along the way).

For points on the manifold and tangent vectors, there is also super types, but if you can represent that just as a matrix you can also leave these types out and just use arrays.

Feel free to ask if you have further questions.

kellertuer avatar Jul 20 '22 19:07 kellertuer

Cool! I've worked with Kendall's shape spaces long time ago (before I've started working on Manifolds.jl) so I can definitely help here.

In my experience it's easiest to implement a new manifold starting from an existing one, for example you can take Sphere.jl file and do something similar, just replacing Sphere with your new manifold name. Alternatively GrassmannProjector.jl is a quotient manifold so it shows that you can have things like a horizontal_lift.

In comparison to geomstats, I think Manifolds.jl look quite good -- our performance is often better, we have most of their operations supported + optimization using Manopt.jl. Geomstats has tangent PCA in its examples but it's also easily doable, you can do geodesic regression: https://manoptjl.org/stable/tutorials/GeodesicRegression/ and, for example, I'm currently finishing exact principal geodesic in Manifolds.jl.

mateuszbaran avatar Jul 20 '22 20:07 mateuszbaran

Fantastic! Ok so I know how to start thanks !

jakubMitura14 avatar Jul 21 '22 05:07 jakubMitura14

Good news, I've started working on this: #550 :slightly_smiling_face:

mateuszbaran avatar Nov 07 '22 19:11 mateuszbaran

Oh fantastic! Because I was unable to make any progress

jakubMitura14 avatar Nov 07 '22 19:11 jakubMitura14

The PR is now merged and there is a tutorial how to use it: https://github.com/JuliaManifolds/Manifolds.jl/blob/master/tutorials/hand-gestures.jl . Let me know if you need more help.

mateuszbaran avatar Nov 14 '22 11:11 mateuszbaran

It is absolutely fantastic If I will meet you in any conference you have a bottle of alcohol from me !

jakubMitura14 avatar Nov 14 '22 13:11 jakubMitura14

Until then cite us when you use our software and let us know if we can help somewhere with that manifold further :)

kellertuer avatar Nov 14 '22 13:11 kellertuer

of course :), for now I suspended the project for various reasons but I can't wait to get back to it :)

jakubMitura14 avatar Nov 14 '22 13:11 jakubMitura14