Ejemplo n.º 1
0
def main():
    mode = "test"  # test  # debug

    pos_loss_method = "mse"  # "mse"  # "smoothL1"
    th_train_iou = 0.8  # 0.8
    norm = True  # False
    min_test_epoch = 32
    max_test_epoch = 32
    loss_weight_lambda_ls = [0]  # [0.1, 0.2, 0.5, 1, 2, 5, 10]
    prevent_overfitting_method = "L2 Regu"  # "L2 Regu" # "Dropout"
    partial_l2 = False
    dx_compute_method = "centre"

    th_score = 0.8

    test_arguments = TestArguments(norm, pos_loss_method, th_train_iou, min_test_epoch, max_test_epoch,
                                   dx_compute_method=dx_compute_method,
                                   score_threshold=th_score, partial_l2_penalty=partial_l2,
                                   prevent_overfitting_method=prevent_overfitting_method, mode=mode)
    test_arguments.show_arguments()
    write_result_path = test_arguments.get_write_result_path()

    all_csv_result = open(write_result_path, "w")
    first_write(all_csv_result)
    th_nms_iou_ls = [0.01]
    th_iou_p_ls = [1]
    for loss_weight_lambda in loss_weight_lambda_ls:
        for th_iou_p in th_iou_p_ls:
            for th_nms_iou in th_nms_iou_ls:
                test_arguments.loss_weight_lambda = loss_weight_lambda
                test_arguments.th_iou_p = th_iou_p
                test_arguments.th_nms_iou = th_nms_iou
                _test(test_arguments, all_csv_result)
Ejemplo n.º 2
0
def main():
    pos_loss_method = "mse"  # "mse"
    th_train_iou = 0.8  # 0.8
    norm = True  # False
    min_test_epoch = 31
    max_test_epoch = 31
    loss_weight_lambdas = [0]  # [0.1, 0.2, 0.5, 1, 2, 5, 10]
    prevent_overfitting_method = "Dropout"  # "L2 Regu" # "Dropout"
    partial_l2 = False
    dx_compute_method = "centre"
    output_flow = False
    th_score = 0.8
    for loss_weight_lambda in loss_weight_lambdas:
        test_arguments = TestAruguments(norm, pos_loss_method, th_train_iou, min_test_epoch, max_test_epoch,
                                        dx_compute_method=dx_compute_method, output_flow=output_flow,
                                        score_threshold=th_score,
                                        loss_weight_lambda=loss_weight_lambda, partial_l2_penalty=partial_l2,
                                        prevent_overfitting_method=prevent_overfitting_method)
        test_arguments.show_arguments()
        write_result_path = test_arguments.get_write_result_path()

        all_csv_result = open(write_result_path, "w")
        first_write(all_csv_result)
        th_nms_iou_ls = [0.01]
        th_iou_p_ls = [1]  # [0.6, 0.8, 1]
        for th_iou_p in th_iou_p_ls:
            for th_nms_iou in th_nms_iou_ls:
                file_before = open("Debug Before NMS.txt", "w")
                file_after = open("Debug After NMS.txt", "w")
                test_arguments.th_nms_iou = th_nms_iou
                test_arguments.th_iou_p = th_iou_p
                _test_k_fold(file_before, file_after, test_arguments, all_csv_result)
Ejemplo n.º 3
0
def main():
    pos_loss_method = "mse"  # "mse"
    th_train_iou = 0.6  # 0.8
    norm = True  # Flase
    min_test_epoch = 40
    max_test_epoch = 40
    loss_weight_lambda = 1.0
    prevent_overfitting_method = "Dropout"  # "L2 Regu" # "Dropout"
    partial_l2 = False
    dx_compute_method = "centre"  # "left_boundary"  # "centre"

    test_arguments = TestAruguments(
        norm,
        pos_loss_method,
        th_train_iou,
        min_test_epoch,
        max_test_epoch,
        dx_compute_method=dx_compute_method,
        loss_weight_lambda=loss_weight_lambda,
        partial_l2_penalty=partial_l2,
        prevent_overfitting_method=prevent_overfitting_method)
    test_arguments.show_arguments()
    write_result_path = test_arguments.get_write_result_path()

    all_csv_result = open(write_result_path, "w")
    first_write(all_csv_result)
    th_nms_iou_ls = [0.01]
    th_iou_p_ls = [0.6, 0.8, 1]  # [0.8]  # [0.6, 0.8, 1]  # [1],
    for th_iou_p in th_iou_p_ls:
        for th_nms_iou in th_nms_iou_ls:
            test_arguments.th_nms_iou = th_nms_iou
            test_arguments.th_iou_p = th_iou_p
            _test_k_fold(test_arguments, all_csv_result)
Ejemplo n.º 4
0
def main():
    th_train_iou = 1
    write_file_path = "./result/insurance/normed_data/gt_train" + str(
        th_train_iou) + ".csv"
    all_csv_result = open(write_file_path, "w")
    first_write(all_csv_result)
    # th_iou_ls = [0.4, 0.5]
    th_nms_iou_ls = [0.2]
    # th_nms_iou_ls = [0.2]
    th_iou_p_ls = [0.6, 0.8, 1]  # [1]  #
    # for th_iou in th_iou_ls:
    print("For this K fold test:\n")
    print("th_train_iou:     ", th_train_iou, "\n\n")
    for th_iou_p in th_iou_p_ls:
        for th_nms_iou in th_nms_iou_ls:
            model_k_folder_path = "model/rcnn_jieba/relabeled_gt_model_" + str(
                th_train_iou) + "/"  # gt train
            test_sentence_npz_k_folder_path = "dataset/test/test_relabeled_data_npz/"
            _test_k_fold(model_k_folder_path, test_sentence_npz_k_folder_path,
                         th_nms_iou, th_iou_p, all_csv_result)
Ejemplo n.º 5
0
def main():
    pos_loss_method = "mse"  # "mse"
    th_train_iou = 0.6  # 0.8
    norm = True  # Flase
    min_test_epoch = 40
    max_test_epoch = 40
    loss_weight_lambda = 1.0
    prevent_overfitting_method = "Dropout"  # "L2 Regu" # "Dropout"
    partial_l2 = False
    dx_compute_method = "centre"
    output_flow = True
    th_score = 0.6
    test_arguments = TestAruguments(
        norm,
        pos_loss_method,
        th_train_iou,
        min_test_epoch,
        max_test_epoch,
        dx_compute_method=dx_compute_method,
        output_flow=output_flow,
        score_threshold=th_score,
        loss_weight_lambda=loss_weight_lambda,
        partial_l2_penalty=partial_l2,
        prevent_overfitting_method=prevent_overfitting_method)
    test_arguments.show_arguments()
    write_result_path = test_arguments.get_write_result_path()

    all_csv_result = open(write_result_path, "w")
    first_write(all_csv_result)
    th_nms_iou_ls = [0.4]
    th_iou_p_ls = [0.6, 0.8, 1]
    for th_iou_p in th_iou_p_ls:
        for th_nms_iou in th_nms_iou_ls:
            file = open("Before NMS.txt", "w")
            test_arguments.th_nms_iou = th_nms_iou
            test_arguments.th_iou_p = th_iou_p
            _test_k_fold(file, test_arguments, all_csv_result)