Skip to main content

An image segmentation GUI for generating ML ready mask tensors and annotations.

Project description

LazyLabel Logo LazyLabel Cursive

AI-Assisted Image Segmentation Made Simple

LazyLabel combines Meta's Segment Anything Model (SAM) with intuitive editing tools for fast, precise image labeling. Perfect for machine learning datasets, computer vision research, and annotation workflows.

LazyLabel Screenshot


🚀 Quick Start

Installation

pip install lazylabel-gui
lazylabel-gui

Usage

  1. Open Folder → Select your image directory
  2. Click on image → AI generates instant masks
  3. Fine-tune → Edit polygons, merge segments, adjust classes
  4. Export → Clean .npz files ready for ML training

✨ Key Features

🧠 AI-Powered Segmentation

  • One-click masking with Meta's SAM model
  • Smart prompting via positive/negative points
  • Fragment filtering to remove small artifacts
  • Multiple model support (VIT-H, VIT-L, VIT-B)

🎨 Advanced Editing

  • Polygon drawing with full vertex control
  • Bounding box annotation mode
  • Shape merging and class assignment
  • Edit mode for precision adjustments

⚡ Productivity Tools

  • Image adjustments (brightness, contrast, gamma)
  • Customizable hotkeys for all functions
  • Undo/redo with full history
  • Auto-save and session persistence

📊 ML-Ready Outputs

  • One-hot encoded .npz format
  • Clean class separation with shape (H, W, Classes)
  • Batch processing support
  • Existing mask loading for iterative work

⌨️ Essential Controls

Mode Key Action
AI Segmentation 1 Point mode for SAM
Left Click Add positive point
Right Click Add negative point
Space Save segment
Manual Drawing 2 Polygon mode
Left Click Add vertex
Enter Close polygon
Editing E Selection mode
R Edit selected shapes
M Merge selected segments
Navigation Q Pan mode
W/A/S/D Pan image
Scroll Zoom in/out

💡 All hotkeys are customizable - Click "Hotkeys" button to personalize shortcuts


📦 Output Format

LazyLabel exports clean, ML-ready data:

import numpy as np

# Load your labeled data
data = np.load('your_image.npz')
mask = data['mask']  # Shape: (height, width, num_classes)

# Each channel is a binary mask for one class
class_0_mask = mask[:, :, 0]  # Binary mask for class 0
class_1_mask = mask[:, :, 1]  # Binary mask for class 1
# ... and so on

Perfect for:

  • Semantic segmentation training
  • Instance segmentation datasets
  • Computer vision research
  • Automated annotation pipelines

🛠️ Advanced Features

Image Enhancement

  • Brightness/Contrast adjustment sliders
  • Gamma correction for better visibility
  • Live preview of adjustments
  • SAM integration with adjusted images

Smart Filtering

  • Fragment threshold removes small segments
  • Size-based filtering (0-100% of largest segment)
  • Quality control for clean annotations

Professional Workflow

  • Class management with custom aliases
  • Segment organization with sortable tables
  • Batch export for large datasets
  • Model switching without restart

🏗️ Development

Installation from Source

git clone https://github.com/dnzckn/LazyLabel.git
cd LazyLabel
pip install -e .
lazylabel-gui

Code Quality & Testing

# Linting & formatting
ruff check . && ruff format .

# Run tests with coverage
python -m pytest --cov=lazylabel --cov-report=html

# All tests pass with 60%+ coverage

Architecture

  • Modular design with clean separation of concerns
  • Signal-based communication between components
  • Extensible model system for new SAM variants
  • Comprehensive test suite with 95% speed optimization

📋 Requirements

  • Python 3.10+
  • OpenCV for image processing
  • PyQt6 for GUI
  • NumPy for data handling
  • 2.5GB disk space for SAM model (auto-downloaded)

🤝 Contributing

LazyLabel welcomes contributions! Check out our:


🙏 Acknowledgments

LazyLabel was inspired by and builds upon the excellent work of:


☕ Support

If LazyLabel saves you time on annotation tasks, consider supporting the project!


Made with ❤️ for the computer vision community

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

lazylabel_gui-1.1.8.tar.gz (70.1 kB view details)

Uploaded Source

Built Distribution

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

lazylabel_gui-1.1.8-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

Details for the file lazylabel_gui-1.1.8.tar.gz.

File metadata

  • Download URL: lazylabel_gui-1.1.8.tar.gz
  • Upload date:
  • Size: 70.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for lazylabel_gui-1.1.8.tar.gz
Algorithm Hash digest
SHA256 2ddad8aded3a9a27a70c3ac117d152c55865c84121a7f6c6c37e96d8e14c420f
MD5 22d96d8d02b7ca5e8a72ddecdc26c275
BLAKE2b-256 08e9ba625461822eadc293f2e1c7646d15b159f9c5f3d0c945fa995dfae32d37

See more details on using hashes here.

File details

Details for the file lazylabel_gui-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: lazylabel_gui-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 78.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for lazylabel_gui-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 28d2dc527ca329c8795771a5610c4b5ad6b7c6a81cc15d973fb69c941a7c0d58
MD5 d71d61db428ef45e61a519482eb18fd7
BLAKE2b-256 98b5c375e368325d1053798dd23f2b4918bd77fa5fcac69e3123bf376e84e592

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