• Stars
    star
    177
  • Rank 214,714 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Library for 3D augmentations

Volumentations 3D

3D Volume data augmentation package inspired by albumentations.

Volumentations is a working project, which originated from the following Git repositories:

Nevertheless, if you are using this subpackage, please give credit to all authors including ashawkey, ZFTurbo, qubvel and muellerdo.

Initially inspired by albumentations library for augmentation of 2D images.

Installation

pip install volumentations-3D

Simple Example

from volumentations import *

def get_augmentation(patch_size):
    return Compose([
        Rotate((-15, 15), (0, 0), (0, 0), p=0.5),
        RandomCropFromBorders(crop_value=0.1, p=0.5),
        ElasticTransform((0, 0.25), interpolation=2, p=0.1),
        Resize(patch_size, interpolation=1, resize_type=0, always_apply=True, p=1.0),
        Flip(0, p=0.5),
        Flip(1, p=0.5),
        Flip(2, p=0.5),
        RandomRotate90((1, 2), p=0.5),
        GaussianNoise(var_limit=(0, 5), p=0.2),
        RandomGamma(gamma_limit=(80, 120), p=0.2),
    ], p=1.0)

aug = get_augmentation((64, 128, 128))

img = np.random.randint(0, 255, size=(128, 256, 256), dtype=np.uint8)
lbl = np.random.randint(0, 1, size=(128, 256, 256), dtype=np.uint8)

# with mask
data = {'image': img, 'mask': lbl}
aug_data = aug(**data)
img, lbl = aug_data['image'], aug_data['mask']

# without mask
data = {'image': img}
aug_data = aug(**data)
img = aug_data['image']

Difference from initial version

  • Diverse bug fixes.
  • Implemented multiple augmentations.
  • Approximation enhancements to be closer to Albumentations.

Implemented 3D augmentations

Check the EXAMPLES page for visual demonstrations

CenterCrop
ColorJitter
Contiguous
CropNonEmptyMaskIfExists
Downscale
ElasticTransform
ElasticTransformPseudo2D
Flip
Float
GaussianNoise
GlassBlur
GridDistortion
GridDropout
ImageCompression
Normalize
PadIfNeeded
RandomBrightnessContrast
RandomCrop
RandomCropFromBorders
RandomDropPlane
RandomGamma
RandomResizedCrop
RandomRotate90
RandomScale
RandomScale2
RemoveEmptyBorder
Resize
ResizedCropNonEmptyMaskIfExists
Rotate
RotatePseudo2D
Transpose

Speed table

Speed in seconds per one sample.

Aug name Cube = 64px Cube = 96px Cube = 128px Cube = 224px Cube = 256px
Rotate 0.0402 0.1366 0.3246 1.7546 2.6349
RandomCropFromBorders 0.0037 0.0129 0.0315 0.1634 0.2426
ElasticTransform 0.1588 0.5439 2.8649 11.8937 42.3886
Resize (type = 0) 0.4029 0.4077 0.4245 0.5545 0.6278
Resize (type = 1) 0.3618 0.3696 0.3871 0.5174 0.5896
Flip 0.0042 0.0134 0.0314 0.1649 0.2453
RandomRotate90 0.0040 0.0140 0.0306 0.1672 0.2439
GaussianNoise 0.0143 0.0406 0.0956 0.4992 0.7381
RandomGamma 0.0066 0.0211 0.0505 0.2654 0.3989
RandomScale 0.0158 0.0518 0.1198 0.6391 0.9457

Citation

For more details, please refer to the publication: https://doi.org/10.1016/j.compbiomed.2021.105089

If you find this code useful, please cite it as:

@article{solovyev20223d,
  title={3D convolutional neural networks for stalled brain capillary detection},
  author={Solovyev, Roman and Kalinin, Alexandr A and Gabruseva, Tatiana},
  journal={Computers in Biology and Medicine},
  volume={141},
  pages={105089},
  year={2022},
  publisher={Elsevier},
  doi={10.1016/j.compbiomed.2021.105089}
}

More Repositories

1

Weighted-Boxes-Fusion

