-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrun_prepare.py
56 lines (46 loc) · 1.38 KB
/
run_prepare.py
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
47
48
49
50
51
52
53
54
55
56
import argparse
from pathlib import Path
from cellxpredict.config import Models, config_from_args
from cellxpredict.prepare import prepare_temporal
# check whether we're running in a container
current_path = Path(__file__).parent.resolve()
container_path = current_path / "container"
if container_path.exists():
DEFAULT_PATH = container_path
else:
DEFAULT_PATH = current_path
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Prepare data")
parser.add_argument(
"--model",
choices=[m.name.lower() for m in Models],
type=str,
required=True,
help="name of the model to train",
)
parser.add_argument(
"--src_dir",
type=Path,
default=DEFAULT_PATH / "data",
help="path to the data directory",
)
parser.add_argument(
"--model_dir",
type=Path,
default=DEFAULT_PATH / "models",
help="path to the model output directory",
)
parser.add_argument(
"--use_probabilistic_encoder",
action="store_true",
help="use a probabilistic encoder while training model",
)
parser.add_argument(
"--use_rotations",
action="store_true",
help="use rotations in XY plane during data preparation",
)
args = parser.parse_args()
print(args)
config = config_from_args(args)
prepare_temporal(config)