gyes00205 / VRDL_HW3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VRDL HW3

1. Install dependencies

Please follow the detectron2 installation to install required dependences.

2. Training code

In this homework, I use detectron2 developed by facebookresearch. First, we should convert training data to coco format. Finally, we can use coco format ddata to train our model.

python train.py \
--yaml=configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml \
--output=mask_rcnn_X_101_small_anchor/
  • --yaml: the path to model yaml
  • --output: the directory to store our model checkpoint

3. Inference code

The inference code will generate our result with coco format.

python inference.py \
--yaml=configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml \
--model=mask_rcnn_X_101_small_anchor/model_final.pth
  • --yaml: the path to model yaml
  • --model: the path to model checkpoint

4. Pre-trained models

You can download the model weight to reproduce my result.

python inference.py \
--yaml=configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml \
--model=model_final_best_242.pth

Result

Reference

  1. detectron2 config
  2. instance to coco
  3. detectron2 install
  4. covert mask to coco

About


Languages

Language:Python 100.0%