geoconv

A Python library for end-to-end learning on surfaces. It implements pre-processing functions that include geodesic algorithms, neural network layers that operate on surfaces, visualization tools and benchmarking functionalities.

https://github.com/andreasmazur/geoconv

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary

Keywords

benchmarking convolutional-neural-networks deep-learning deep-neural-networks geodesic-algorithm geometric-deep-learning geometry-processing keras machine-learning neural-network neural-networks tensorflow visualization
Last synced: 6 months ago · JSON representation

Repository

A Python library for end-to-end learning on surfaces. It implements pre-processing functions that include geodesic algorithms, neural network layers that operate on surfaces, visualization tools and benchmarking functionalities.

Basic Info
  • Host: GitHub
  • Owner: andreasMazur
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 8.86 MB
Statistics
  • Stars: 34
  • Watchers: 3
  • Forks: 3
  • Open Issues: 0
  • Releases: 3
Topics
benchmarking convolutional-neural-networks deep-learning deep-neural-networks geodesic-algorithm geometric-deep-learning geometry-processing keras machine-learning neural-network neural-networks tensorflow visualization
Created almost 4 years ago · Last pushed 7 months ago
Metadata Files
Readme License Citation

README.md

GeoConv

Let's bend planes to curved surfaces.

Intrinsic mesh CNNs [1] operate directly on object surfaces, therefore expanding the application of convolutions to non-Euclidean data.

GeoConv is a library that provides end-to-end tools for deep learning on surfaces. That is, whether it is pre-processing your mesh files into a format that can be fed into neural networks, or the implementation of the intrinsic surface convolutions [1] themselves, GeoConv has you covered.

Implementation

While this library is theoretically motivated by the work of [1], [2] and [3] it also adds additional functionalities such as the freedom of specifying new kernels, preprocessing algorithms like the one from [4], as well as visualization and benchmark tools to verify your layer configuration, your pre-processing results or your trained models.

GeoConv provides the base layer ConvIntrinsic as a Tensorflow or Pytorch layer. Both implementations are equivalent. Only the ways in how they are configured slightly differ due to differences regarding Tensorflow and Pytorch. Check the minimal example below or the geoconv_examples-package for how you configure Intrinsic Mesh CNNs.

Installation

  1. Install BLAS and CBLAS: bash sudo apt install libatlas-base-dev

  2. Install geoconv:

    | Installation Variant | Command | |--------------------------------------|-----------------------------------------------------------------------------------------| | GeoConv | pip install geoconv | | GeoConv + Tensorflow/Keras (CPU) | pip install geoconv[tensorflow] | | GeoConv + Tensorflow/Keras (GPU) | pip install geoconv[tensorflow_gpu] | | GeoConv + Pytorch (CPU) | pip install geoconv[pytorch] --extra-index-url https://download.pytorch.org/whl/cpu | | GeoConv + Pytorch (GPU) | pip install geoconv[pytorch] --extra-index-url https://download.pytorch.org/whl/cu118 |

  3. If you want to run the FAUST example you also need to install: bash sudo apt install libflann-dev libeigen3-dev lz4 pip install cython==0.29.37 pip install pyshot@git+https://github.com/uhlmanngroup/pyshot@master

  4. In case OpenGL context cannot be created: bash conda install -c conda-forge libstdcxx-ng

Minimal Example (TensorFlow)

```python from geoconv.tensorflow.layers.convgeodesic import ConvGeodesic from geoconv.tensorflow.layers.angularmax_pooling import AngularMaxPooling

import keras

def definemodel(inputdim, outputdim, nradial, n_angular): """Define a geodesic convolutional neural network"""

 signal_input = keras.layers.InputLayer(shape=(input_dim,))
 barycentric = keras.layers.InputLayer(shape=(n_radial, n_angular, 3, 2))
 signal = ConvGeodesic(
      amt_templates=32,  # 32-dimensional output
      template_radius=0.03,  # maximal geodesic template distance 
      activation="relu",
      rotation_delta=1  # Delta in between template rotations
 )([signal_input, barycentric])
 signal = AngularMaxPooling()(signal)
 logits = keras.layers.Dense(output_dim)(signal)

 model = keras.Model(inputs=[signal_input, barycentric], outputs=[logits])
 return model

```

Minimal Example (PyTorch)

