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.1.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.1.0
File Size Uploaded Provenance
cellseg_metrics-0.1.0.tar.gz 7.4 kB With provenance Details

Built distribution (wheel)

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

Total release size: 17.6 kB

Release files / cellseg_metrics-0.1.0.tar.gz

Download URL cellseg_metrics-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
24a80215f468d22ed019fe25c54d5925fc0e84e8c8a74252a6cb9a80fea71a14
BLAKE2b-256 checksum
How to use checksums
7838d651090cdf854f558b3cebf74c5c62a6e8ba3c70342b66ffc356b467a9b2
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.1.0-py3-none-any.whl

Download URL cellseg_metrics-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
919ca761b9ab9ece06d6bf8521168b3822dd415adeb4fcced0c02f48c09b86f8
BLAKE2b-256 checksum
How to use checksums
27e0215a5c5a9c45fb9159f2eeaef74e4e8bfbfaabc2e34cadcc09ce5ef75de7
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.1.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.1.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.1.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