torchhull


Nametorchhull JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA fast Visual Hull implementation
upload_time2025-07-10 13:28:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">torchhull: A fast Visual Hull implementation</h1>

<!-- start readme -->

<p align="center">
<a href="https://pypi.python.org/pypi/torchhull">
    <img alt="PyPI - Version" src="https://img.shields.io/pypi/v/torchhull">
</a>
<a href="https://pypi.python.org/pypi/torchhull">
    <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/torchhull">
</a>
<a href="https://github.com/vc-bonn/torchhull/blob/main/LICENSE">
    <img alt="GitHub License" src="https://img.shields.io/badge/License-MIT-green.svg"/>
</a>
<a href="https://github.com/vc-bonn/torchhull/blob/main/LICENSE">
    <img alt="GitHub License" src="https://img.shields.io/badge/License-BSD--3--Clause-green.svg"/>
</a>
<a href="https://github.com/vc-bonn/torchhull/actions/workflows/build.yml">
    <img alt="Build" src="https://github.com/vc-bonn/torchhull/actions/workflows/build.yml/badge.svg">
</a>
<a href="https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml">
    <img alt="Lint" src="https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml/badge.svg">
</a>
<a href="https://vc-bonn.github.io/torchhull">
    <img alt="Documentation" src="https://img.shields.io/badge/docs-Latest-green.svg"/>
</a>
</p>


torchhull is an extremely fast Torch C++/CUDA implementation for computing visual hulls from mask images and comes with Python bindings through [charonload](https://github.com/vc-bonn/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:

```bib
@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.9
- CUDA >= 12.1
- C++17 compiler

The package itself can be installed from PyPI:

```sh
pip install torchhull
```


## Quick Start

torchhull gets as input mask images with camera information:

- `masks`: Single-channel images `M` with binary values {0, 1}.
- `transforms`: Fused extrinsic and intrinsic matrix `K * T`, i.e. transformation from world coordinates to OpenGL clip space (right before perspective division).

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.

```python
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,
                                     unique_verts=True,
                                    )
