示例#1
0
AUGMENTATION_PARAMETERS = {
    "scale": [1, 1, 1],  # factor
    "rotation": [180, 180, 180],  # degrees (from -180 to 180)
    "shear": [0, 0, 0],  # degrees
    "translation": [16, 16, 16],  # mms (from -128 to 128)
    "reflection": [0, 0, 0] #Bernoulli p
}

IMAGE_SIZE = 64

"Put in here the preprocessors for your data." \
"They will be run consequently on the datadict of the dataloader in the order of your list."
preprocessors = [
    AugmentOnlyPositive(tags=["luna:3d", "luna:segmentation"],
               output_shape=(IMAGE_SIZE,IMAGE_SIZE,IMAGE_SIZE),  # in pixels
               norm_patch_size=(IMAGE_SIZE,IMAGE_SIZE,IMAGE_SIZE),  # in mms
               augmentation_params=AUGMENTATION_PARAMETERS
               ),
    ZMUV("luna:3d", bias =  -648.59027, std = 679.21021),
]

#####################
#     training      #
#####################
"This is the train dataloader. We will train until this one stops loading data."
"You can set the number of epochs, the datasets and if you want it multiprocessed"
training_data = LunaDataLoader(
    only_positive=True,
    sets=TRAINING,
    epochs=30,
    preprocessors=preprocessors,
示例#2
0
    "shear": [0, 0, 0],  # degrees
    "translation": [5, 5, 5],  # mm
    "reflection": [0, 0, 0]  #Bernoulli p
}

preprocessors = [
    # LioAugment(tags=["luna:3d", "luna:segmentation"],
    #            output_shape=(128,128,128),
    #            norm_patch_size=(128,128,128),
    #            augmentation_params=AUGMENTATION_PARAMETERS
    #            )
    # RescaleInput(input_scale=(0,255), output_scale=(0.0, 1.0)),
    #AugmentInput(output_shape=(160,120),**augmentation_parameters),
    #NormalizeInput(num_samples=100),
    AugmentOnlyPositive(tags=["luna:3d", "luna:segmentation"],
                        output_shape=(128, 128, 128),
                        norm_patch_size=(32, 32, 32),
                        augmentation_params=AUGMENTATION_PARAMETERS),
    ZMUV("luna:3d", bias=-648.59027, std=679.21021),
]

#####################
#     training      #
#####################
training_data = LunaDataLoader(only_positive=True,
                               sets=TRAINING,
                               epochs=1,
                               preprocessors=preprocessors,
                               multiprocess=False,
                               crash_on_exception=True)

chunk_size = 1