How to train Detectron2 with Custom COCO Datasets

Chengwei Zhang
4 min readOct 14, 2019

Along with the latest PyTorch 1.3 release came with the next generation ground-up rewrite of its previous object detection framework, now called Detectron2. This tutorial will help you get started with this framework by training an instance segmentation model with your custom COCO datasets. If you want to know how to create COCO datasets, please read my previous post — How to create custom COCO data set for instance segmentation.

For a quick start, we will do our experiment in a Colab Notebook so you don’t need to worry about setting up the development environment on your own machine before getting comfortable with Pytorch 1.3 and Detectron2.

Install Detectron2

In the Colab notebook, just run those 4 lines to install the latest Pytorch 1.3 and Detectron2.

Click “RESTART RUNTIME” in the cell’s output to let your installation take effect.

--

--