A modular image annotation tool for bounding box labeling, refactored for better maintainability and extensibility.
- Modular Architecture: Code organized into logical modules for easier maintenance
- Type Hints: Full type annotations for better code understanding and IDE support
- Clean Code: Improved readability and maintainability
- Multiple Annotation Formats: Support for both YOLO and PASCAL VOC formats
- Video Tracking: Support for tracking objects across video frames
- Interactive UI: Intuitive interface with mouse and keyboard controls
pip install -r requirements.txtpython -m openlabeling.app --input_dir input --output_dir output --tracker KCFOr after installing the package:
openlabeling --input_dir input --output_dir output --tracker KCF-i, --input_dir: Path to input directory (default: 'input')-o, --output_dir: Path to output directory (default: 'output')-t, --thickness: Bounding box and cross line thickness (default: 1)--draw-from-PASCAL-files: Draw bounding boxes from the PASCAL files (default: YOLO)--tracker: Tracker type to use (default: 'KCF')-n, --n_frames: Number of frames to track object for (default: 200)
a/d: Navigate between imagesw/s: Navigate between classesLeft Click: Start/finish drawing a bounding boxDouble Click: Select a bounding boxRight Click: Delete selected bounding boxe: Toggle edge detectionp: Start tracking selected objects in videoh: Show helpq: Quit
app.py: Main application logicconfig.py: Configuration and argument parsingutils.py: Utility functionsbbox_handler.py: Bounding box operationstracker.py: Object tracking functionality
- Code Organization: Split monolithic code into logical modules
- Type Safety: Added comprehensive type hints throughout
- Documentation: Added docstrings and comments for clarity
- Maintainability: Reduced complexity by separating concerns
- Error Handling: Improved error handling patterns
- Code Reusability: Created reusable utility functions
This refactored version is based on the original OpenLabeling project with significant improvements to architecture and code quality.