An image segmentation GUI for generating ML ready mask tensors and annotations.
Project description
LazyLabel
AI-Assisted Image Segmentation for Machine Learning Dataset Preparation
LazyLabel combines Meta's Segment Anything Model (SAM) with comprehensive manual annotation tools to accelerate the creation of pixel-perfect segmentation masks for computer vision applications.
Quick Start
pip install lazylabel-gui
lazylabel-gui
From source:
git clone https://github.com/dnzckn/LazyLabel.git
cd LazyLabel
pip install -e .
lazylabel-gui
Requirements: Python 3.10+, 8GB RAM, ~2.5GB disk space (for model weights)
Core Features
Annotation Tools
- AI (SAM): Single-click segmentation with point-based refinement (SAM 1.0 & 2.1, GPU/CPU)
- Polygon: Vertex-level drawing and editing for precise boundaries
- Box: Bounding box annotations for object detection
- Subtract: Remove regions from existing masks
Annotation Modes
- Single View: Fine-tune individual masks with maximum precision
- Multi View: Annotate up to 4 images simultaneously—ideal for objects in similar positions with slight variations
- Sequence: Propagate a refined mask across thousands of frames using SAM 2's video predictor
Image Processing
- FFT filtering: Remove noise and enhance edges
- Channel thresholding: Isolate objects by color
- Border cropping: Zero out pixels outside defined regions in saved outputs
- View adjustments: Brightness, contrast, gamma correction, color saturation
Export Formats
One-hot encoded tensors (.npz)
import numpy as np
data = np.load('image.npz')
mask = data['mask'] # Shape: (height, width, num_classes)
# Each channel represents one class
sky = mask[:, :, 0]
boats = mask[:, :, 1]
cats = mask[:, :, 2]
dogs = mask[:, :, 3]
Normalized polygoon coordinates (.txt)
0 0.234 0.456 0.289 0.478 0.301 0.523 ...
1 0.567 0.123 0.598 0.145 0.612 0.189 ...
Class Aliases (.json)
{
"0": "background",
"1": "person",
"2": "vehicle"
}
SAM 2.1 Setup
SAM 1.0 models are downloaded automatically on first use. For SAM 2.1 (improved accuracy, required for Sequence mode):
- Install SAM 2:
pip install git+https://github.com/facebookresearch/sam2.git - Download a model (e.g.,
sam2.1_hiera_large.pt) from the SAM 2 repository - Place in LazyLabel's models folder:
- Via pip:
~/.local/share/lazylabel/models/ - From source:
src/lazylabel/models/
- Via pip:
- Select the model from the dropdown in settings
Building Windows Executable
Create a standalone Windows executable with bundled models for offline use:
Requirements:
- Windows (native, not WSL)
- Python 3.10+
- PyInstaller:
pip install pyinstaller
Build steps:
git clone https://github.com/dnzckn/LazyLabel.git
cd LazyLabel
python build_system/windows/build_windows.py
The executable will be created in dist/LazyLabel/. The entire folder (~7-8GB) can be moved anywhere and runs offline.
Documentation
- Usage Manual - Comprehensive feature guide
- Architecture Guide - Technical implementation details
- Changelog - Version history and release notes
- GitHub Issues - Report bugs or request features
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lazylabel_gui-1.6.2.tar.gz.
File metadata
- Download URL: lazylabel_gui-1.6.2.tar.gz
- Upload date:
- Size: 220.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad66bf029ba13038dbe1d38b6af29723c9fa3da187ebc39d146a8aac2d1185b8
|
|
| MD5 |
a804f8187465c7b0f438d5447ad64cbb
|
|
| BLAKE2b-256 |
a4f57d81e81b29ff6d75327d0d7eaf37b0ebb5658cd8c53f64b1003d15ade58d
|
File details
Details for the file lazylabel_gui-1.6.2-py3-none-any.whl.
File metadata
- Download URL: lazylabel_gui-1.6.2-py3-none-any.whl
- Upload date:
- Size: 259.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
571f3cf3dd281f18aebd2e3bcce428ce2dfa078abf05abfbfb01859eb74f56b3
|
|
| MD5 |
015c6c57f178920ae30b7bb44a5d0f0d
|
|
| BLAKE2b-256 |
c6343423cee3a14077b453ac7018dc5e58c2935aae655988f2a5dc828b0bd601
|