Densemaps : Abstract Correspondence Maps for 3D Geometry
February 10, 2025 · View on GitHub
Welcome to the documentation of densemaps !
A lightweight library that offers:
- Unified correspondence representation for 3D objects (surfaces, point clouds) with NumPy and PyTorch support
- Memory-efficient dense matrix operations for large-scale geometric maps, based on our recent research Memory-Scalable and Simplified Functional Map Learning.
Installing
Pip installation is not yet available.
You can clone the directory using
git clone https://github.com/RobinMagnet/ScalableDenseMaps.git
And install the dependencies using
pip install -r requirements.txt
Shape Correspondence Representations
Note: Throughout this documentation, maps go from surface to surface (not the reverse).
This library unifies three common ways to represent correspondences between 3D surfaces and (with and vertices):
- Vertex-to-Vertex Maps: Direct mapping between vertices, represented as either:
- An array
p2p_21, wherep2p_21[i]indicates which vertex in corresponds to vertex in - A binary matrix where means vertex maps to vertex
- An array
- Vertex-to-Point Maps: Maps vertices to arbitrary points on surface faces:
- Represented by with
- Maximum 3 non-zero entries per row (barycentric coordinates)
- See more details e.g in this this paper
- Soft Maps: Dense correspondence matrices:
- from softmax over similarity scores
- Example: where measures similarity between embeddings
The common operations across all representations are:
- Converting to vertex-to-vertex maps
- Function transfer via
- Map composition:
The library implements these representations with both NumPy and PyTorch (CUDA-compatible) backends.
Example Code
from densemaps.torch import maps
emb1 = # Use some per-vertex embedding for object 1. (N1, p)
emb2 = # Use some per-vertex embedding for object 2. (N2, p)
P21 = maps.KernelDistMap(emb1, emb2, blur=1e-1) # A "dense" kernel map, not used in memory
# If my embeddings were not on CUDA, I can send them easily and come back to cpu
P21.cuda()
P21.cpu()
uv1 = # Get uv-coordinates on mesh1 (N1, 2)
uv2 = P21 @ uv1 # Transfered uv coordinates (n2, 2)
P21_dense = P21._to_dense() # I can get the (N2, N1) map back
p2p_21 = P21.get_nn() # I can get the (N2,) vertex to vertex map
Example of usage
The densemaps package is used for instance in the following github repositories:
- Reversible Harmonic Maps implementation in python
- Memory Scalable and Simplified Functional Map Learning implementation
Citing this work
If you use this work, please cite
@inproceedings{magnetMemoryScalable2024,
title = {Memory Scalable and Simplified Functional Map Learning},
booktitle = {2024 {{IEEE}}/{{CVF Conference}} on {{Computer Vision}} and {{Pattern Recognition}} ({{CVPR}})},
author = {Magnet, Robin and Ovsjanikov, Maks},
year = {2024},
publisher = {IEEE},
}