File tree Expand file tree Collapse file tree 2 files changed +8
-23
lines changed Expand file tree Collapse file tree 2 files changed +8
-23
lines changed Original file line number Diff line number Diff line change 33import sys
44from pymic .util .parse_config import parse_config
55from pymic .net_run .agent_cls import ClassificationAgent
6+ from pymic .net_run .agent_seg import SegmentationAgent
67
78def main ():
89 if (len (sys .argv ) < 3 ):
910 print ('Number of arguments should be 3. e.g.' )
10- print (' pymic_net_run_cls train config.cfg' )
11+ print (' pymic_net_run train config.cfg' )
1112 exit ()
1213 stage = str (sys .argv [1 ])
1314 cfg_file = str (sys .argv [2 ])
1415 config = parse_config (cfg_file )
15- agent = ClassificationAgent (config , stage )
16+ task = config ['dataset' ]['task_type' ]
17+ assert task in ['cls' , 'cls_nexcl' , 'seg' ]
18+ if (task == 'cls' or task == 'cls_nexcl' ):
19+ agent = ClassificationAgent (config , stage )
20+ else :
21+ agent = SegmentationAgent (config , stage )
1622 agent .run ()
1723
1824if __name__ == "__main__" :
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments