示例#1
0
    eval(flags=["--cfg", cfg, "--use_gpu"],
         options=[
             "TEST.TEST_MODEL",
             os.path.join(saved_model, "final"), "DATASET.VAL_FILE_LIST",
             os.path.join(DATASET_PATH, "mini_pet", "file_list",
                          "val_list.txt"), "DATASET.DATA_DIR",
             os.path.join(DATASET_PATH, "mini_pet")
         ],
         devices=devices)

    vis(flags=[
        "--cfg", cfg, "--use_gpu", "--local_test", "--vis_dir", vis_dir
    ],
        options=[
            "DATASET.TEST_FILE_LIST",
            os.path.join(DATASET_PATH, "mini_pet", "file_list",
                         "test_list.txt"), "DATASET.DATA_DIR",
            os.path.join(DATASET_PATH, "mini_pet"), "TEST.TEST_MODEL",
            os.path.join(saved_model, "final")
        ],
        devices=devices)

    export_model(flags=["--cfg", cfg],
                 options=[
                     "TEST.TEST_MODEL",
                     os.path.join(saved_model, "final"), "FREEZE.SAVE_DIR",
                     freeze_save_dir
                 ],
                 devices=devices)
示例#2
0
    saved_model = os.path.join(LOCAL_PATH, "saved_model", model_name)

    parser = argparse.ArgumentParser(description="PaddleSeg loacl test")
    parser.add_argument("--devices",
        dest="devices",
        help="GPU id of running. if more than one, use spacing to separate.",
        nargs="+",
        default=0,
        type=int)
    args = parser.parse_args()

    devices = [str(x) for x in args.devices]

    export_model(
        flags=["--cfg", cfg],
        options=[
            "TEST.TEST_MODEL", test_model, "FREEZE.SAVE_DIR", freeze_save_dir
        ],
        devices=devices)

    # Final eval results should be #image=500 acc=0.9615 IoU=0.7804
    eval(
        flags=["--cfg", cfg, "--use_gpu"],
        options=["TEST.TEST_MODEL", test_model],
        devices=devices)

    vis(flags=["--cfg", cfg, "--use_gpu", "--local_test", "--vis_dir", vis_dir],
        options=["TEST.TEST_MODEL", test_model],
        devices=devices)

    train(
        flags=["--cfg", cfg, "--use_gpu", "--log_steps", "10"],