forked from mlcommons/GaNDLF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gandlf_patchMiner
46 lines (38 loc) · 1.16 KB
/
gandlf_patchMiner
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from GANDLF.cli.patch_extraction import patch_extraction
from GANDLF.cli import copyrightMessage
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="GANDLF_PatchMiner",
formatter_class=argparse.RawTextHelpFormatter,
description="Construct patches from whole slide image(s).\n\n"
+ copyrightMessage,
)
parser.add_argument(
"-i",
"--input_CSV",
dest="input_path",
help="input path for the tissue",
required=True,
)
parser.add_argument(
"-o",
"--output_path",
dest="output_path",
default=None,
required=True,
help="output path for the patches",
)
parser.add_argument(
"-c",
"--config",
type=str,
dest="config",
help="config (in YAML) for running the patch miner. Needs 'scale' and 'patch_size' to be defined, otherwise defaults to 16 and (256, 256), respectively.",
required=False,
)
args = parser.parse_args()
patch_extraction(args.input_path, args.output_path, args.config)
print("Finished.")