Skip to main content

Solves eikonal function on instance maps.

Project description

Python Instance Eikonal Function Solver (PIEFS)

PIEFS is a library which solves the Eikonal Function for 2D and 3D instance masks, using the Fast Iterative Method. It achieves memory efficiency through a fused kernel written in OpenAI Triton. It also provides functionality to calculate gradients of the eikonal field.

This implementation uses convolutions to calculate affinity masks, which may be faster and can occur on cuda, however uses dense representations of the affinity masks and therefore is memory intensive. It may be possible for much of the mask operations to occur with sparse tensors for memory efficiency.

A big thanks to Kevin Cutler (Original Omnipose Author) for helping me create this.

Example:

import torch
from piefs import solve_eikonal, gradient_from_eikonal

image = torch.load('path/to/my/image.pt')  # An image with shape (B, C=1, X, Y, Z)
eikonal = solve_eikonal(image, eps=1e-5, min_steps=200, use_triton=True)  # A Distance map with shape (B, C=1, X, Y, Z)
gradients = gradient_from_eikonal(eikonal)  # A Gradient tensor with shape (B, C=3, X, Y, Z)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PIEFS-0.0.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

piefs-0.0.1-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

PIEFS-0.0.1-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file PIEFS-0.0.1.tar.gz.

File metadata

  • Download URL: PIEFS-0.0.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for PIEFS-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e54045cb363e4739ff85d7c5238094eac846cf4f8bd86e39482f86430f389e53
MD5 18cd7bd1e9cce073c292c5716ff26838
BLAKE2b-256 de9ff03e3fdce67fd8996851e91f053c0ea412151edb8e9c50afafb7e14d5d1f

See more details on using hashes here.

File details

Details for the file piefs-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: piefs-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for piefs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85f6436599be271bcf81d51adedb68c04c07d015fa131dd461f2689279f2f9f8
MD5 e2876d5f0d97bdf8f81a8ce093cb4081
BLAKE2b-256 0e8596547482dff5df5a495295518ce2c7a6281981205bcdd07e2c2a9efd7f12

See more details on using hashes here.

File details

Details for the file PIEFS-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: PIEFS-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for PIEFS-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd48865b53fcfc624cdc25959d7b66f2f9dfe6757f8b41680cf6002638ea3212
MD5 34823d598202c1c380c009d4299cb3a0
BLAKE2b-256 f6cc148c1f1ad2fbd6f217848ee0dd351fd9b3d83e8e4e6900328d81d7637c55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page