Skip to main content

empanada-napari

The paper describing this work is now available on Cell Systems.

Documentation for the plugin, including more detailed installation instructions, can be found here.

empanada is a tool for deep learning-based panoptic segmentation of 2D and 3D electron microscopy images of cells. This plugin allows the running of panoptic segmentation models trained in empanada within napari. For help with this plugin please open an issue, for issues with napari specifically raise an issue here instead.

Implemented Models

  • MitoNet: A generalist mitochondrial instance segmentation model
  • NucleoNet: A base model for EM instance nucleus segmentation
  • DropNet: A base model for EM Lipid Droplet instance segmentation

Example Datasets

Volume EM datasets for benchmarking mitochondrial instance segmentation are available from EMPIAR-10982.

Installation

New Users

empanada-napari requires Python ≥ 3.12 and napari ≥ 0.9 (including 0.10.x).

pip

python3.12 -m venv empanada-env
source empanada-env/bin/activate   # Windows: empanada-env\Scripts\activate
python -m pip install -U pip
python -m pip install "napari[all]>=0.9"
python -m pip install empanada-napari

conda

conda create -n empanada-env python=3.12 -y
conda activate empanada-env
python -m pip install -U pip
python -m pip install "napari[all]>=0.9"
python -m pip install empanada-napari

Launch napari from the same environment:

python -m napari

Prefer python -m napari over bare napari so the plugin loads from this environment (some systems still have an older napari earlier on PATH).

Look for empanada-napari under the Plugins menu.

Returning Users

Create or activate a Python 3.12+ environment, then upgrade:

conda activate empanada-env
python -m pip install -U "napari[all]>=0.9" empanada-napari
python -m napari

Older installs on Python 3.10–3.11 or napari 0.6.x are not compatible with this release. Use a new 3.12+ environment instead of upgrading in place.

Development

Clone the repository, then:

conda create -n empanada-dev python=3.12 -y
conda activate empanada-dev
python -m pip install -U pip
python -m pip install -e ".[dev]"
python -m napari   # launch napari with the plugin
pytest             # run the tests

empanada

GPU Support

Note: Apple Silicon GPUs are supported through torch's MPS backend when available. The setup instructions below apply to NVIDIA GPUs on Windows and Linux.

As for any deep learning models, having a GPU installed on your system will significantly increase model throughput (although we ship CPU optimized versions of all models with the plugin).

This plugin relies on torch for running models. If a GPU was found on your system, then you will see that the "Use GPU" checkbox is checked by default in the "2D Inference" and "3D Inference" plugin widgets. Or if when running inference you see a message that says "Using CPU" in the terminal that means a GPU is not being used.

Make sure that GPU drivers are correctly installed. In terminal or command prompt:

nvidia-smi

If this returns "command not found" then you need to install the driver from NVIDIA. Instead, if if the driver is installed correctly, you may need to switch to the GPU enabled version of torch.

Reinstall torch with a CUDA build matching your system using the selector at pytorch.org, for example:

pip install --upgrade --force-reinstall torch torchvision

Citing this work

If you use results generated by this plugin in a publication, please cite:

@article { Conrad2023,
    author = {Conrad, Ryan and Narayan, Kedar},
    title = {Instance segmentation of mitochondria in electron microscopy images with a generalist deep learning model trained on a diverse dataset},
    journal = {Cell Systems},
    year = {2023},
    month = {Jan},
    day = {18},
    publisher = {Elsevier},
    volume = {14},
    number = {1},
    pages = {58-71.e5},
    issn = {2405-4712},
    doi = {10.1016/j.cels.2022.12.006},
    url = {https://doi.org/10.1016/j.cels.2022.12.006}
}

Metadata

Release files for empanada-napari 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for empanada-napari 1.2.5
File Size Uploaded Provenance Actions
empanada_napari-1.2.5.tar.gz 169.4 kB Without provenance Details for empanada_napari-1.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for empanada-napari 1.2.5
File Interpreter ABI Platform Actions
empanada_napari-1.2.5-py3-none-any.whl Python 3 none any Details for empanada_napari-1.2.5-py3-none-any.whl

Total release size: 360.2 kB

Release files / empanada_napari-1.2.5.tar.gz

Download URL empanada_napari-1.2.5.tar.gz
Size 169.4 kB
Tags Source
SHA-256 checksum
How to use checksums
999026a8558b3c7bb8d7bfa3345624e8c0088ff9e7234e92fa46c2e78d61475b
BLAKE2b-256 checksum
How to use checksums
77f8b15c2d487c1bb4c2789402e0d0b587f4876630251124e3e026eb2ca278ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / empanada_napari-1.2.5-py3-none-any.whl

Download URL empanada_napari-1.2.5-py3-none-any.whl
Size 190.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4d12dd296ddf31ee6ed477fcc1ce4daaff3d5d328c73a45727ec8fda14f0d42
BLAKE2b-256 checksum
How to use checksums
aa259dd662ddf270325598e875dd1e635fe75319b27a7b209ba8361508ca6fb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for empanada-napari 1.2.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page