-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_pla_preprocess.py
32 lines (27 loc) · 1009 Bytes
/
run_pla_preprocess.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
from __future__ import annotations
import argparse
import joblib
import os
import utils.helpers as helpers
def get_argument_parser() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', '-d', type=str, default='PoTeC')
parser.add_argument('--detection-method', type=str, default='ivt')
parser.add_argument('--flag-redo', type=int, default=0)
args = parser.parse_args()
return args
def main() -> int:
args = get_argument_parser()
dataset = args.dataset
detection_method = args.detection_method
flag_redo = args.flag_redo
detection_params = helpers.get_detection_params(detection_method)
joblib.Parallel(n_jobs=10)(
joblib.delayed(os.system)(
f'python pla_preprocess.py --dataset {dataset} --detection-method {detection_method} {detection_param} --check-file-exists'
)
for detection_param in detection_params
)
return 0
if __name__ == '__main__':
raise SystemExit(main())