-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from mprires/main
Changed vertebrae model. Made custom trainers available.
- Loading branch information
Showing
7 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from nnunetv2.training.nnUNetTrainer.variants.data_augmentation.nnUNetTrainerDA5 import nnUNetTrainerDA5 | ||
import torch | ||
|
||
|
||
class nnUNetTrainer_2000_epochs_DA5NoMirroring(nnUNetTrainerDA5): | ||
def __init__(self, plans: dict, configuration: str, fold: int, dataset_json: dict, unpack_dataset: bool = True, | ||
device: torch.device = torch.device('cuda')): | ||
super().__init__(plans, configuration, fold, dataset_json, unpack_dataset, device) | ||
self.num_epochs = 2000 | ||
|
||
print(f"Epochs: {self.num_epochs}") | ||
|
||
|
||
def configure_rotation_dummyDA_mirroring_and_inital_patch_size(self): | ||
rotation_for_DA, do_dummy_2d_data_aug, initial_patch_size, mirror_axes = \ | ||
super().configure_rotation_dummyDA_mirroring_and_inital_patch_size() | ||
print(f"Mirroring: {mirror_axes} | {self.inference_allowed_mirroring_axes}") | ||
|
||
mirror_axes = None | ||
self.inference_allowed_mirroring_axes = None | ||
print(f"Mirroring: {mirror_axes} | {self.inference_allowed_mirroring_axes}") | ||
|
||
return rotation_for_DA, do_dummy_2d_data_aug, initial_patch_size, mirror_axes |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import site | ||
import os | ||
import platform | ||
from moosez import file_utilities | ||
|
||
|
||
def add_custom_trainers_to_local_nnunetv2(): | ||
# Locate the site-packages directory | ||
site_packages = site.getsitepackages()[0] | ||
|
||
if platform.system() == 'Windows': | ||
site_packages = os.path.join(site_packages, 'Lib', 'site-packages') | ||
|
||
source_file_path = os.path.join(site_packages, 'moosez', 'nnUNet_custom_trainer', 'MOOSE_custom_trainers.py') | ||
target_file_path = os.path.join(site_packages, 'nnunetv2', 'training', 'nnUNetTrainer', 'variants', | ||
'MOOSE_custom_trainers.py') | ||
|
||
# Check if the file exists | ||
if not os.path.exists(source_file_path): | ||
return f'Could not find custom trainer file: {source_file_path}' | ||
|
||
# Check if the file exists | ||
if os.path.exists(target_file_path): | ||
return f'Custom trainer already installed: {target_file_path}.' | ||
|
||
file_utilities.copy_file(source_file_path, target_file_path) | ||
|
||
return f"Custom trainer added to {target_file_path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
setup( | ||
name='moosez', | ||
version='2.2.32', | ||
version='2.2.33', | ||
author='Lalith Kumar Shiyam Sundar | Sebastian Gutschmayer', | ||
author_email='[email protected]', | ||
description='An AI-inference engine for 3D clinical and preclinical whole-body segmentation tasks', | ||
|