Allow to view a dataset image by image and edit their labels
Project description
Dataset Viewer
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.jpg → labels/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataset_viewer-1.0.2.tar.gz.
File metadata
- Download URL: dataset_viewer-1.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
408d488acdc661b99a3571357ca095b4f3855393b0856655e22ce209ba03fcbb
|
|
| MD5 |
48c878c81c766bdc3ee85e267bf6145a
|
|
| BLAKE2b-256 |
dcc950802b57af14349a21f51d732bcc4990f5f4ff2230a3711f40b1bca15020
|
File details
Details for the file dataset_viewer-1.0.2-py3-none-any.whl.
File metadata
- Download URL: dataset_viewer-1.0.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c807f1ef2f6ad8625307245f1e14299c58e3fe6d5c095bcef7a0d4d6d0f85b43
|
|
| MD5 |
b95b96d1ff634fcc9d875476b12750a2
|
|
| BLAKE2b-256 |
5db01b4b450bf2206c072c9abfa02587bc48295b0ed40a9a39471ab96a1cbd4a
|