A fast Visual Hull implementation
Project description
torchhull: A fast Visual Hull implementation
torchhull is an extremely fast Torch C++/CUDA implementation for computing visual hulls from mask images and comes with Python bindings through charonload:
- ⚡ Up to real-time capable speed depending on chosen resolution
- 🗜️ Memory-efficient computation by constructing sparse voxel octrees
- 🌊 Watertight mesh generation via Marching Cubes
- 🎈 Smooth surfaces with sparse Gaussian blur preprocessing tailored for mask images
- 🛠️ Support for partially visible objects, i.e. clipped mask images, and fully observed objects
In particular, torchhull is a GPU implementation of the following paper:
@article{scharr2017fast,
title={{Fast High Resolution Volume Carving for 3D Plant Shoot Reconstruction}},
author={Scharr, Hanno and Briese, Christoph and Embgenbroich, Patrick and Fischbach, Andreas and Fiorani, Fabio and M{\"u}ller-Linow, Mark},
journal={Frontiers in Plant Science},
volume={8},
pages={303692},
year={2017},
publisher={Frontiers}
}
Installation
torchhull requires the following prerequites (for JIT compilation):
- Python >= 3.10
- CUDA >= 12.1
- C++17 compiler
The package itself can be installed from PyPI:
pip install torchhull
Quick Start
torchhull gets as input mask images with camera information:
masks: Single-channel imagesMwith binary values {0, 1}.transforms: Fused extrinsic and intrinsic matrixK * T, i.e. from world coordinates to image coordinates (right before perspective division), either in OpenGL or OpenCV convention.
The visual hull is then evaluated inside a cube with bottom-front-left corner cube_corner_bfl and extent cube_length at extracted at octree level level. The remaining flags control how the output mesh (verts, faces) should look like.
import torchhull
# Optional
masks = torchhull.gaussian_blur(masks, # [B, H, W, 1]
kernel_size,
sigma,
sparse=True,
)
verts, faces = torchhull.visual_hull(masks, # [B, H, W, 1]
transforms, # [B, 4, 4]
level,
cube_corner_bfl,
cube_length,
masks_partial=False,
transforms_convention="opengl",
unique_verts=True,
)
License
This software is provided under MIT license, with parts under BSD 3-Clause license. See LICENSE for more information.
Contact
Patrick Stotko - stotko@cs.uni-bonn.de
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torchhull-0.3.0.tar.gz.
File metadata
- Download URL: torchhull-0.3.0.tar.gz
- Upload date:
- Size: 40.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bb8b6434a9b8b1a7fac09cc3792ac48fe59fc2135554f4ca0b5a1748c0a0be9
|
|
| MD5 |
3e70afb5109d68202426983392417963
|
|
| BLAKE2b-256 |
84943c371815f669a9f93a7eaebfe472eedcaced7be9b9377f5e63412696b673
|
Provenance
The following attestation bundles were made for torchhull-0.3.0.tar.gz:
Publisher:
pypi.yml on vc-bonn/torchhull
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torchhull-0.3.0.tar.gz -
Subject digest:
9bb8b6434a9b8b1a7fac09cc3792ac48fe59fc2135554f4ca0b5a1748c0a0be9 - Sigstore transparency entry: 772594781
- Sigstore integration time:
-
Permalink:
vc-bonn/torchhull@d294776f9bc291db69392217f379bfcacf62943f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/vc-bonn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@d294776f9bc291db69392217f379bfcacf62943f -
Trigger Event:
release
-
Statement type:
File details
Details for the file torchhull-0.3.0-py3-none-any.whl.
File metadata
- Download URL: torchhull-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d9bf82d33f86fd330363ea2c1b3cff044771d26c0ebe1e54ca4ea03dc01af6
|
|
| MD5 |
7753b147d1bba76b93358b6fc3662acf
|
|
| BLAKE2b-256 |
abb011c4417fc8e87e2cc4a1f5865b1dcb2c7cb672f8da6e6c99522ce3ba1d97
|
Provenance
The following attestation bundles were made for torchhull-0.3.0-py3-none-any.whl:
Publisher:
pypi.yml on vc-bonn/torchhull
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torchhull-0.3.0-py3-none-any.whl -
Subject digest:
38d9bf82d33f86fd330363ea2c1b3cff044771d26c0ebe1e54ca4ea03dc01af6 - Sigstore transparency entry: 772594782
- Sigstore integration time:
-
Permalink:
vc-bonn/torchhull@d294776f9bc291db69392217f379bfcacf62943f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/vc-bonn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@d294776f9bc291db69392217f379bfcacf62943f -
Trigger Event:
release
-
Statement type: