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

Uploaded Python 3

File details

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

File metadata

  • Download URL: lazylabel_gui-1.1.7.tar.gz
  • Upload date:
  • Size: 54.0 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.7.tar.gz
Algorithm Hash digest
SHA256 de386cdf4a117c69ccb5b43ef079899d79253583b43888225f6a3708d85038b6
MD5 da7b754c87c479d8dcfb4685504cb24e
BLAKE2b-256 ec1ca5e50042147bbcb6f4ba4930af3818181acd4fde351c8ff2882f6912f927

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lazylabel_gui-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 60.0 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf8500be330f544ba09894d67e132e97ce577566eab32fc60d68d05afa9ebe1
MD5 c93b21b010b7c0b7c943a2fda9f53d12
BLAKE2b-256 ec7b89b3a4f00587187e77b800ab56044000c7c5f8cb2c8c90ce988f8ee4678a

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