Skip to main content

Tool for superpixel-based annotation and segmentation mask generation.

Project description

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.

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

superpixel_labeling_tool-0.1.1.tar.gz (54.4 kB view details)

Uploaded Source

Built Distribution

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

superpixel_labeling_tool-0.1.1-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file superpixel_labeling_tool-0.1.1.tar.gz.

File metadata

File hashes

Hashes for superpixel_labeling_tool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6dd8c9f689fd7e5ce4a33d676afeaadf7367a811d2214a4466a6f42158a6265c
MD5 4fbd8b0c0446a85b6097b2b2c04b4a2a
BLAKE2b-256 989b406458587529e517baed4475d130f0588f960bccb80ad1a35c0961aafc6a

See more details on using hashes here.

File details

Details for the file superpixel_labeling_tool-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for superpixel_labeling_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c32be44ed0a64ba9220c7e7935fd479e5692ef9b8e44dbe354329dec86245f4a
MD5 5aa323af1bc4b2a4cb443a9f4c5f48cb
BLAKE2b-256 b24a3005d49ce060784788ce34118d31f6a39c06cdf98ad84dd6ba16085a8726

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