Please follow the detectron2 installation to install required dependences.
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
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
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