Detectron2 implementation of Domain Adaptive Mask R-CNN
Follow the guide on Detectron2's documentation to install Detectron2.
Then replace detectron2/modeling/meta_arch/rcnn.py
with our DA-MRCNN/rcnn.py
, and detectron2/modeling/backbone/fpn.py
with our DA-MRCNN/fpn.py
.
We use COCO format to register the dataset.
register_coco_instances("dataset_name_source_training",{},"path_annotations","path_images")
register_coco_instances("dataset_name_source_validation",{},"path_annotations","path_images")
register_coco_instances("dataset_name_source_domain_adaptation_training",{},"path_annotations","path_images")
register_coco_instances("dataset_name_source_domain_adaptation_validation",{},"path_annotations","path_images")
register_coco_instances("dataset_name_target_test",{},"path_annotations","path_images")
register_coco_instances("dataset_name_target_domain_adaptation_training",{},"path_annotations","path_images")
register_coco_instances("dataset_name_target_domain_adaptation_validation",{},"path_annotations","path_images")
A pretrained model is recommended. It can be prepared from ReGion-Based Detector (RGBD).
tools/trainer.py
Remarks: If the last checkpoint is 30000 iteration (e.g. from the pretrained weight above), the MAX_ITER must be greater than 30000.
tools/evaluate.py
uses COCO AP evaluations.
tools/inference.py
[1] Pasqualino, G., Furnari, A., Signorello, G., Farinella, G. M. (2021). An unsupervised domain adaptation scheme for single-stage artwork recognition in cultural sites. Image and Vision Computing, 107, 104098.
[2] Chuang, S. J. et al (2021). On-site Rebar Spacing Inspection using Deep-learning-based Image Segmentation. Comput Aided Civ Inf, 2021;00:1–9.
[3] Wu, Y., Kirillov, A., Massa, F., Lo, W.-Y., & Girshick, R. (2019). Detectron2.