Skip to main content

Cell segmentation metrics

Binary, multiclass and instance segmentation metrics using NumPy and SciPy. PyTorch and slide-reading packages are not required.

From a source checkout, install this package independently:

python -m pip install ./packages/metrics

Compare integer instance masks, where zero is background and positive values identify separate nuclei:

import numpy as np

from cellseg_metrics import panoptic_quality

reference = np.array([[0, 1, 1, 0, 2, 2]])
prediction = np.array([[0, 7, 7, 0, 0, 0]])

scores = panoptic_quality(reference, prediction)
print(scores)

pq measures instance segmentation quality, dq measures detection quality, and sq measures overlap quality for matched instances. Instance IDs do not need to match between the masks.

The full cellseg-models-pytorch library preserves its existing cellseg_models_pytorch.metrics imports and uses this same implementation. See the metrics reference for inputs, outputs and empty-mask behavior.

Metadata

Release files for cellseg-metrics 0.2.0

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

Source distribution (sdist)

Source distribution for cellseg-metrics 0.2.0
File Size Uploaded Provenance
cellseg_metrics-0.2.0.tar.gz 10.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cellseg-metrics 0.2.0
File Interpreter ABI Platform
cellseg_metrics-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / cellseg_metrics-0.2.0.tar.gz

Download URL cellseg_metrics-0.2.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dac253c7e2ac106376ba470102dede64a38fc929a384f75ea3e1057a316ce630
BLAKE2b-256 checksum
How to use checksums
b6160491f59501c7ef7c91075c4bbb709d2c2dc66e7fa0c4c90144b0391787de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / cellseg_metrics-0.2.0-py3-none-any.whl

Download URL cellseg_metrics-0.2.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45d3e33ac82ba16271eeea6bcc2832a8925f44b5fcf7a60f9b2a934b9d04b084
BLAKE2b-256 checksum
How to use checksums
ed5ef48b5a60aedd7a1a82392c9665d59f651ccc7dc09667b35bc1dcfb25bfdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for cellseg-metrics 0.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cellseg_metrics-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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