gitmyhub

detectron2

Python ★ 35k updated 12d ago

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.

Detectron2 is a Python library from Meta AI Research (formerly Facebook AI Research) that provides tools for object detection, image segmentation, and related computer vision tasks. Object detection means identifying what objects are in an image and drawing bounding boxes around them — telling you there is a cat at a specific location and a chair at another. Segmentation goes further by identifying the exact pixels belonging to each object rather than just a bounding box. Detectron2 covers multiple variants of these tasks, including instance segmentation (outlining each individual object), semantic segmentation (labeling every pixel with a category), and panoptic segmentation (combining both at once).

The library is built on top of PyTorch, a popular deep learning framework, and is designed to be a research platform: it implements many well-known detection architectures and provides training code, evaluation scripts, and a large model zoo — a collection of pre-trained model weights you can download and either use directly or fine-tune on your own dataset. Architectures available include Faster R-CNN, Mask R-CNN, RetinaNet, and more recent models like ViTDet. Trained models can be exported to deployment-ready formats like TorchScript.

You would use Detectron2 when building or experimenting with a computer vision system that needs to locate and identify objects in images or video. Typical applications include autonomous driving perception systems, medical imaging analysis, product detection in retail, video surveillance, and academic computer vision research. It is primarily a research and prototyping tool. For production deployment, its export capabilities allow moving to optimized inference runtimes. The library is Python-based, requires a GPU for practical training speeds, and is released under the Apache 2.0 open-source license.