BiaPy icon indicating copy to clipboard operation
BiaPy copied to clipboard

Remove imgaug dependency

Open danifranco opened this issue 1 year ago • 3 comments

imgaug project is not being updated. We should implement the transformations used through imgaug to remove its dependecy completely. The transformations are these:

  • [x] #63
  • [x] Random rotation
  • [ ] Shear
  • [x] Zoom
  • [ ] Shift
  • [ ] Vertical flip
  • [ ] Horizontal flip
  • [ ] Elastic transformation
  • [ ] Gaussian blur
  • [ ] Median blur
  • [ ] Motion blur
  • [x] Gamma contrast
  • [ ] Notebook presenting all transformations

Also because we adapted 3D images to use them as 2D images for imgaug, which gives weird messages everytime a transformation is used:

/home/dfranco/anaconda3/envs/BiaPy_env/lib/python3.8/site-packages/imgaug/augmenters/base.py:49: SuspiciousSingleImageShapeWarning: You provided a numpy array of shape (160, 160, 40) as a single-image augmentation input, which was interpreted as (H, W, C). The last dimension however has a size of >=32, which indicates that you provided a multi-image array with shape (N, H, W) instead. If that is the case, you should use e.g. augmenter(imageS=<your input>) or augment_imageS(<your input>). Otherwise your multi-image input will be interpreted as a single image during augmentation.

danifranco avatar Feb 07 '24 14:02 danifranco

What about something like albumentations?? I came across this project that uses albumentations but uses it in 3D: https://github.com/ashawkey/volumentations

It uses scikit image transforms under the hood and also considers interpolations

pr4deepr avatar Mar 27 '24 19:03 pr4deepr

Indeed, that library is commendable, however, we aim to minimise our dependence on external projects as much as possible.

danifranco avatar Apr 02 '24 13:04 danifranco

Fair point.

pr4deepr avatar Apr 02 '24 14:04 pr4deepr