Skip to content

Commit 2060fe7

Browse files
committed
fuse net_run_cls and net_run_seg
1 parent 7d50536 commit 2060fe7

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

pymic/net_run/net_run_cls.py renamed to pymic/net_run/net_run.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
import sys
44
from pymic.util.parse_config import parse_config
55
from pymic.net_run.agent_cls import ClassificationAgent
6+
from pymic.net_run.agent_seg import SegmentationAgent
67

78
def 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

1824
if __name__ == "__main__":

pymic/net_run/net_run_seg.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)