Detectron2

repository·main·Indexed 12 days ago

https://github.com/facebookresearch/detectron2

A modular PyTorch-based library for state-of-the-art detection and segmentation algorithms developed by Facebook AI Research. It provides tools for training and deploying models like Faster R-CNN, Mask R-CNN, and Keypoint R-CNN, with support for datasets including COCO, LVIS, Cityscapes, and Pascal VOC. The library includes a Model Zoo, lazy instantiation for configurations, and export capabilities for TorchScript and ONNX.

Tokens
46K
Snippets
125
Records
213
Agent score
93%

What's inside Detectron2

  1. Overview of Detectron2 example scripts

    main

    The tools/ directory contains several scripts for common tasks in the Detectron2 workflow:

    • train_net.py: An example training script for training built-in Detectron2 models. Refer to GETTING_STARTED.md for detailed usage.
    • plain_train_net.py: A training script that implements a manual training loop instead of using the Trainer abstraction. This is intended for users who want more control ('hackers').
    • benchmark.py: Benchmarks training, inference, or data loading speeds.
    • analyze_model.py: Analyzes model FLOPs, parameters, and activations.
    • visualize_json_results.py: Visualizes JSON results from COCOEvalutor or LVISEvaluator.
    • visualize_data.py: Visualizes ground truth annotations or augmented training data.
  2. Overview of TridentNet in Detectron2

    main

    TridentNet (Scale-Aware Trident Networks) is an object detection architecture designed to generate scale-specific feature maps with uniform representational power. It uses a parallel multi-branch architecture where branches share transformation parameters but utilize different receptive fields.

    This repository implements TridentNet-Fast, a fast approximation version that provides significant performance improvements without increasing parameters or computational cost.

  3. Prepare Detectron2 models for deployment

    main

    The detectron2/export directory provides tools to prepare trained Detectron2 models for deployment in production environments. Currently, the export functionality supports the following formats:

    • TorchScript: For deployment in environments that support PyTorch JIT.
    • ONNX: For deployment across various hardware accelerators and runtimes (e.g., TensorRT, ONNX Runtime).
    • Caffe2: (Deprecated)

    For detailed usage instructions and tutorials, refer to the official deployment documentation.

  4. Explore DensePose Model Zoo and Baselines

    main

    The DensePose Model Zoo provides various pre-trained models categorized by their architecture, training schedule, and feature sets. Users can choose models based on their specific needs for accuracy (AP), inference speed, or additional features like confidence estimation.

    Model Categories:

    • Legacy Models: Baselines trained using schedules from Güler et al, 2018.
    • Improved Baselines (Original Fully Convolutional Head): Models using improved training schedules and Panoptic FPN heads.
    • Improved Baselines (DeepLabV3 Head): Models incorporating the DeepLabV3 head for enhanced performance.
    • Baselines with Confidence Estimation: Models that estimate confidence in regressed UV coordinates (using WC1 or WC2 types).
    • Baselines with Mask Confidence Estimation: Models that estimate confidence for UV coordinates AND coarse/fine segmentation (using WC1M or WC2M types).
    • Bootstrapping Baselines: Master and student models trained via a bootstrapping pipeline, specifically evaluated on the DensePose Chimps dataset.