Image Polygonal Annotation with Python - V2 with 45x Faster Performance
Project description
LabelMe V2
Image Annotation Tool with Advanced Features & Performance Optimizations
Enhanced fork of wkentaro/labelme with 45x faster loading & productivity features
🎯 What's New in This Fork
This enhanced version adds powerful polygon editing features, 45x faster image loading, and improved defaults to speed up your annotation workflow:
⚡ Breakthrough Performance: 45x Faster Loading
The biggest improvement in this fork - optimized TIFF/JPG/PNG loading for massive images:
| Image Size | Before | After | Speedup |
|---|---|---|---|
| 6050×12300 TIFF (71MB) | 10 seconds | 220ms | 45x faster ⚡ |
| Large JPG/PNG | 2-3 seconds | 200-400ms | 10x faster |
| Cached images | N/A | <200ms | Instant navigation |
How it works:
- ✅ Skip slow PIL conversion - load directly with Qt
- ✅ Skip JSON base64 decode - load from file when possible
- ✅ Smart image caching (3-image LRU cache)
- ✅ Automatic downsampling for huge images
Perfect for: Industrial inspection, PCB analysis, medical imaging, aerial photography
✨ New Features
1. Performance Optimizations ⚡
Smooth annotation even with massive images and many polygons.
- Viewport Culling: 5-10x faster rendering with 100+ polygons
- Adaptive Downsampling: 4x less memory for large images (16000×8000)
- Optimized Loading: 45x faster for large TIFF files
- Configurable thresholds and quality settings
- Works automatically - no manual intervention
Example: Annotate 16000×8000 PCB images with 500 polygons smoothly on 4GB RAM.
2. Enhanced Zoom (Up to 5000%)
Maximum zoom increased from 1000% to 5000% (50x magnification) for tiny defect annotation.
- Configurable maximum zoom level
- Adjustable zoom increment for smooth control
- Perfect for PCB defects, microscopy, surface inspection
- Mouse wheel zooms centered on cursor position
Example: Annotate hairline cracks or solder bridges with pixel-level precision.
3. Multiple Point Addition (Ctrl+M)
Quickly refine polygon boundaries by adding multiple evenly-spaced points along edges.
- Hover over any polygon edge in edit mode
- Press
Ctrl+Mand enter number of points (1-100) - Points are automatically distributed evenly
- Perfect for curved edges or complex boundaries
Example: Add 10 points to a curved car windshield edge in one action instead of clicking 10 times.
4. Polygon Merge (Ctrl+Shift+M)
Merge multiple polygons into one or batch-apply labels to disconnected objects.
- Select 2+ polygons (hold
Ctrlwhile clicking) - Press
Ctrl+Shift+Mto merge - Smart handling:
- Connected/overlapping → Single merged polygon
- Disconnected objects → Multiple polygons with same label
- Mixed → Intelligent separation based on connectivity
Example: Annotate 20 cars by drawing rough boxes, select all, merge once - all labeled "car" instantly.
5. Dark Mode (View → Dark Mode)
Eye-friendly dark theme inspired by VS Code.
- Toggle instantly via View menu
- Persistent setting saved in config
- Reduces eye strain during long sessions
- Professional color scheme
6. Improved Default Settings
Better defaults for faster annotation workflow:
| Setting | Old Default | New Default | Why? |
|---|---|---|---|
auto_save |
false |
true |
Never lose work |
store_data |
true |
false |
Smaller JSON files |
keep_prev_brightness_contrast |
false |
true |
Consistent visuals |
dark_mode |
N/A | true |
Eye comfort |
canvas.fill_drawing |
true |
false |
See through shapes |
canvas.num_backups |
10 | 20 | More undo history |
max_zoom |
1000% | 5000% | 5x more zoom |
7. Better Keyboard Shortcuts
More intuitive shortcuts that don't conflict:
| Action | Old Shortcut | New Shortcut |
|---|---|---|
| Create Polygon | Ctrl+N |
Ctrl+Shift+C |
| Create Rectangle | Ctrl+R |
Ctrl+Shift+X |
| Edit Polygon | Ctrl+J |
Ctrl+Shift+V |
📦 Installation
From PyPI (Recommended)
pip install labelmev2
From Source
# Clone this enhanced version
git clone https://github.com/jakhon37/LabelMeV2.git
cd LabelMeV2
# Install with pip
pip install -e .
# Or use uv (faster)
uv pip install -e .
🚀 Quick Start
# Launch labelme
labelme
# Enable dark mode (if not already on)
View → Dark Mode
# Try the new features:
# 1. Draw a polygon
# 2. Press Ctrl+Shift+V to enter edit mode
# 3. Hover over an edge and press Ctrl+M
# 4. Enter "5" to add 5 points
# 5. Adjust the points as needed
New Feature Quick Reference
| Feature | Shortcut | Usage |
|---|---|---|
| High Zoom (5000%) | Mouse wheel | Scroll on image to zoom up to 50x magnification |
| Add Multiple Points | Ctrl+M |
Edit mode → Hover edge → Ctrl+M → Enter count |
| Merge Polygons | Ctrl+Shift+M |
Select multiple → Ctrl+Shift+M |
| Dark Mode | View menu | View → Dark Mode (toggles instantly) |
| Edit Mode | Ctrl+Shift+V |
Enter polygon editing mode |
📚 Documentation
- New Features Guide: docs/NEW_FEATURES.md
- Contributing: CONTRIBUTING.md
- Original Documentation: See wkentaro/labelme for:
- Basic usage and examples
- Export formats (VOC, COCO)
- AI-assisted annotation
- Command-line tools
- Video annotation
- Classification/segmentation workflows
🎬 Examples
Polygon Refinement Workflow
1. Draw rough polygon around object
2. Ctrl+Shift+V (edit mode)
3. Hover over curved edge
4. Ctrl+M → Enter "8" → OK
5. Adjust 8 new points to match boundary perfectly
Batch Labeling Workflow
1. Draw boxes around 15 cars (quick rough boxes)
2. Ctrl+Click each box to select all
3. Ctrl+Shift+M (merge)
4. Result: 15 separate polygons all labeled "car"
🔧 Configuration
Enhanced defaults in ~/.labelmerc:
# New/modified defaults
auto_save: true
dark_mode: true
store_data: false
keep_prev_brightness_contrast: true
# Zoom settings
zoom_increment: 1.45 # 45% per step (ultra fast for quick navigation)
max_zoom: 5000 # 5000% = 50x magnification
# New features config
default_num_points_to_add: 1
shortcuts:
add_multiple_points: Ctrl+M
merge_polygons: Ctrl+Shift+M
create_polygon: Ctrl+Shift+C
create_rectangle: Ctrl+Shift+X
edit_polygon: Ctrl+Shift+V
🤝 Contributing
Contributions welcome! See CONTRIBUTING.md for:
- Development setup
- Code style guidelines
- Testing procedures
- Feature implementation details
📄 License
GPL-3.0-only - Same as original wkentaro/labelme
🙏 Acknowledgments & Credits
This project is based on wkentaro/labelme
- Original Author: Kentaro Wada
- Original Repository: https://github.com/wkentaro/labelme
- License: GPL-3.0 (maintained in this fork)
This enhanced version builds upon the excellent foundation of the original labelme, adding:
Performance Enhancements by Jakhongir Nodirov:
- ⚡ 45x faster image loading for large TIFF/JPG/PNG files
- 🖼️ Smart image caching with LRU eviction
- 🎨 Viewport culling for smooth rendering with hundreds of polygons
- 📊 Optimized memory usage for massive images
New Features:
- 🔍 Enhanced zoom up to 5000% for tiny defect inspection
- ➕ Multiple point addition (Ctrl+M) for quick polygon refinement
- 🔗 Polygon merge (Ctrl+Shift+M) for batch labeling
- 🌙 Dark mode for comfortable annotation sessions
- ⚙️ Improved default settings for faster workflows
Maintained by: Jakhongir Nodirov (jakhon37@gmail.com)
For the complete original labelme documentation and features, please visit the official repository.
⭐ Support
If you find these enhancements useful:
- ⭐ Star this repository
- 🐛 Report issues on GitHub Issues
- 💬 Share feedback and suggestions
- ⭐ Also star the original labelme project!
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
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 labelmev2-2.0.1.tar.gz.
File metadata
- Download URL: labelmev2-2.0.1.tar.gz
- Upload date:
- Size: 11.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc7411f9cfe55d5f850000acb13938b34259420553cbb3c851fb53b206361829
|
|
| MD5 |
8072bb882b5ceffe7332a57a3769dfd3
|
|
| BLAKE2b-256 |
ffa6676e4016057a1f7fcf0435516285350378ac4151699398e78d3e61e86ffc
|
File details
Details for the file labelmev2-2.0.1-py3-none-any.whl.
File metadata
- Download URL: labelmev2-2.0.1-py3-none-any.whl
- Upload date:
- Size: 512.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ab9bab69e9f4679af9e70b61e1cc788233a1a5b9ea4705def34e056f1ad49b7
|
|
| MD5 |
d9923d80c9c951fbbfe736ae5488fd8d
|
|
| BLAKE2b-256 |
23d2e36abe34e8b6fde4e50cdc8f254fba79318cb0b093b9ee83c3d788e4dbf2
|