Skip to main content

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

Project description

LazyLabel

LazyLabel Logo LazyLabel Cursive

AI-Assisted Image Segmentation for Machine Learning Applications

LazyLabel integrates Meta's Segment Anything Model (SAM) with advanced editing capabilities to enable efficient, high-precision image annotation. Designed for computer vision research and machine learning dataset preparation.

LazyLabel Screenshot

Quick Start

Installation

pip install lazylabel-gui
lazylabel-gui

Optional: SAM 2.1 Support

For enhanced performance with SAM 2.1 models:

pip install git+https://github.com/facebookresearch/sam2.git

Note: SAM 2.1 is optional - LazyLabel downloads SAM 1.0 models by default.

Usage

  1. Open Folder - Select your image directory
  2. AI Segmentation - Click on objects for automatic mask generation
  3. Manual Refinement - Edit polygons, merge segments, adjust classifications
  4. Export - Generate .npz files with one-hot encoded masks for ML training

Key Features

  • One-click AI segmentation with Meta's SAM and SAM 2.1 models
  • Manual polygon drawing with full vertex control
  • Smart editing tools - merge segments, adjust class names, and class order
  • ML-ready exports - One-hot encoded .npz format and .json for YOLO format
  • Image enhancement - brightness, contrast, gamma adjustment
  • Advanced image viewer - zoom, pan, and real-time adjustments
  • Edge cropping - define custom crop areas to focus on specific regions
  • Undo/Redo system - full history of all actions
  • Auto-saving - automatic saving of labels when navigating between images
  • Advanced filtering - FFT thresholding and color channel thresholding
  • Customizable hotkeys for all functions

Essential Hotkeys

Action Key Description
AI Mode 1 Point-click segmentation
Draw Mode 2 Manual polygon drawing
Edit Mode E Select and modify shapes
Save Segment Space Confirm current mask
Merge M Combine selected segments
Pan Q + drag Navigate large images
Positive Point Left Click Add to segment
Negative Point Right Click Remove from segment

Note: All hotkeys are fully customizable - Click "Hotkeys" button to personalize your workflow.


Output Format

LazyLabel exports data in standardized formats optimized for machine learning workflows:

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]  # Background
class_1_mask = mask[:, :, 1]  # Object type 1
class_2_mask = mask[:, :, 2]  # Object type 2

Ideal for:

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

Development

Requirements: Python 3.10+, ~2.5GB disk space for SAM models (auto-downloaded)

Installation from Source

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

Testing & Quality

# Run test suite (272 tests)
pytest --tb=short

# Code quality checks
ruff check --fix src/

Architecture

  • Modular design with clean component separation
  • Signal-based communication between UI elements
  • Extensible model system for SAM 1.0 and SAM 2.1 variants
  • Comprehensive test suite (272 tests with extensive coverage)
  • Multi-view support for simultaneous image processing

Contributing

LazyLabel welcomes contributions! Please review:


Acknowledgments

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lazylabel_gui-1.3.6.tar.gz
Algorithm Hash digest
SHA256 5bdbcd9c905a66e0df467ff8006252f5c7f47746a282c33002e66335a60707b1
MD5 d514eaf033eb91c79bb282280f99fc6a
BLAKE2b-256 07f77f9b1e73e585a9479d0dba86b1ee1168df115f785c76c579ae6e356c75e1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lazylabel_gui-1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3a9676ec301756416b875be0cb3984419e3eecdbcd3ced702785bb07d1d73a
MD5 02fdf331ebd5afbeb869469c039988fb
BLAKE2b-256 60090b8f02aa17db41376cd7efb713da39e2113d26c1fa9a449b21c2d5202d7f

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