def parse_args()

in annotation_gui_gcp/run_ba.py [0:0]


def parse_args():
    parser = argparse.ArgumentParser(
        description="Merge reconstructions and run BA with GCPs"
    )
    parser.add_argument(
        "path_dataset",
        help="dataset to process",
    )
    parser.add_argument(
        "--rec_a",
        default=0,
        type=int,
        help="Index of reconstruction A."
        "\nIf rec_b is set to None, the rec_a is used as a fixed reference:"
        " all annotated images not belonging to it are resected into it using the GCPs."
        "\nIf reconstruction B is set to a number, the pair of reconstructions (A,B)"
        " will be aligned to each other using the ground control points.",
    )
    parser.add_argument(
        "--rec_b",
        default=1,
        type=int,
        help="Index of reconstruction B. Read the help for rec_a",
    )
    parser.add_argument(
        "--std-threshold",
        default=0.3,
        help="Positional threshold (m) to classify images as well-localized",
    )
    parser.add_argument(
        "--px-threshold",
        default=0.016,  # a little bit over 10 pixels at VGA resolution
        help="threshold in normalized pixels to classify a GCP annotation as correct",
        type=float,
    )
    parser.add_argument(
        "--rigid",
        action="store_true",
        help="Skip BA entirely",
    )
    parser.add_argument(
        "--covariance",
        action="store_true",
        help="Run BA with fixed images to obtain pose covariances",
    )
    args = parser.parse_args()

    if args.covariance:
        assert not args.rigid, "rigid and covariance are mutually exclusive"

    return args