← all repositories
ignacio-rocco/detectorch

Facebook's Detectron, but make it PyTorch

A portability layer that lets you run Detectron's pre-trained object detection models in PyTorch without the Caffe2 dependency.

559 stars Jupyter Notebook Computer VisionML Frameworks
detectorch
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

Detectorch imports pre-trained Detectron models (Fast R-CNN, Faster R-CNN, Mask R-CNN) from Caffe2 format and runs them in PyTorch. It handles the model weights, the RoIAlign layer, and evaluation pipelines so you get the same box and mask AP numbers as the original.

The interesting bit

The real work is in the glue: a custom RoIAlign implementation with two different compilation paths depending on whether you’re on PyTorch 0.3.1 or 0.4, plus JIT compilation for the newer version. The author also reimplemented enough of Detectron’s data pipeline to verify that evaluation metrics match exactly — a tedious but necessary validation step that many ports skip.

Key highlights

  • Supports ResNet-50/101 with or without FPN
  • Evaluation numbers match Detectron’s Caffe2 originals (e.g., Mask R-CNN R-101-FPN hits 40.9 box AP / 36.4 mask AP)
  • Includes a demo notebook for quick inference
  • Experimental training code exists (train_fast.py) but is noted as slow
  • Requires building COCO API and RoIAlign from source

Caveats

  • No training support for most models; inference and evaluation only
  • Stuck on PyTorch 0.3.1/0.4 era — the README predates PyTorch 1.0
  • Training code is explicitly labeled experimental and slow

Verdict

Worth a look if you’re maintaining legacy PyTorch 0.4 code that needs Detectron compatibility, or if you want to study how Caffe2→PyTorch model ports work under the hood. Skip it if you need training or are on modern PyTorch — Detectron2 has superseded this entirely.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.