-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun.py
41 lines (27 loc) · 910 Bytes
/
run.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
from clidantic import Parser
from tqdm.contrib.logging import logging_redirect_tqdm
from floods import preproc, testing, training
from floods.config import PreparationConfig, StatsConfig, TrainConfig
from floods.config.testing import TestConfig
from floods.utils.common import prepare_logging
cli = Parser()
@cli.command()
def preprocess(config: PreparationConfig):
return preproc.preprocess_data(config=config)
@cli.command()
def stats(config: StatsConfig):
# TODO: fix compute
return preproc.compute_statistics(config=config)
@cli.command()
def pseudolabel(config: PreparationConfig):
preproc.generate_pseudolabels(config=config)
@cli.command()
def train(config: TrainConfig):
training.train(config=config)
@cli.command()
def test(config: TestConfig):
testing.test(config)
if __name__ == '__main__':
prepare_logging()
with logging_redirect_tqdm():
cli()