Liecasadi - liecasadi implements Lie groups operation written in CasADi

Overview

liecasadi

liecasadi implements Lie groups operation written in CasADi, mainly directed to optimization problem formulation.

Inspired by A micro Lie theory for state estimation in robotics and the library Manif.

Install

pip install "liecasadi @ git+https://github.com/ami-iit/lie-casadi.git"

Implemented Groups

Group Description
SO3 3D Rotations
SE3 3D Rigid Transform

Example

from liecasadi import SE3, SO3, SE3Tangent, SO3Tangent

# Random quaternion + normalization
quat = (np.random.rand(4) - 0.5) * 5
quat = quat / np.linalg.norm(quat)
# Random vector
vector3d = (np.random.rand(3) - 0.5) * 2 * np.pi

# Create SO3 object
rotation = SO3(quat)

# Create Identity
identity = SO3.Identity()

# Create SO3Tangent object
tangent = SO3Tangent(vector3d)

# Random translation vector
pos = (np.random.rand(3) - 0.5) * 5

# Create SE3 object
transform = SE3(pos=pos, xyzw=quat)

# Random vector
vector6d = (np.random.rand(3) - 0.5) * 5

# Create SE3Tangent object
tangent = SO3Tangent(vector6d)
You might also like...
Accelerated SMPL operation, commonly used in generate 3D human mesh, STAR included.

SMPL2 An enchanced and accelerated SMPL operation which commonly used in 3D human mesh generation. It takes a poses, shapes, cam_trans as inputs, outp

A python-image-classification web application project, written in Python and served through the Flask Microframework. This Project implements the VGG16 covolutional neural network, through Keras and Tensorflow wrappers, to make predictions on uploaded images. git《Tangent Space Backpropogation for 3D Transformation Groups》(CVPR 2021) GitHub:1]
git《Tangent Space Backpropogation for 3D Transformation Groups》(CVPR 2021) GitHub:1]

LieTorch: Tangent Space Backpropagation Introduction The LieTorch library generalizes PyTorch to 3D transformation groups. Just as torch.Tensor is a m

Nicely is a real-time Feedback and Intervention Program Depression is a prevalent issue across all age groups, socioeconomic classes, and cultural identities.
Nicely is a real-time Feedback and Intervention Program Depression is a prevalent issue across all age groups, socioeconomic classes, and cultural identities.

Nicely is a real-time Feedback and Intervention Program Depression is a prevalent issue across all age groups, socioeconomic classes, and cultural identities.

Model search is a framework that implements AutoML algorithms for model architecture search at scale
Model search is a framework that implements AutoML algorithms for model architecture search at scale

Model search (MS) is a framework that implements AutoML algorithms for model architecture search at scale. It aims to help researchers speed up their exploration process for finding the right model architecture for their classification problems (i.e., DNNs with different types of layers).

Implements Gradient Centralization and allows it to use as a Python package in TensorFlow
Implements Gradient Centralization and allows it to use as a Python package in TensorFlow

Gradient Centralization TensorFlow This Python package implements Gradient Centralization in TensorFlow, a simple and effective optimization technique

Implements MLP-Mixer: An all-MLP Architecture for Vision.
Implements MLP-Mixer: An all-MLP Architecture for Vision.

