-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheval.py
More file actions
25 lines (17 loc) · 737 Bytes
/
eval.py
File metadata and controls
25 lines (17 loc) · 737 Bytes
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
import os
import glob
import logging
from importlib import machinery
from model import Model
from evaluate_patients import score_data as evaluation
def run(model_path, datasets, output_path):
config_file = glob.glob(model_path + '/*py')[0]
config_module = config_file.split('/')[-1].rstrip('.py')
exp_config = machinery.SourceFileLoader(config_module, os.path.join(config_file)).load_module()
# output_path = os.path.dirname(datasets[0])
logging.warning('Saving segmentations on {}'.format(output_path))
model = Model(exp_config)
masks = evaluation(model, output_path, model_path,
datasets, exp_config=exp_config,
do_postprocessing=True)
return masks