To know more about scikit-shapes, check out the documentation and the gallery of examples
Scikit-Shapes
Shape processing in Python
Presentation
Scikit-shapes is a python package for the analysis of 2D and 3D shape data. It gathers tools for:
- Compute features for shapes such as curvature
- Preprocess shapes with downscaling or landmarks setting
- Register shapes with or without landmarks
- Population Analysis : distance matrices
Philosophy
Scikit-shapes is thinked to be intuitive and user-friendly, our am is to provide a library that is
- Task-oriented: basic objects are high-level tasks, such as
RegistrationorMultiscaling. The mathematical details as loss function, deformation model, are defined as hyperparameters. - Modular: workflows can be designed following a plug-and-play approach, allowing comparison across different methods for the same task. In addition, it is possible to implement new modules such as deformation model or loss function and integrate them in existing pipelines.
- Efficient: skshapes relies mostly on pyTorch and pyKeOps for computations. It allows to speed-up numerical intensive part of the analysis with parallelization on CPU or GPU.
Here is a code snippet illustrating how a registration model is build by combining a loss function and a deformation model:
import skshapes as sks
shape1 = sks.read("data/shape1.vtk")
shape2 = sks.read("data/shape2.vtk")
registration = sks.Registration(
model=sks.ExtrinsicDeformation(n_steps=5, kernel="gaussian", blur=0.5),
loss=sks.NearestNeighborLoss(),
gpu=True,
)
registration.fit(source=shape1, target=shape2)
transformed_shape = registration.transform(source=shape1)
Connection to other open-source projects
Scikit-shapes relies on other open-source software, our main dependencies are :
- PyTorch and KeOps : skshapes uses pytorch tensors as basic array structure and take benefits of the pytorch ecosystem to let the possibility to accelerate computations on GPU.
- PyVista and Vedo : skshapes relies on PyVista for data loading and visualization, and on vedo for creating interactive visualization. Skshapes objects are exportable to vedo or pyvista through
.to_vedo()and.to_pyvista()methods. - Jaxtyping and Beartype : scikit-shapes is a runtime type checked library. Types are documented with annotations and error are raised if a function is called with a wrong argument's type. This prevents silent errors due to common mistakes such as bad numerical type. Our runtime type checking engine is build around Beartype and annotations for numerical arrays are based on Jaxtyping.
Installation
At the moment, scikit-shapes is available on linux and macOS only
From pip
The last stable version of scikit-shapes version can be installed directly from pip with
pip install skshapes
From source
If you want the development version or consider contributing to the codebase, you can also install scikit-shapes locally from a clone of the repository. On a terminal, navigate to the scikit-shapes directory and run :
pip install -e .
Then you can :
- run the pre-commit hooks:
pip install -r requirements_dev.txt
pre-commit install
pre-commit run --all-files
- run the tests:
pip install -r requirements_dev.txt
pytest
- build the documentation (and serve it locally)
pip install -r requirements_docs.txt
cd doc/source/
make clean
make html
cd ../_build/html
python -m http.server
Contributing
We warmly welcome all contribution, if you found a bug, a typo or want to contribute with a new feature, please open an issue.
You can also open a discussion if you have any question regarding the project.
For more information about contributing with new code, see the dedicated section of the documentation.
Metadata
Release files for skshapes 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| skshapes-0.3.tar.gz | 122.2 kB | With provenance | Details for skshapes-0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| skshapes-0.3-py3-none-any.whl | Python 3 | none | any | Details for skshapes-0.3-py3-none-any.whl |
Total release size: 240.0 kB
Release files / skshapes-0.3.tar.gz
| Download URL | skshapes-0.3.tar.gz |
|---|---|
| Size | 122.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c0dcae261cc3b2143cbe27c50325376e9d42ba4955f96c690238a0f638dc6ab
|
|
BLAKE2b-256 checksum How to use checksums |
5480a31346d85a0d5af0757a072e70681abe29451ba0daf048d45fa528c21256
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 9, 2025.
Transparency logRelease files / skshapes-0.3-py3-none-any.whl
| Download URL | skshapes-0.3-py3-none-any.whl |
|---|---|
| Size | 117.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cda53ece20ad96bbcac5f0d1d805dae44d1a14e51f1d1d76d56c5aedfa939d7d
|
|
BLAKE2b-256 checksum How to use checksums |
02c3acf74478d87838ebb1795fe268605541141e4ee21688eb9a872ec66ec37d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 9, 2025.
Transparency logSecurity for skshapes 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for skshapes-0.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 9, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.