Skip to main content

Allow to view a dataset image by image and edit their labels

Project description

Dataset Viewer

License Supported Python versions Python package index Python package index download statistics Development Status

A small napari wrapper that lets you step through a folder of images and paint / edit segmentation labels for each one. Labels are saved to disk as PNGs, one per image.

Install

It is recommended to install the dataset viewer into a virtual environment. To install, run:

python -m pip install "dataset_viewer[gui]"

The [gui] extra installs PyQt5 as the napari Qt backend. Omit it if you already have a Qt binding available in your environment.

Python version — developed and tested on Python 3.9. requires-python = ">=3.9" allows newer interpreters, but no testing has been done on 3.10+; use at your own risk.

Data layout

The viewer expects a directory with two sub-folders:

<data_path>/
├── images/     # .jpg, .jpeg or .png source images
└── labels/     # .png label masks, created/updated by the viewer

Labels are always written as PNG (other formats compress and corrupt label values) and named after the source image stem — e.g. images/cat_01.jpglabels/cat_01.png. An image with an all-zero label array is represented by the absence of the label file; the viewer deletes the file when you clear a mask.

Usage

from pathlib import Path
from dataset_viewer import Viewer, Dataset

Viewer(Dataset(Path("path/to/data"))).start()

Dataset() with no argument falls back to ../../data relative to the current working directory, so prefer passing an explicit path.

Key bindings

Key Action
Left Previous image (saves current mask)
Right Next image (saves current mask)
l Print the active layer name
Escape Close the viewer

Painting/erasing uses napari's standard labels-layer controls.

License

MIT — see LICENSE.

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

dataset_viewer-1.0.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

dataset_viewer-1.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file dataset_viewer-1.0.1.tar.gz.

File metadata

  • Download URL: dataset_viewer-1.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dataset_viewer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c98ae0b8882ab7102f24ed602ce464d1f889601b25a08fcc7408d0f989dab14e
MD5 6ecb00a433bc408b48e8d8fb320a04b8
BLAKE2b-256 07f529a2793cd75cf60054031fc5d56c1b35f4dd6c0c463b79162d39d58b7b0f

See more details on using hashes here.

File details

Details for the file dataset_viewer-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dataset_viewer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dataset_viewer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66e86b3f40fd620cbdf121ceac06b7be9ef97630b2fd24b4ea213c877d9f7ee5
MD5 dc62f1caf537a4a605c9842cd22194d6
BLAKE2b-256 b6eb25480262abf82ac16d88887a14d37edf2dfc75142bbf75d75f891487a96b

See more details on using hashes here.

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