MLP-Mixer-CIFAR10 This repository implements MLP-Mixer as proposed in MLP-Mixer: An all-MLP Architecture for Vision. The paper introduces an all MLP (

QueryFuzz implements a metamorphic testing approach to test Datalog engines.
QueryFuzz implements a metamorphic testing approach to test Datalog engines.

Datalog is a popular query language with applications in several domains. Like any complex piece of software, Datalog engines may contain bugs. The mo

This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of Coordinate Independent Convolutional Networks.
This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of Coordinate Independent Convolutional Networks.

Orientation independent Möbius CNNs This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of

Comments
  • Problems running the example

    Problems running the example

    I tried installing the library as documented in the README and running the example.

    By installing the example as documented in the README:

    (castest) [email protected]:~$ pip install "liecasadi @ git+https://github.com/ami-iit/lie-casadi.git"
    Collecting liecasadi@ git+https://github.com/ami-iit/lie-casadi.git
      Cloning https://github.com/ami-iit/lie-casadi.git to /tmp/pip-install-jld36pa2/liecasadi_02974e872e9a41da95da2ba742a2bb6a
      Running command git clone --filter=blob:none --quiet https://github.com/ami-iit/lie-casadi.git /tmp/pip-install-jld36pa2/liecasadi_02974e872e9a41da95da2ba742a2bb6a
      Resolved https://github.com/ami-iit/lie-casadi.git to commit 4f538f354781243e600ce771c9236a43df83745d
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting numpy>=1.20
      Using cached numpy-1.22.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
    Collecting casadi
      Using cached casadi-3.5.5-cp38-none-manylinux1_x86_64.whl (34.2 MB)
    Building wheels for collected packages: liecasadi
      Building wheel for liecasadi (pyproject.toml) ... done
      Created wheel for liecasadi: filename=liecasadi-0.1.dev39-py3-none-any.whl size=7882 sha256=078ab323d4479d39e5aa0a577a6150df54d9224d416b94c89d26adc5db0616be
      Stored in directory: /tmp/pip-ephem-wheel-cache-v0j9nv_a/wheels/7a/26/6a/62ad9ab4f348e178408f7d79d44555ed51514496949fcdb644
    Successfully built liecasadi
    Installing collected packages: casadi, numpy, liecasadi
    Successfully installed casadi-3.5.5 liecasadi-0.1.dev39 numpy-1.22.1
    

    You can see that casadi got installed via pip.

    Then, I tried to run the example and the example fails with:

    (castest) [email protected]:~/liecasadi/examples$ python manifold_optimization.py
    Traceback (most recent call last):
      File "manifold_optimization.py", line 4, in <module>
        import matplotlib.pyplot as plt
    ModuleNotFoundError: No module named 'matplotlib'
    

    This is due to matplotlib missing, and it make sense that this is not part of the dependencies of the library. If I then install matplot lib, then the example fails with:

    (castest) [email protected]:~/liecasadi/examples$ python manifold_optimization.py
    Traceback (most recent call last):
      File "manifold_optimization.py", line 9, in <module>
        from liecasadi import SO3, SO3Tangent
      File "/home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages/liecasadi/__init__.py", line 3, in <module>
        from .so3 import SO3, SO3Tangent
      File "/home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages/liecasadi/so3.py", line 9, in <module>
        from attr import field
    ModuleNotFoundError: No module named 'attr'
    

    This is a bit more tricky, as it requires to install the attrs package (note the final s, as the attr package will not work).

    After installing also attr, I get this error:

    (castest) [email protected]:~/liecasadi/examples$ python manifold_optimization.py
    Traceback (most recent call last):
      File "manifold_optimization.py", line 21, in <module>
        opti.subject_to(quat[k + 1] == (vector_SO3 + rotation_SO3).as_quat())
      File "/home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages/casadi/casadi.py", line 28146, in subject_to
        ret = self._subject_to(*args)
      File "/home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages/casadi/casadi.py", line 27470, in _subject_to
        return _casadi.Opti__subject_to(self, *args)
    RuntimeError: Error in Opti::subject_to [OptiNode] at .../casadi/core/optistack.cpp:96:
    .../casadi/core/optistack_internal.cpp:905: Assertion "!g.is_constant()" failed:
    You passed a constant to `subject_to`. You need a symbol to form a constraint.
    

    Furthermore, even if I did not reached this point, I noticed that the example refers ma27 (https://github.com/ami-iit/liecasadi/blob/c79d29e87d6d654e78d258a10bac9b2bbae35773/examples/manifold_optimization.py#L47), but by following the instruction of the repo casadi gets installed by pip, and I do not think that that version of casadi has hsl support enabled.

    Environments in which I run the tests:

    (castest) [email protected]:~/liecasadi/examples$ mamba list
    # packages in environment at /home/traversaro/mambaforge/envs/castest:
    #
    # Name                    Version                   Build  Channel
    _libgcc_mutex             0.1                 conda_forge    conda-forge
    _openmp_mutex             4.5                       1_gnu    conda-forge
    attrs                     21.4.0                   pypi_0    pypi
    ca-certificates           2021.10.8            ha878542_0    conda-forge
    casadi                    3.5.5                    pypi_0    pypi
    cycler                    0.11.0                   pypi_0    pypi
    fonttools                 4.29.1                   pypi_0    pypi
    kiwisolver                1.3.2                    pypi_0    pypi
    ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
    libffi                    3.4.2                h7f98852_5    conda-forge
    libgcc-ng                 11.2.0              h1d223b6_12    conda-forge
    libgomp                   11.2.0              h1d223b6_12    conda-forge
    libnsl                    2.0.0                h7f98852_0    conda-forge
    libstdcxx-ng              11.2.0              he4da1e4_12    conda-forge
    libzlib                   1.2.11            h36c2ea0_1013    conda-forge
    liecasadi                 0.1.dev39                pypi_0    pypi
    matplotlib                3.5.1                    pypi_0    pypi
    ncurses                   6.3                  h9c3ff4c_0    conda-forge
    numpy                     1.22.1                   pypi_0    pypi
    openssl                   3.0.0                h7f98852_2    conda-forge
    packaging                 21.3                     pypi_0    pypi
    pillow                    9.0.0                    pypi_0    pypi
    pip                       22.0.2             pyhd8ed1ab_0    conda-forge
    pyparsing                 3.0.7                    pypi_0    pypi
    python                    3.8.12          h0744224_3_cpython    conda-forge
    python-dateutil           2.8.2                    pypi_0    pypi
    python_abi                3.8                      2_cp38    conda-forge
    readline                  8.1                  h46c0cb4_0    conda-forge
    setuptools                60.6.0           py38h578d9bd_0    conda-forge
    six                       1.16.0                   pypi_0    pypi
    sqlite                    3.37.0               h9cd32fc_0    conda-forge
    tk                        8.6.11               h27826a3_1    conda-forge
    wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
    xz                        5.2.5                h516909a_1    conda-forge
    zlib                      1.2.11            h36c2ea0_1013    conda-forge
    (castest) [email protected]:~/liecasadi/examples$ pip list --verbose
    Package         Version   Location                                                             Installer
    --------------- --------- -------------------------------------------------------------------- ---------
    attrs           21.4.0    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    casadi          3.5.5     /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    cycler          0.11.0    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    fonttools       4.29.1    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    kiwisolver      1.3.2     /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    liecasadi       0.1.dev39 /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    matplotlib      3.5.1     /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    numpy           1.22.1    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    packaging       21.3      /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    Pillow          9.0.0     /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    pip             22.0.2    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages
    pyparsing       3.0.7     /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    python-dateutil 2.8.2     /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    setuptools      60.6.0    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages
    six             1.16.0    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages pip
    wheel           0.37.1    /home/traversaro/mambaforge/envs/castest/lib/python3.8/site-packages
    
    opened by traversaro 6
  • Fix manifpy test dependency

    Fix manifpy test dependency

    In order to check the correctness of the computations, I wrote some tests against Manif.

    It seems manifpy cannot be installed via PyPI. However, they provide installation instruction in https://github.com/artivis/manif/blob/devel/docs/pages/python/Quick-start.md.

    Although I can install the library using conda on my system, I'm not able to move the same logic in a workflow. manifpy seems to be installed but it is not found:

    ModuleNotFoundError: No module named 'manifpy'
    

    Am I doing something wrong?

    @traversaro @GiulioRomualdi do you have any suggestions?

    opened by Giulero 4
  • Remove `R_from_rpy(rpy)` method

    Remove `R_from_rpy(rpy)` method

    The method was badly implemented. Moreover, it's not really useful (it should be ok to call SO3.from_euler(rpy).as_matrix().

    • changed from_angle to from_euler
    • implemented to_euler
    opened by Giulero 1
Releases(v0.0.4)
  • v0.0.4(Nov 21, 2022)

    What's Changed

    • Remove R_from_rpy(rpy) method and add from/to Euler methods by @Giulero in https://github.com/ami-iit/liecasadi/pull/6

    Full Changelog: https://github.com/ami-iit/liecasadi/compare/v0.0.3...v0.0.4

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Oct 12, 2022)

    What's Changed

    • Add quaternion derivative by @Giulero in https://github.com/ami-iit/liecasadi/pull/4
    • Add dual quaternion class by @Giulero in https://github.com/ami-iit/liecasadi/pull/5

    Full Changelog: https://github.com/ami-iit/liecasadi/compare/v0.0.2...v0.0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(May 18, 2022)

    What's Changed

    • Deploy library on PyPi by @Giulero in https://github.com/ami-iit/liecasadi/pull/3

    Full Changelog: https://github.com/ami-iit/liecasadi/compare/v0.0.1...v0.0.2

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Feb 16, 2022)

