Per the original docs
Any MONAI Bundle used with MONAI Label must meet the following constraints:
- It must comply with the MONAI Bundle Specification.
- For inference, the bundle must define either an
inference.json
orinference.yaml
file, and it must include the keys described in the bundle.py file located in themonailabel/tasks/infer/
directory. - For training, the bundle must define either a
train.json
ortrain.yaml file
, and it must include the keys described in the bundle.py file located in themonailabel/tasks/train/
directory. - For multi-GPU training, the bundle must define either a
multi_gpu_train.json
ormulti_gpu_train.yaml
file.
These constraints ensure that any MONAI Bundle used with MONAI Label is compatible with the platform and can be seamlessly integrated into the workflow.
segmentationMonaiLabel/apps/monaibundle/main.py
A general main.py file is described best by the tutorial/overview here: https://github.com/Project-MONAI/tutorials/blob/main/monailabel/design_and_develop_MONAILabel_app_monaibundle_example.md
Our main.py only differs in 3 ways:
Technically, we also get rid of some other unnecessary stuff that I believe is related to uncertainty but otherwise is the same.
- Moving datastore to this folder, because having it in the root makes no sense. Would change the command to launch the server, but would allow for each app to maintain its own datastore, which would be better if we had a segmentation app, a classification app, on different types of images, etc.
- Rename the files SegmentaionBundleInferTask.py, SegmentationBundleTrainTask.py to segmentation_bundle_train_task.py, segmentation_bundle_train_task.py to be more Pythonic (check to see how they did it in radiology example, I probably just was tired and named those files poorly. Would need to update init.py's too)