How open-mmlab/mmdetection works
MMDetection is a modular PyTorch computer-vision toolbox for detection and segmentation, with inference APIs and a broad catalog of model and dataset configurations. A user can supply an image and configured model to the inference API, which prepares inputs, runs the model, and returns predictions; the inferencer can also visualize results. The README documents object, instance, panoptic, and semi-supervised detection capabilities. Several model and training internals are represented at subsystem level because their implementations were not sampled; uncertain runtime links are omitted.
Main entry points: detectors Detector Models · transforms.py Data Transforms · inference.py Inference API · det_inferencer.py Detection Inferencer
Components 18
User Interfaces
- Inference API
mmdet/apis/inference.py - Detection Inferencer
mmdet/apis/det_inferencer.py - Model Configurations
configs
Models and Components
- Module Registry
mmdet/registry.py - Detector Models
mmdet/models/detectors - QueryInst
mmdet/models/detectors/queryinst.py - Embedding RPN
mmdet/models/dense_heads/embedding_rpn_head.py - Transformer Layers
mmdet/models/layers/transformer - Positional Encoding
mmdet/models/layers/positional_encoding.py
Data and Representations
- Data Transforms
mmdet/datasets/transforms/transforms.py - Box Structures
mmdet/structures/bbox - Mask Structures
mmdet/structures/mask/structures.py - Detection Samples
mmdet/structures/det_data_sample.py
Tasks and Outputs
- Evaluation
mmdet/evaluation - Local Visualizer
mmdet/visualization/local_visualizer.py - Pipeline Switching
mmdet/engine/hooks/pipeline_switch_hook.py - Image Captioning
projects/XDecoder/xdecoder/inference/image_caption.py
Other components
- User
Connections 15
- User → Inference API: requests inference
README.md - Inference API → Module Registry: builds model
mmdet/apis/inference.py - Inference API → Evaluation: gets classes
mmdet/apis/inference.py - Detection Inferencer → Local Visualizer: renders predictions
mmdet/apis/det_inferencer.py - QueryInst → Detector Models: inherits from
mmdet/models/detectors/queryinst.py - Embedding RPN → Box Structures: converts boxes
mmdet/models/dense_heads/embedding_rpn_head.py - Data Transforms → Module Registry: registers transforms
mmdet/datasets/transforms/transforms.py - Data Transforms → Box Structures: uses box types
mmdet/datasets/transforms/transforms.py - Data Transforms → Mask Structures: uses mask types
mmdet/datasets/transforms/transforms.py - Pipeline Switching → Data Transforms: rebuilds pipeline
mmdet/engine/hooks/pipeline_switch_hook.py - Detection Inferencer → Detection Samples: returns predictions
- Detector Models → Detection Samples: produces samples
- Detector Models → Transformer Layers: uses layers
- Detector Models → Positional Encoding: uses encoding
- Model Configurations → Detector Models: configures models