forked from platonic-realm/gbm-seg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfer.py
43 lines (28 loc) · 1.19 KB
/
infer.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
# Python Imprts
# Library Imports
# Local Imports
from src.utils.misc import configure_logger
from src.utils import args
from src.utils.misc import blender_render
from src.train.factory import Factory
def main_infer(_configs):
factory = Factory(_configs)
data_loaders = factory.createInferenceDataLoaders()
morph = factory.createMorphModule()
snapper = factory.createSnapper()
for data_loader in data_loaders:
model = factory.createModel(data_loader.dataset.getNumberOfChannels(),
data_loader.dataset.getNumberOfClasses(),
_inference=True,
_result_shape=data_loader.dataset.getResultShape(),
_dp=False)
inferer = factory.createInferer(model,
data_loader,
morph,
snapper)
inferer.infer()
blender_render(_configs['inference']['result_dir'])
if __name__ == '__main__':
_, configs = args.parse_indep("Inferance -> GBM segmentation")
configure_logger(configs)
main_infer(configs)