Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buswinka/piefs
Python Instance (map) Eikonal Function Solver
https://github.com/buswinka/piefs
cellpose distance-calculation eikonal eikonal-solver instance-segmentation omnipose pytorch
Last synced: about 2 months ago
JSON representation
Python Instance (map) Eikonal Function Solver
- Host: GitHub
- URL: https://github.com/buswinka/piefs
- Owner: buswinka
- License: gpl-3.0
- Created: 2023-07-25T18:51:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-02T18:58:11.000Z (over 1 year ago)
- Last Synced: 2024-11-15T07:14:30.990Z (2 months ago)
- Topics: cellpose, distance-calculation, eikonal, eikonal-solver, instance-segmentation, omnipose, pytorch
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```python
import torch
from piefs import solve_eikonal, gradient_from_eikonalimage = 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)
```