Skip to main content

napari plugin — full microplate image pipeline (align plate → detect wells → classify wells)

Project description

napari-microplate

PyPI License: AGPL-3.0 napari hub

A napari plugin for end-to-end analysis of microbiology microplate images: align the plate, detect every well, and classify each well as Growth / NoGrowth / NoAgar.

The plugin runs a three-stage pipeline directly in the napari viewer and renders the result as overlay layers you can inspect interactively.

raw microplate image
   │
   ├──► Stage 1 — Align plate       (EfficientNet-B3 corner regression, grayscale)
   │       4-corner detection → perspective warp → canonical plate
   ├──► Stage 2 — Detect wells      (YOLOv8n, single-channel grayscale, ch=1)
   │       bounding box per well
   └──► Stage 3 — Classify wells    (Random Forest)
           Growth / NoGrowth / NoAgar

Installation

pip install napari-microplate

This installs the plugin and all its pure-Python dependencies, including PyTorch (CPU build). On first run the model weights (~700 MB total) are downloaded automatically from the HuggingFace Hub and cached under ~/.cache/napari_microplate/.

GPU acceleration (optional, recommended)

The CPU PyTorch build works but Stage 1 + Stage 2 are noticeably faster on GPU. To use a CUDA GPU, install a CUDA-enabled PyTorch before or after the plugin:

pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126

The plugin auto-detects CUDA via torch.cuda.is_available().

Usage

  1. Launch napari:

    napari
    
  2. Open a raw microplate image (File → Open file(s) or drag-and-drop).

  3. Start the plugin: Plugins → Microplate Pipeline.

  4. In the dock widget:

    • pick the Image layer holding your microplate image,
    • (optional) tick Save PNG and choose a Save dir,
    • click Run Pipeline.

Two new layers are added to the viewer:

Layer Type Content
aligned_plate Image (gray) Plate after Stage 1 perspective warp
wells Shapes (rectangles) One box per well, colored by predicted class

Well counts (Growth / NoGrowth / NoAgar) are shown in the napari status bar.

Configuration

Environment variable Purpose Default
MICROPLATE_HF_REPO HuggingFace repo id for the weights tiendoan274/napari-microplate-weights
MICROPLATE_WEIGHTS_DIR Local folder of pre-downloaded weights (skip download) unset

To run fully offline, download the three weight files into a folder and set MICROPLATE_WEIGHTS_DIR to that folder:

$MICROPLATE_WEIGHTS_DIR/
  stage1_efficientnet_b3.pt
  stage2_yolov8n_well.pt
  stage3_random_forest.joblib

Programmatic use (without the GUI)

from napari_microplate._pipeline import MicroplatePipeline

pipe = MicroplatePipeline()          # loads weights lazily on first run
result = pipe.run("plate.png")       # path to a raw microplate image

print(result["boxes"])               # [(x1,y1,x2,y2,conf), ...]
print(result["classes"])             # [0, 1, 2, ...]  (0=Growth,1=NoGrowth,2=NoAgar)

License

Copyright (C) 2026 Tien Doan. Distributed under the GNU Affero General Public License v3.0 or later (AGPL-3.0+) — see LICENSE.

This package vendors a modified copy of Ultralytics 8.3.2 (AGPL-3.0) under napari_microplate/_vendor/ to support single-channel grayscale well detection. See NOTICE for details.

Citation

If you use this plugin in published research, please cite the accompanying paper (see paper/ in the source repository).

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

napari_microplate-0.1.0.tar.gz (546.3 kB view details)

Uploaded Source

Built Distribution

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

napari_microplate-0.1.0-py3-none-any.whl (689.2 kB view details)

Uploaded Python 3

File details

Details for the file napari_microplate-0.1.0.tar.gz.

File metadata

  • Download URL: napari_microplate-0.1.0.tar.gz
  • Upload date:
  • Size: 546.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for napari_microplate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac4ea7e8c8080bfabeac65e409269cb15bb20409049c1e7cac0f12844a8eeeb2
MD5 848bbc8bc11a8edc83937d7472e0788d
BLAKE2b-256 fdae54372a4c38cb34885890fc1dcd60532a656472287c2ed4c8da0f0f63b79b

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_microplate-0.1.0.tar.gz:

Publisher: publish.yml on TienDoan274/napari-microplate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file napari_microplate-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_microplate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c92820d89e5f82234ae28e0f78e010c7bae974ee57e4dda7e01cc3a2c3f16d
MD5 0e7d1d851fc9a564df7723184793458e
BLAKE2b-256 8f4c31857eefde425104053bce6890950d2270d36384bd0b4afc5dc23e4ca99f

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_microplate-0.1.0-py3-none-any.whl:

Publisher: publish.yml on TienDoan274/napari-microplate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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