How mantasu/glasses-detector works
Glasses Detector is a Python library for classifying, detecting, and segmenting glasses in images. The principal workflow is to construct a task-specific model, pass image inputs for prediction, and optionally process files or directories into saved or displayed results. The package also includes categorized datasets and augmentation support for model training. Shared model, prediction-type, and prediction-interface components underpin the task APIs. Relationships for unsampled wrapper and dataset implementations are limited to references shown in the source index; the README excerpt provides no further capability details.
Main entry points: base_model.py Model lifecycle · pred_type.py Prediction types · __init__.py Public API · classifier.py Classification
Components 17
Task models
- Public API
src/glasses_detector/__init__.py - Classification
src/glasses_detector/classifier.py - Object detection
src/glasses_detector/detector.py - Segmentation
src/glasses_detector/segmenter.py
Model architectures
- Tiny classifier
src/glasses_detector/architectures/tiny_binary_classifier.py - Tiny detector
src/glasses_detector/architectures/tiny_binary_detector.py - Tiny segmenter
src/glasses_detector/architectures/tiny_binary_segmenter.py
Dataset support
- Image augmentation
src/glasses_detector/_data/augmenter_mixin.py - Categorized dataset
src/glasses_detector/_data/base_categorized_dataset.py - Classification data
src/glasses_detector/_data/binary_classification_dataset.py - Detection data
src/glasses_detector/_data/binary_detection_dataset.py - Segmentation data
src/glasses_detector/_data/binary_segmentation_dataset.py
Shared runtime
- Prediction I/O
src/glasses_detector/components/pred_interface.py - Model lifecycle
src/glasses_detector/components/base_model.py - Prediction types
src/glasses_detector/components/pred_type.py - Runtime utilities
src/glasses_detector/utils.py
Other components
- Library user
Connections 22
- Library user → Public API: uses
src/glasses_detector/__init__.py - Public API → Classification: exports
src/glasses_detector/__init__.py - Public API → Object detection: exports
src/glasses_detector/__init__.py - Public API → Segmentation: exports
src/glasses_detector/__init__.py - Classification → Model lifecycle: uses lifecycle
src/glasses_detector/classifier.py - Object detection → Model lifecycle: uses lifecycle
src/glasses_detector/detector.py - Segmentation → Model lifecycle: uses lifecycle
src/glasses_detector/segmenter.py - Classification → Tiny classifier: selects architecture
src/glasses_detector/classifier.py - Object detection → Tiny detector: selects architecture
src/glasses_detector/detector.py - Segmentation → Tiny segmenter: selects architecture
src/glasses_detector/segmenter.py - Model lifecycle → Prediction I/O: implements interface
src/glasses_detector/components/base_model.py - Model lifecycle → Prediction types: uses types
src/glasses_detector/components/base_model.py - Prediction I/O → Prediction types: standardizes
src/glasses_detector/components/pred_interface.py - Classification → Prediction types: uses types
src/glasses_detector/classifier.py - Object detection → Prediction types: uses types
src/glasses_detector/detector.py - Segmentation → Prediction types: uses types
src/glasses_detector/segmenter.py - Model lifecycle → Runtime utilities: uses helpers
src/glasses_detector/components/base_model.py - Prediction I/O → Runtime utilities: uses helpers
src/glasses_detector/components/pred_interface.py - Categorized dataset → Image augmentation: uses transforms
src/glasses_detector/_data/base_categorized_dataset.py - Classification data → Categorized dataset: extends dataset
src/glasses_detector/_data/binary_classification_dataset.py - Detection data → Categorized dataset: extends dataset
src/glasses_detector/_data/binary_detection_dataset.py - Segmentation data → Categorized dataset: extends dataset
src/glasses_detector/_data/binary_segmentation_dataset.py