Skip to main content

Superpixel Labeling Tool

This project provides an interactive GUI to accelerate image annotation using superpixel segmentation. It uses SLIC-based superpixels to divide images into coherent regions, enabling users to label entire segments instead of individual pixels - significantly reducing annotation time and effort.

Superpixel GUI Screenshot


Features

  • PyQt6-based GUI for efficient, manual region labeling using superpixels.
  • Batch-compatible pre-segmentation pipeline using SLIC.
  • Optional overlay visualization to aid labeling accuracy.
  • Jupyter and CLI support for preprocessing.
  • Parallel processing support for faster segmentation.
  • Progress logging in label_log.csv.
  • Auto-save on close, Ctrl+S, and after each frame.
  • Installable via pip or available as standalone binaries.

Note: This tool is designed for binary segmentation labeling. Multi-class annotation is supported through multiple runs, each targeting a different class.


Quick Start Options

Option 1: Use via PyPI (Recommended for Python Users)

pip install superpixel_labeling_tool

Then run:

  • GUI:

    superpixel_labeling_tool
    
  • CLI for preprocessing:

    run_superpixel_segmentation /path/to/dataset --pixels_per_superpixel 150
    

Option 2: Use Prebuilt Executables (No Python Required)

Download the latest release from the Releases page:

  1. Download

    • Linux: superpixel_labeling_tool-linux
    • Windows: superpixel_labeling_tool.exe
  2. Make executable (Linux)

    chmod +x superpixel_labeling_tool-linux
    
  3. Run

    • Linux: ./superpixel_labeling_tool-linux
    • Windows: Double-click superpixel_labeling_tool.exe

On Windows, a security warning may appear. Click “Run anyway” to proceed.

  1. Select Your Dataset Folder
    The folder must contain an input/ subdirectory with images.

GUI Controls

  • Left-click: Select/deselect superpixel.
  • Right-click drag: Brush select.
  • D: Change brush mode.
  • F: Fill enclosed holes.
  • X: Toggle superpixel boundary visibility.
  • C: Toggle segmentation mask visibility.
  • R + Drag on image: Regenerate superpixels in selected region.
  • <- / -> (Arrow keys): Navigate images.
  • Space: Pause/unpause.

Dataset Structure & Workflow

Your dataset must follow this structure:

/path/to/dataset/
├── input/                  # Required: input images
├── superpixel_masks/       # Optional: generated via CLI or GUI
└── segmentation_masks/     # Created by GUI for labeled output

Step 1: Precompute Superpixels (Optional)

run_superpixel_segmentation /path/to/dataset --pixels_per_superpixel 150 --num_workers 4

If superpixel_masks/ is missing, you can generate them via R + drag in the GUI.

Step 2: Launch the GUI

superpixel_labeling_tool

From Source (for Developers)

Prerequisites:

  • Python 3.12
  • Git

Setup:

Clone the repo and run:

Linux/macOS

bash install_env.sh
source .venv/bin/activate

Windows (PowerShell)

.\setup.ps1
.\.venv\Scripts\Activate.ps1

If scripts are blocked, use:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Licensing Notice

This project uses open-source packages, including libraries under the GPLv3 License. Redistribution of modified versions must comply with GPLv3 terms.

Metadata

Release files for superpixel-labeling-tool 0.1.1

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

Source distribution (sdist)

Source distribution for superpixel-labeling-tool 0.1.1
File Size Uploaded Provenance
superpixel_labeling_tool-0.1.1.tar.gz 54.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for superpixel-labeling-tool 0.1.1
File Interpreter ABI Platform
superpixel_labeling_tool-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 96.3 kB

Release files / superpixel_labeling_tool-0.1.1.tar.gz

Download URL superpixel_labeling_tool-0.1.1.tar.gz
Size 54.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6dd8c9f689fd7e5ce4a33d676afeaadf7367a811d2214a4466a6f42158a6265c
BLAKE2b-256 checksum
How to use checksums
989b406458587529e517baed4475d130f0588f960bccb80ad1a35c0961aafc6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / superpixel_labeling_tool-0.1.1-py3-none-any.whl

Download URL superpixel_labeling_tool-0.1.1-py3-none-any.whl
Size 41.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c32be44ed0a64ba9220c7e7935fd479e5692ef9b8e44dbe354329dec86245f4a
BLAKE2b-256 checksum
How to use checksums
b24a3005d49ce060784788ce34118d31f6a39c06cdf98ad84dd6ba16085a8726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for superpixel-labeling-tool 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1 This release

2 release files No 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