def main(opt):
    if opt["mode"] == "train":
        BMN_Train(opt)
    elif opt["mode"] == "inference":
        if not os.path.exists("output/BMN_results"):
            os.makedirs("output/BMN_results")
        BMN_inference(opt)
        print("Post processing start")
        BMN_post_processing(opt)
        print("Post processing finished")
        evaluation_proposal(opt)
def main(opt):
    if opt["mode"] == "train":
        with open(opt["checkpoint_path"] + "/opts.json", "w") as opt_file:
            json.dump(opt, opt_file)
        BMN_Train(opt)
    elif opt["mode"] == "inference":
        if not os.path.exists(opt["output"] + "/BMN_results"):
            os.makedirs(opt["output"] + "/BMN_results")
        BMN_inference(opt)
        print("Post processing start")
        BMN_post_processing(opt)
        print("Post processing finished")
        evaluation_proposal(opt)
def main(opt):
    if opt["module"] == "BMN":
        mask = np.load(opt["bm_mask_path"])
        opt["bm_mask"] = mask
        if opt["mode"] == "train":
            BMN_Train(opt)
        elif opt["mode"] == "inference":
            if not os.path.exists("output/BMN_results"):
                os.makedirs("output/BMN_results")
            BMN_inference(opt)
        else:
            print("Wrong mode. BMN has two modes: train and inference")

    elif opt["module"] == "Post_processing":
        print("Post processing start")
        BMN_post_processing(opt)
        print("Post processing finished")

    elif opt["module"] == "Evaluation":
        evaluation_proposal(opt)
    print("")