()
return args
Returns: parsed arguments object
Returns: parsed arguments object
Returns : parsed arguments object
def parse_arguments() -> argparse.Namespace:
    """
    Returns: parsed arguments object
    """
    parser = argparse.ArgumentParser("ProGAN fid_score computation tool",
                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter,)

    # fmt: off
    # required arguments
    parser.add_argument("model_path", action="store", type=Path,
                        help="path to the trained_model.bin file")
    parser.add_argument("dataset_path", action="store", type=Path,
                        help="path to the directory containing the images from the dataset. "
                             "Note that this needs to be a flat directory")

    # optional arguments
    parser.add_argument("--generated_images_path", action="store", type=Path, default=None, required=False,
                        help="path to the directory where the generated images are to be written. "
                             "Uses a temporary directory by default. Provide this path if you'd like "
                             "to see the generated images yourself :).")
    parser.add_argument("--batch_size", action="store", type=int, default=4, required=False,
                        help="batch size used for generating random images")
    parser.add_argument("--num_generated_images", action="store", type=int, default=50_000, required=False,
                        help="number of generated images used for computing the FID")
    # fmt: on

    args = parser.parse_args()

    return args
def parse_arguments ( ) -> argparse . Namespace : parser = argparse . ArgumentParser ( "ProGAN fid_score computation tool" , formatter_class = argparse . ArgumentDefaultsHelpFormatter , ) # fmt: off # required arguments parser . add_argument ( "model_path" , action = "store" , type = Path , help = "path to the trained_model.bin file" ) parser . add_argument ( "dataset_path" , action = "store" , type = Path , help = "path to the directory containing the images from the dataset. " "Note that this needs to be a flat directory" ) # optional arguments parser . add_argument ( "--generated_images_path" , action = "store" , type = Path , default = None , required = False , help = "path to the directory where the generated images are to be written. " "Uses a temporary directory by default. Provide this path if you'd like " "to see the generated images yourself :)." ) parser . add_argument ( "--batch_size" , action = "store" , type = int , default = 4 , required = False , help = "batch size used for generating random images" ) parser . add_argument ( "--num_generated_images" , action = "store" , type = int , default = 50_000 , required = False , help = "number of generated images used for computing the FID" ) # fmt: on args = parser . parse_args ( ) return args