Owner
Artificial and Mechanical Intelligence
Artificial and Mechanical Intelligence
Weakly Supervised Text-to-SQL Parsing through Question Decomposition

Weakly Supervised Text-to-SQL Parsing through Question Decomposition The official repository for the paper "Weakly Supervised Text-to-SQL Parsing thro

14 Dec 19, 2022
Fully-automated scripts for collecting AI-related papers

AI-Paper-collector Fully-automated scripts for collecting AI-related papers List of Conferences to crawel ACL: 21-19 (including findings) EMNLP: 21-19

Gordon Lee 776 Jan 08, 2023
Official pytorch implement for “Transformer-Based Source-Free Domain Adaptation”

Official implementation for TransDA Official pytorch implement for “Transformer-Based Source-Free Domain Adaptation”. Overview: Result: Prerequisites:

stanley 54 Dec 22, 2022
Campsite Reservation Finder

yellowstone-camping UPDATE: yellowstone-camping is being expanded and renamed to camply. The updated tool now interfaces with the Recreation.gov API a

Justin Flannery 233 Jan 08, 2023
Diverse Branch Block: Building a Convolution as an Inception-like Unit

Diverse Branch Block: Building a Convolution as an Inception-like Unit (PyTorch) (CVPR-2021) DBB is a powerful ConvNet building block to replace regul