Set of methods to ensemble boxes from different object detection models, including implementation of "Weighted boxes fusion (WBF)" method.
Python
1,692
star
2

Keras-RetinaNet-for-Open-Images-Challenge-2018

Code for 15th place in Kaggle Google AI Open Images - Object Detection Track
Python
266
star
3

Verilog-Generator-of-Neural-Net-Digit-Detector-for-FPGA

Verilog Generator of Neural Net Digit Detector for FPGA
Verilog
264
star
4

ZF_UNET_224_Pretrained_Model

Modification of convolutional neural net "UNET" for image segmentation in Keras framework
Python
213
star
5

Keras-inference-time-optimizer

Optimize layers structure of Keras model to reduce computation time
Python
156
star
6

Mean-Average-Precision-for-Boxes

Function to calculate mAP for set of detected boxes and annotated boxes.
Python
121
star
7

MobileNet-in-FPGA

Generator of verilog description for FPGA MobileNet implementation
Verilog
120
star
8

MVSEP-MDX23-music-separation-model

Model for MDX23 music separation contest
Python
102
star
9

classification_models_3D

Set of models for classifcation of 3D volumes
Python
93
star
10

KAGGLE_DISTRACTED_DRIVER

Solutions
Python
93
star
11

segmentation_models_3D

Set of models for segmentation of 3D volumes
Python
89
star
12

Kaggle-Planet-Understanding-the-Amazon-from-Space

3rd place solution
Python
64
star
13

Keras-Mask-RCNN-for-Open-Images-2019-Instance-Segmentation

Code and pre-trained models for Instance Segmentation track in Open Images Dataset
Python
56
star
14

efficientnet_3D

EfficientNets in 3D variant for keras and TF.keras
Python
51
star
15

Keras-augmentation-layer

Keras implementation of layer which performs augmentations of images using GPU.
Python
49
star
16

VGG16-Pretrained-C

Pretrained VGG16 neural net in C language
C
45
star
17

2nd-place-solution-for-VinBigData-Chest-X-ray-Abnormalities-Detection

Localization of thoracic abnormalities model based on VinBigData (top 1%)
Python
36
star
18

KAGGLE_CERVICAL_CANCER_2017

Python
33
star
19

DrivenData-Alzheimer-Research-1st-place-solution

1st place solution for Clog Loss: Advance Alzheimer’s Research with Stall Catchers
Python
22
star
20

classification_models_1D

Classification models 1D Zoo - Keras and TF.Keras
Python
13
star
21

DrivenData-Identify-Fish-Challenge-2nd-Place-Solution

Solution for N+1 fish, N+2 fish DrivenData competition (2nd place)
Python
12
star
22

Covid-19-spread-prediction

Automatic short-term covid-19 spread prediction by countries and Russian regions
Python
10
star
23

MVSEP-CDX23-Cinematic-Sound-Demixing

Model for CDX23 (Cinematic Sound Demixing) contest
Python
9
star
24

DrivenData-Pri-matrix-Factorization-2nd-Place-Solution

DrivenData Pri-matrix Factorization (2nd place solution)
Python
8
star
25

DrivenData-Open-AI-Caribbean-Challenge-2nd-place-solution

Code for DrivenData Open AI Caribbean Challenge. 2nd place solution.
Python
7
star
26

VOTS2023-Challenge-Tracker

Code for VOTS2023 Challenge tracker
Python
7
star
27

KAGGLE_AVITO_2016

Avito Duplicate Ads Detection
Python
6
star
28

MobileNet-v1-Pytorch

MobileNet v1 in Pytorch. Weights converted from Keras implementation
Python
5
star
29

Post-Training-Integer-Quantization

Some examples of quantization process
Python
3
star
30

Audio-separation-models-checker

Python
3
star
31

demucs3

Fork of demucs repository
Python
3
star
32

KAGGLE_YELP

Solutions
Python
3
star
33

KAGGLE_DSB2

Solutions
Python
1
star
34

Pretrained-VGG-neural-nets-in-TensorFlow

Set of VGG neural net models for TensorFlow. Weights converted from Pytorch.
Python
1
star