parser=argparse.ArgumentParser(description="Output feature maps using a given pretrained contrastive model.")
# parser.add_argument("--config", "-c", help="Filepath to the TOML config file to load.", required=True)
parser.add_argument("--input","-i",help="Path to input directory containing the images to predict for.",required=True)
parser.add_argument("--output","-o",help="Path to output file to write output to. Defaults to stdout, but if specified a UMAP graph will NOT be produced.")
parser.add_argument("--checkpoint","-c",help="Checkpoint file to load model weights from.",required=True)
parser.add_argument("--params","-p",help="Optional. The file containing the model hyperparameters (usually called 'params.json'). If not specified, it's location will be determined automatically.")
parser.add_argument("--reads-multiplier",help="Optional. The multiplier for the number of files we should read from at once. Defaults to 1.5, which means read ceil(NUMBER_OF_CORES * 1.5). Set to a higher number of systems with high read latency to avoid starving the GPU of data.")
parser.add_argument("--no-vis",
help="Don't also plot a visualisation of the resulting embeddings.",action="store_true")
returnparser
defrun(args):
# Note that we do NOT check to see if the checkpoint file exists, because Tensorflow/Keras requires that we pass the stem instead of the actual index file..... :-/