_base_ = '../faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco.py'

model = dict(
    roi_head=dict(bbox_head=dict(num_classes=2))
)

# Dataset path
TRAIN_DATASET = '/home/hqvo2/Projects/Breast_Cancer/data/processed_data2/mass/train_train'
TRAIN_ANNOTATION = TRAIN_DATASET + '/annotation_coco_with_classes.json'
VAL_DATASET = '/home/hqvo2/Projects/Breast_Cancer/data/processed_data2/mass/train_val'
VAL_ANNOTATION = VAL_DATASET + '/annotation_coco_with_classes.json'
# TEST_DATASET = '/home/hqvo2/Projects/Breast_Cancer/data/processed_data2/mass/test'
# TEST_ANNOTATION = TEST_DATASET + '/annotation_coco_with_classes.json'
TEST_DATASET = '/project/hnguyen/hung/Projects/Datasets/INbreast/INbreast Release 1.0/AllPNGs'
TEST_ANNOTATION = TEST_DATASET + '/inbreast_annotation_coco.json'

# Modify dataset related settings
dataset_type = 'COCODataset'
classes = ('malignant-mass', 'benign-mass')
data = dict(
    samples_per_gpu=8,
    workers_per_gpu=8,
    train=dict(
        img_prefix=TRAIN_DATASET,
        classes=classes,
        ann_file=TRAIN_ANNOTATION),
    val=dict(
        img_prefix=VAL_DATASET,
        classes=classes,
        ann_file=VAL_ANNOTATION),
    test=dict(
        img_prefix=TEST_DATASET,
        classes=classes,
        ann_file=TEST_ANNOTATION))


load_from = 'http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_caffe_fpn_1x_coco/faster_rcnn_r50_caffe_fpn_1x_coco_bbox_mAP-0.378_20200504_180032-c5925ee5.pth'
work_dir = '/home/hqvo2/Projects/Breast_Cancer/experiments/cbis_ddsm_detection/mass/faster_rcnn_r50_caffe_fpn_mstrain_1x_ddsm_inbreast-test_200eps'

evaluation = dict(
    save_best='bbox_mAP'
)
runner = dict(max_epochs=200)
workflow=[('train', 1), ('val', 1)]

log_config = dict(
    interval=50,
    hooks=[
        dict(type='TextLoggerHook'),
        dict(type='TensorboardLoggerHook')
    ])
