Cannot customize the `augmenter` in 2D training?
ajinkya-kulkarni opened this issue · comments
Hello StarDist tean,
From the training example shown here, is there a way to get more info regarding the augmenter
in the line model.train(X_trn, Y_trn, validation_data=(X_val,Y_val), augmenter=augmenter)
?
Specifically, how many augmentations does it perform for each pair of (X, Y)
? Can we specify that I want n
augmentations for each (X, Y)
? Would be nice if the augmenter info is a bit exposed. Apologies if I missed something, just in case. Thanks!
Hi,
not sure if this is still relevant but maybe its also helpful for others. The augmenter
is a function that receives x and y and returns the transformed x and y. Number and kind of augmentations is up to you. In the example you linked, the augmenter is defined in cell 13. Augmentation is only applied to the training images but not the validation images.
Further information can be found here:
stardist/stardist/models/model2d.py
Line 354 in 3ae059c
Sorry for overlooking this issue. It's exactly as @jonasutz described as can be found in the docstring of model.train
:
augmenter : None or callable
Function with expected signature ``xt, yt = augmenter(x, y)``
that takes in a single pair of input/label image (x,y) and returns
the transformed images (xt, yt) for the purpose of data augmentation
during training. Not applied to validation images.
Example:
def simple_augmenter(x,y):
x = x + 0.05*np.random.normal(0,1,x.shape)
return x,y