```


## License

This software is provided under MIT license, with parts under BSD 3-Clause license. See [`LICENSE`](https://github.com/vc-bonn/torchhull/blob/main/LICENSE) for more information.


## Contact

Patrick Stotko - <a href="mailto:stotko@cs.uni-bonn.de">stotko@cs.uni-bonn.de</a><br/>

<!-- end readme -->

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "torchhull",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Patrick Stotko <stotko@cs.uni-bonn.de>",
    "download_url": "https://files.pythonhosted.org/packages/7b/91/b56545de3cbd38f915a792055deea78f6908138a9ad2b7549816f2f17987/torchhull-0.2.0.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">torchhull: A fast Visual Hull implementation</h1>\n\n<!-- start readme -->\n\n<p align=\"center\">\n<a href=\"https://pypi.python.org/pypi/torchhull\">\n    <img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/torchhull\">\n</a>\n<a href=\"https://pypi.python.org/pypi/torchhull\">\n    <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/torchhull\">\n</a>\n<a href=\"https://github.com/vc-bonn/torchhull/blob/main/LICENSE\">\n    <img alt=\"GitHub License\" src=\"https://img.shields.io/badge/License-MIT-green.svg\"/>\n</a>\n<a href=\"https://github.com/vc-bonn/torchhull/blob/main/LICENSE\">\n    <img alt=\"GitHub License\" src=\"https://img.shields.io/badge/License-BSD--3--Clause-green.svg\"/>\n</a>\n<a href=\"https://github.com/vc-bonn/torchhull/actions/workflows/build.yml\">\n    <img alt=\"Build\" src=\"https://github.com/vc-bonn/torchhull/actions/workflows/build.yml/badge.svg\">\n</a>\n<a href=\"https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml\">\n    <img alt=\"Lint\" src=\"https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml/badge.svg\">\n</a>\n<a href=\"https://vc-bonn.github.io/torchhull\">\n    <img alt=\"Documentation\" src=\"https://img.shields.io/badge/docs-Latest-green.svg\"/>\n</a>\n</p>\n\n\ntorchhull is an extremely fast Torch C++/CUDA implementation for computing visual hulls from mask images and comes with Python bindings through [charonload](https://github.com/vc-bonn/charonload):\n\n- \u26a1 Up to real-time capable speed depending on chosen resolution\n- \ud83d\udddc\ufe0f Memory-efficient computation by constructing sparse voxel octrees\n- \ud83c\udf0a Watertight mesh generation via Marching Cubes\n- \ud83c\udf88 Smooth surfaces with sparse Gaussian blur preprocessing tailored for mask images\n- \ud83d\udee0\ufe0f Support for partially visible objects, i.e. clipped mask images, and fully observed objects\n\n\nIn particular, torchhull is a GPU implementation of the following paper:\n\n```bib\n@article{scharr2017fast,\n  title={{Fast High Resolution Volume Carving for 3D Plant Shoot Reconstruction}},\n  author={Scharr, Hanno and Briese, Christoph and Embgenbroich, Patrick and Fischbach, Andreas and Fiorani, Fabio and M{\\\"u}ller-Linow, Mark},\n  journal={Frontiers in Plant Science},\n  volume={8},\n  pages={303692},\n  year={2017},\n  publisher={Frontiers}\n}\n```\n\n\n## Installation\n\ntorchhull requires the following prerequites (for JIT compilation):\n\n- Python >= 3.9\n- CUDA >= 12.1\n- C++17 compiler\n\nThe package itself can be installed from PyPI:\n\n```sh\npip install torchhull\n```\n\n\n## Quick Start\n\ntorchhull gets as input mask images with camera information:\n\n- `masks`: Single-channel images `M` with binary values {0, 1}.\n- `transforms`: Fused extrinsic and intrinsic matrix `K * T`, i.e. transformation from world coordinates to OpenGL clip space (right before perspective division).\n\nThe 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.\n\n```python\nimport torchhull\n\n# Optional\nmasks = torchhull.gaussian_blur(masks, # [B, H, W, 1]\n                                kernel_size,\n                                sigma,\n                                sparse=True,\n                               )\n\nverts, faces = torchhull.visual_hull(masks,  # [B, H, W, 1]\n                                     transforms,  # [B, 4, 4]\n                                     level,\n                                     cube_corner_bfl,\n                                     cube_length,\n                                     masks_partial=False,\n                                     unique_verts=True,\n                                    )\n```\n\n\n## License\n\nThis software is provided under MIT license, with parts under BSD 3-Clause license. See [`LICENSE`](https://github.com/vc-bonn/torchhull/blob/main/LICENSE) for more information.\n\n\n## Contact\n\nPatrick Stotko - <a href=\"mailto:stotko@cs.uni-bonn.de\">stotko@cs.uni-bonn.de</a><br/>\n\n<!-- end readme -->\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A fast Visual Hull implementation",
    "version": "0.2.0",
    "project_urls": {
        "Changelog": "https://github.com/vc-bonn/torchhull/blob/main/CHANGELOG.md",
        "Documentation": "https://vc-bonn.github.io/torchhull/",
        "Homepage": "https://github.com/vc-bonn/torchhull",
        "Repository": "https://github.com/vc-bonn/torchhull"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "35e586ec1eba022056bbc535e716320ebd010ebaaf4dd96ba8cf2e56931e56bf",
                "md5": "e9e1d1db01272d8e03e5701da3710a5a",
                "sha256": "be111468b41a99db0847956bc3b8f891a41d3b09e09beb82c5a27443881c1427"
            },
            "downloads": -1,
            "filename": "torchhull-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9e1d1db01272d8e03e5701da3710a5a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 40234,
            "upload_time": "2025-07-10T13:28:06",
            "upload_time_iso_8601": "2025-07-10T13:28:06.107321Z",
            "url": "https://files.pythonhosted.org/packages/35/e5/86ec1eba022056bbc535e716320ebd010ebaaf4dd96ba8cf2e56931e56bf/torchhull-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7b91b56545de3cbd38f915a792055deea78f6908138a9ad2b7549816f2f17987",
                "md5": "ce6abb7e00b4118a9b87a6fc8a4b0f86",
                "sha256": "82bc55149a8ded281676da38b6059943a96679c402a671e511e3acf2e15a0ccf"
            },
            "downloads": -1,
            "filename": "torchhull-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ce6abb7e00b4118a9b87a6fc8a4b0f86",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 39444,
            "upload_time": "2025-07-10T13:28:07",
            "upload_time_iso_8601": "2025-07-10T13:28:07.511691Z",
            "url": "https://files.pythonhosted.org/packages/7b/91/b56545de3cbd38f915a792055deea78f6908138a9ad2b7549816f2f17987/torchhull-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 13:28:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vc-bonn",
    "github_project": "torchhull",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "torchhull"
}
        
Elapsed time: 0.58962s