Skip to content

Commit d60baa1

Browse files
committed
rename train_infer as net_run
1 parent 7bb5a20 commit d60baa1

9 files changed

Lines changed: 21 additions & 333 deletions

File tree

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
from pymic.io.image_read_write import save_nd_array_as_image
1919
from pymic.io.nifty_dataset import NiftyDataset
2020
from pymic.io.transform3d import get_transform
21-
from pymic.train_infer.net_factory import get_network
22-
from pymic.train_infer.infer_func import volume_infer
23-
from pymic.train_infer.loss import *
24-
from pymic.train_infer.get_optimizer import get_optimiser
21+
from pymic.net_run.net_factory import get_network
22+
from pymic.net_run.infer_func import volume_infer
23+
from pymic.net_run.loss import *
24+
from pymic.net_run.get_optimizer import get_optimiser
2525
from pymic.util.image_process import convert_label
2626
from pymic.util.parse_config import parse_config
2727

@@ -387,7 +387,7 @@ def run(self):
387387
else:
388388
self.infer()
389389

390-
if __name__ == "__main__":
390+
def main():
391391
if(len(sys.argv) < 3):
392392
print('Number of arguments should be 3. e.g.')
393393
print(' python train_infer.py train config.cfg')
@@ -398,3 +398,7 @@ def run(self):
398398
agent = TrainInferAgent(config, stage)
399399
agent.run()
400400

401+
if __name__ == "__main__":
402+
main()
403+
404+

pymic/train_infer/train_infer_uncertainty.py

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

pymic/util/evaluation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,16 @@ def evaluation(config_file):
324324
np.savetxt("{0:}/{1:}_{2:}_std.txt".format(s_folder, organ_name, metric), score_std)
325325
print("{0:} mean ".format(metric), score_mean)
326326
print("{0:} std ".format(metric), score_std)
327-
328-
if __name__ == '__main__':
327+
328+
329+
def main():
329330
if(len(sys.argv) < 2):
330331
print('Number of arguments should be 2. e.g.')
331332
print(' python pyMIC.util/evaluation.py config.cfg')
332333
exit()
333334
config_file = str(sys.argv[1])
334335
assert(os.path.isfile(config_file))
335336
evaluation(config_file)
337+
338+
if __name__ == '__main__':
339+
main()

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@
2727
'Programming Language :: Python :: 3',
2828
],
2929
python_requires = '>=3.6',
30+
entry_points = {
31+
'console_scripts': [
32+
'pymic_net_run = pymic.net_run.net_run:main',
33+
'pymic_evaluate = pymic.util.evaluation:main'
34+
],
35+
},
3036
)

0 commit comments

Comments
 (0)