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 defaults to ./data relative to the current working directory.

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.3.tar.gz (5.3 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.3-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataset_viewer-1.0.3.tar.gz
  • Upload date:
  • Size: 5.3 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.3.tar.gz
Algorithm Hash digest
SHA256 ec18ccfe4da359adb0ed736e318eed704527bd3ab2177a52594487fb72b245f8
MD5 b5ede68cdb93ae18cd12887e9829e499
BLAKE2b-256 4a967ae5f3db4fea33672a9f0f78d8d67efb7ac907abbb7226e81f6ed2abe179

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataset_viewer-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4de4a6a02af54f679f1b4fc2cdee9af5a70f5a1c415566d2cb5d074f88498943
MD5 24206697e5d90e40993b9dc1167a2e3e
BLAKE2b-256 6a171adbb764df2e0d58c312337adfd577455f0e4c16ee219ebcdd61bc71ae1e

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