```python from geoconv.pytorch.layers.convgeodesic import ConvGeodesic from geoconv.pytorch.layers.angularmax_pooling import AngularMaxPooling

from torch import nn

class GCNN(nn.Module): def init(self, inputdim, outputdim, nradial, nangular): super().init() self.geodesicconv = ConvGeodesic( inputshape=[(None, inputdim), (None, nradial, nangular, 3, 2)], amttemplates=32, # 32-dimensional output templateradius=0.03, # maximal geodesic template distance activation="relu", rotationdelta=1 # Delta in between template rotations ) self.amp = AngularMaxPooling() self.output = nn.Linear(infeatures=32, outfeatures=output_dim)

 def forward(self, x):
      signal, barycentric = x
      signal = self.geodesic_conv([signal, barycentric])
      signal = self.amp(signal)
      return self.output(signal)

```

Inputs and preprocessing

As visible in the minimal examples above, the intrinsic surface convolutional layer (here geodesic convolution) expects two inputs: 1. The signal defined on the mesh vertices (can be anything from descriptors like SHOT [5] to simple 3D-coordinates of the vertices). 2. Barycentric coordinates for signal interpolation in the format specified by the output of compute_barycentric_coordinates.

For the latter: GeoConv supplies you with the necessary preprocessing functions: 1. Use GPCSystemGroup(mesh).compute(u_max=u_max) on your triangle meshes (which are stored in a format that is supported by Trimesh, e.g. 'ply') to compute local geodesic polar coordinate systems with the algorithm of [4]. 2. Use those GPC-systems and compute_barycentric_coordinates to compute the barycentric coordinates for the kernel vertices. The result can without further effort directly be fed into the layer.

For more thorough explanations on how GeoConv operates check out the geoconv_examples-package!

Cite

Using my work? Please cite this repository by using the "Cite this repository"-option of GitHub in the right panel.

Referenced Literature

[1]: Bronstein, Michael M., et al. "Geometric deep learning: Grids, groups, graphs, geodesics, and gauges." arXiv preprint arXiv:2104.13478 (2021).

[2]: Monti, Federico, et al. "Geometric deep learning on graphs and manifolds using mixture model cnns." Proceedings of the IEEE conference on computer vision and pattern recognition. 2017.

[3]: Poulenard, Adrien, and Maks Ovsjanikov. "Multi-directional geodesic neural networks via equivariant convolution." ACM Transactions on Graphics (TOG) 37.6 (2018): 1-14.

[4]: Melvær, Eivind Lyche, and Martin Reimers. "Geodesic polar coordinates on polygonal meshes." Computer Graphics Forum. Vol. 31. No. 8. Oxford, UK: Blackwell Publishing Ltd, 2012.

[5]: Tombari, Federico, Samuele Salti, and Luigi Di Stefano. "Unique signatures of histograms for local surface description." European conference on computer vision. Springer, Berlin, Heidelberg, 2010.

Owner

  • Name: Andreas Mazur
  • Login: andreasMazur
  • Kind: user
  • Company: Bielefeld University

Graduate student of computer science with focus on Machine Learning at Bielefeld University.

GitHub Events

Total
  • Release event: 1
  • Watch event: 6
  • Push event: 387
  • Pull request event: 2
  • Fork event: 2
Last Year
  • Release event: 1
  • Watch event: 6
  • Push event: 387
  • Pull request event: 2
  • Fork event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 771
  • Total Committers: 1
  • Avg Commits per committer: 771.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 14
  • Committers: 1
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Andreas Mazur a****r@t****e 771
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 3
  • Total pull requests: 4
  • Average time to close issues: 9 days
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 minutes
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • IHateLiam (1)
  • pieris98 (1)
  • wq1999 (1)
Pull Request Authors
  • DavidPL1 (4)
  • robertsi20 (2)
  • andreasMazur (2)
Top Labels
Issue Labels
documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 17 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: geoconv

Intrinsic Surface Convolutions for everyone!

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 17 Last month
Rankings
Dependent packages count: 9.7%
Average: 37.0%
Dependent repos count: 64.3%
Maintainers (1)
Last synced: 7 months ago

Dependencies

requirements.txt pypi
  • Cython *
  • Pillow *
  • matplotlib *
  • networkx *
  • numpy *
  • open3d *
  • pyglet *
  • scipy *
  • tensorflow *
  • tqdm *
  • trimesh *
setup.py pypi