253 Dec 24, 2022
Add-on for importing and auto setup of character creator 3 character exports.

CC3 Blender Tools An add-on for importing and automatically setting up materials for Character Creator 3 character exports. Using Blender in the Chara

260 Jan 05, 2023
Official implementation of SynthTIGER (Synthetic Text Image GEneratoR) ICDAR 2021

🐯 SynthTIGER: Synthetic Text Image GEneratoR Official implementation of SynthTIGER | Paper | Datasets Moonbin Yim1, Yoonsik Kim1, Han-cheol Cho1, Sun

Clova AI Research 256 Jan 05, 2023
An AI made using artificial intelligence (AI) and machine learning algorithms (ML) .

DTech.AIML An AI made using artificial intelligence (AI) and machine learning algorithms (ML) . This is created by help of some members in my team and

1 Jan 06, 2022
FFTNet vocoder implementation

Unofficial Implementation of FFTNet vocode paper. implement the model. implement tests. overfit on a single batch (sanity check). linearize weights fo

Eren Gölge 81 Dec 08, 2022
Multi-Modal Machine Learning toolkit based on PyTorch.

简体中文 | English TorchMM 简介 多模态学习工具包 TorchMM 旨在于提供模态联合学习和跨模态学习算法模型库,为处理图片文本等多模态数据提供高效的解决方案,助力多模态学习应用落地。 近期更新 2022.1.5 发布 TorchMM 初始版本 v1.0 特性 丰富的任务场景:工具

njustkmg 1 Jan 05, 2022
A minimalist tool to display a network graph.

A tool to get a minimalist view of any architecture This tool has only be tested with the models included in this repo. Therefore, I can't guarantee t

Thibault Castells 1 Feb 11, 2022
Course materials for Fall 2021 "CIS6930 Topics in Computing for Data Science" at New College of Florida

Fall 2021 CIS6930 Topics in Computing for Data Science This repository hosts course materials used for a 13-week course "CIS6930 Topics in Computing f

Yoshi Suhara 101 Nov 30, 2022
DeconvNet : Learning Deconvolution Network for Semantic Segmentation

DeconvNet: Learning Deconvolution Network for Semantic Segmentation Created by Hyeonwoo Noh, Seunghoon Hong and Bohyung Han at POSTECH Acknowledgement

Hyeonwoo Noh 325 Oct 20, 2022
学习 python3 以来写的一些垃圾玩具……

和东哥做兄弟 Author: chiupam 版权 未经本人同意,仓库内所有资源文件,禁止任何公众号、自媒体、开发者进行任何形式的转载、发布、搬运。 声明 这不是一个开源项目,只是把 GitHub 当作一个代码的存储空间,本项目不接受任何开源要求。 仅用于学习研究,禁止用于商业用途,不能保证其合法性

Chiupam 67 Mar 26, 2022
Multi-Object Tracking in Satellite Videos with Graph-Based Multi-Task Modeling

TGraM Multi-Object Tracking in Satellite Videos with Graph-Based Multi-Task Modeling, Qibin He, Xian Sun, Zhiyuan Yan, Beibei Li, Kun Fu Abstract Rece

Qibin He 6 Nov 25, 2022
PyTorch reimplementation of hand-biomechanical-constraints (ECCV2020)

Hand Biomechanical Constraints Pytorch Unofficial PyTorch reimplementation of Hand-Biomechanical-Constraints (ECCV2020). This project reimplement foll

Hao Meng 59 Dec 20, 2022
Project Aquarium is a SUSE-sponsored open source project aiming at becoming an easy to use, rock solid storage appliance based on Ceph.

Project Aquarium Project Aquarium is a SUSE-sponsored open source project aiming at becoming an easy to use, rock solid storage appliance based on Cep

Aquarist Labs 73 Jul 21, 2022
RTSeg: Real-time Semantic Segmentation Comparative Study

Real-time Semantic Segmentation Comparative Study The repository contains the official TensorFlow code used in our papers: RTSEG: REAL-TIME SEMANTIC S

Mennatullah Siam 592 Nov 18, 2022
Pytorch for Segmentation

Pytorch for Semantic Segmentation This repo has been deprecated currently and I will not maintain it. Meanwhile, I strongly recommend you can refer to

ycszen 411 Nov 22, 2022
An open source machine learning library for performing regression tasks using RVM technique.

Introduction neonrvm is an open source machine learning library for performing regression tasks using RVM technique. It is written in C programming la

Siavash Eliasi 33 May 31, 2022