MMDetection: OpenMMLab detection toolbox
MMDetection is OpenMMLab's PyTorch toolbox for object detection, instance segmentation, and panoptic segmentation, built around swapping components through config files instead of editing training code. The architecture catalog runs deep, from Faster R-CNN through DETR variants to the newer RTMDet. That breadth has a cost: MMEngine and MMCV arrive as separate dependencies before a single model runs, and the config system takes real time to learn.
What is MMDetection?
MMDetection is an open source object detection toolbox built on PyTorch, part of the OpenMMLab project. It packages object detection, instance segmentation, panoptic segmentation, and semi-supervised detection into one modular framework where backbones, necks, and heads swap through config files rather than code edits. It depends on MMEngine and MMCV for training and core CV operations.
Key features: modular design and multi-task support
- โModular design: the README describes the framework as decomposed into separate components โ backbones, necks, heads โ that you recombine into a custom detector instead of subclassing a monolith.
- โMulti-task support out of the box: object detection, instance segmentation, panoptic segmentation, and semi-supervised object detection all run through the same codebase.
- โA wide architecture zoo, spanning Fast R-CNN, Faster R-CNN, RetinaNet, Cascade R-CNN, YOLOv3, DETR, Deformable DETR, DINO, GLIP, and RTMDet, plus backbones like Swin Transformer and ConvNeXt.
- โRTMDet, the newer real-time detector family, reports 52.8 AP on COCO object detection at 322 FPS (TRT FP16, batch size 1, RTX 3090) per the README's own benchmark table.
- โGPU-resident bbox and mask ops โ the README states training speed is faster than or comparable to Detectron2, maskrcnn-benchmark, and SimpleDet.
- โMM-Grounding-DINO, an open source replication of Grounding DINO for open-vocabulary detection and phrase grounding, ships with released pretrained Swin-B and Swin-L weights.
Installing MMDetection
The README itself doesn't include install commands โ it links out to the official 'Installation' guide on mmdetection.readthedocs.io for the actual pip/conda steps, so exact commands aren't given in the source available here. What is documented directly: MMDetection's main branch needs PyTorch 1.8+, and it depends on two sibling OpenMMLab libraries, MMEngine (training) and MMCV (core CV operations), installed alongside it. Beyond that, the specific install sequence is not clearly documented in the README and you'd follow the linked guide.
Running a detection model with config files
MMDetection's README doesn't walk through a config file or a training command on the page itself โ it points to separate 'Learn about Configs' and 'Inference with existing models' guides in the docs, so the exact CLI invocation is not clearly documented in the source available here. Conceptually, the workflow is config-driven: you pick or write a config file that assembles backbone, neck, and head modules, then point the train/test scripts at that config instead of editing Python training code directly. There's a dedicated 'Train with customized datasets' guide, plus a 'Finetuning Models' guide for adapting pretrained weights.
Common use cases and workflows
- โขTraining a custom object detector on your own COCO-format dataset for a specific class list.
- โขSwapping in a different backbone (Swin Transformer or ConvNeXt, for example) on an existing detection head to compare accuracy against speed without rewriting the training loop.
- โขRunning instance segmentation with Mask R-CNN or newer methods like Mask2Former from the same codebase used for detection.
- โขReal-time or rotated object detection with RTMDet, per its reported benchmarks on COCO and DOTA.
- โขOpen-vocabulary or phrase-grounding detection via MM-Grounding-DINO.
Strengths of the MMDetection toolbox
- โBroad task coverage: detection, instance segmentation, panoptic segmentation, and semi-supervised detection share one config system, so you don't switch codebases when the task changes.
- โDeep architecture catalog: from Fast R-CNN through DETR and DINO to RTMDet, most detection papers of the last several years already have an implementation here.
- โThe README backs its speed claim with numbers, not adjectives โ RTMDet's own benchmark table reports concrete AP and FPS figures on COCO and DOTA.
- โActive line of new work: MM-Grounding-DINO with released Swin-B/Swin-L weights shows the project is still shipping new detectors, not just maintaining old ones.
Limitations and challenges
- โณConfig-file-driven customization has a real learning curve: you're composing Python config objects that reference registered modules, a different mental model than a typical train.py script with argparse flags.
- โณThe README doesn't document install or usage commands in-page โ everything routes to external docs, so you can't get running from the README alone.
- โณAdopting MMDetection means adopting MMEngine and MMCV as hard dependencies too, which is extra surface area to debug when something breaks in the stack.
- โณThe main branch targets PyTorch 1.8+; the README doesn't state an upper bound, so pinning compatible PyTorch/CUDA versions is something you verify yourself rather than read off the page.
MMDetection vs Detectron2, MMYOLO, and other alternatives
Frequently asked questions
MMDetection's main branch requires PyTorch 1.8 or newer, per the project's README. The README doesn't state a specific required Python version in the text provided, so check the linked installation guide for the exact Python compatibility matrix.
MMDetection supports training on custom datasets โ the documentation includes a dedicated 'Train with customized datasets' guide alongside guides for training predefined models on standard datasets like COCO.
MMDetection's README states its training speed is faster than or comparable to Detectron2 across its supported models. Both are PyTorch-based detection toolboxes; MMDetection additionally ties into the wider OpenMMLab ecosystem (MMEngine, MMCV) rather than standing alone.
MMDetection includes RTMDet, a real-time detector family; the README reports 52.8 AP on COCO object detection at 322 FPS (TRT FP16, batch size 1, RTX 3090), covering real-time detection alongside YOLO-style models elsewhere in the OpenMMLab ecosystem.
MMDetection is released under the Apache 2.0 license, which permits commercial use, modification, and redistribution, including in proprietary products, subject to the license's standard attribution and notice terms.
MMDetection is built on top of MMEngine and MMCV rather than treating them as optional โ the README states both are heavily depended on by the toolbox, so they're required components when you install MMDetection, not optional add-ons.
The problem it solves
Object detection research produces a new architecture every few months โ a new backbone, a new detection head, a new loss โ and reimplementing each one from its paper to compare against what you're already running is its own project. MMDetection's problem is that comparison gap: it reimplements a long list of published detectors (from Fast R-CNN to RTMDet to DINO) inside one shared codebase so switching between them is a config change rather than a from-scratch reimplementation.
Who should try it โ and who should skip
Try MMDetection if you're a researcher or engineer who needs more than one detection architecture over a project's lifetime โ comparing Faster R-CNN against RTMDet against a transformer-based DETR variant is a config swap here, not a rewrite. It also suits teams already inside the OpenMMLab ecosystem (MMCV, MMEngine) or building on MM-Grounding-DINO for open-vocabulary detection. Skip it if you want one YOLO model running in an afternoon with minimal dependency overhead โ the config system and MMEngine/MMCV stack are more machinery than a single-architecture project needs.
Related repositories
Still deciding about mmdetection?
One click hands the question to an AI along with this page โ see what it says about mmdetection.
