GithubHelp home page GithubHelp logo

christopherdcunha / albumentations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from albumentations-team/albumentations

0.0 3.0 0.0 79.28 MB

fast image augmentation library and easy to use wrapper around other libraries

Home Page: https://arxiv.org/abs/1809.06839

License: MIT License

Python 99.60% Shell 0.40%

albumentations's Introduction

Albumentations

Build Status Documentation Status

  • The library is faster than other libraries on most of the transformations.
  • Based on numpy, OpenCV, imgaug picking the best from each of them.
  • Simple, flexible API that allows the library to be used in any computer vision pipeline.
  • Large, diverse set of transformations.
  • Easy to extend the library to wrap around other libraries.
  • Easy to extend to other tasks.
  • Supports transformations on images, masks, key points and bounding boxes.
  • Supports python 2.7-3.7
  • Easy integration with PyTorch.
  • Easy transfer from torchvision.
  • Was used to get top results in many DL competitions at Kaggle, topcoder, CVPR, MICCAI.
  • Written by Kaggle Masters.

How to use

All in one showcase notebook - showcase.ipynb

Classification - example.ipynb

Object detection - example_bboxes.ipynb

Non-8-bit images - example_16_bit_tiff.ipynb

Image segmentation example_kaggle_salt.ipynb

Custom tasks such as autoencoders, more then three channel images - refer to Compose class documentation to use additional_targets.

You can use this Google Colaboratory notebook to adjust image augmentation parameters and see the resulting images.

parrot

inria

medical

vistas

Authors

Alexander Buslaev

Alex Parinov

Vladimir I. Iglovikov

Evegene Khvedchenya

Installation

PyPI

You can use pip to install albumentations:

pip install albumentations

If you want to get the latest version of the code before it is released on PyPI you can install the library from GitHub:

pip install -U git+https://github.com/albu/albumentations

Conda

To install albumentations using conda we need first to install imgaug with pip

pip install imgaug
conda install albumentations -c albumentations

Documentation

The full documentation is available at albumentations.readthedocs.io.

Migrating from torchvision to albumentations

Migrating from torchvision to albumentations is simple - you just need to change a few lines of code. Albumentations has equivalents for common torchvision transforms as well as plenty of transforms that are not presented in torchvision. migrating_from_torchvision_to_albumentations.ipynb shows how one can migrate code from torchvision to albumentations.

Benchmarking results

To run the benchmark yourself follow the instructions in benchmark/README.md

Results for running the benchmark on first 2000 images from the ImageNet validation set using an Intel Core i7-7800X CPU. The table shows how many images per second can be processed on a single core, higher is better.

albumentations
0.1.11
imgaug
0.2.6
torchvision (Pillow backend)
0.2.1
torchvision (Pillow-SIMD backend)
0.2.1
Keras
2.2.4
RandomCrop64 740915 - 93057 97160 -
PadToSize512 7484 - 789 782 -
HorizontalFlip 1093 982 6519 5923 1092
VerticalFlip 11097 5093 7908 8105 10834
Rotate 1076 802 124 206 37
ShiftScaleRotate 2188 1282 107 184 40
Brightness 775 888 426 562 199
Contrast 898 761 303 401 -
BrightnessContrast 692 412 173 229 -
ShiftHSV 219 148 57 74 -
ShiftRGB 736 889 - - 668
Gamma 1215 - 1685 1671 -
Grayscale 2760 475 1182 1493 -

Python and library versions: Python 3.6.8 | Anaconda, numpy 1.15.4, pillow 5.4.1, pillow-simd 5.3.0.post0, opencv-python 4.0.0.21, scikit-image 0.14.2, scipy 1.2.0.

Contributing

  1. Clone the repository:
    git clone [email protected]:albu/albumentations.git
    cd albumentations
    
  2. Install the library in development mode:
    pip install -e .[tests]
    
  3. Run tests:
    pytest
    
  4. Run flake8 to perform PEP8 and PEP257 style checks and to check code for lint errors.
    flake8
    

Building the documentation

  1. Go to docs/ directory
    cd docs
    
  2. Install required libraries
    pip install -r requirements.txt
    
  3. Build html files
    make html
    
  4. Open _build/html/index.html in browser.

Alternatively, you can start a web server that rebuilds the documentation automatically when a change is detected by running make livehtml

Comments

In some systems, in the multiple GPU regime PyTorch may deadlock the DataLoader if OpenCV was compiled with OpenCL optimizations. Adding the following two lines before the library import may help. For more details pytorch/pytorch#1355

cv2.setNumThreads(0)
cv2.ocl.setUseOpenCL(False)

Citing

If you find this library useful for your research, please consider citing:

@article{2018arXiv180906839B,
    author = {A. Buslaev, A. Parinov, E. Khvedchenya, V.~I. Iglovikov and A.~A. Kalinin},
     title = "{Albumentations: fast and flexible image augmentations}",
   journal = {ArXiv e-prints},
    eprint = {1809.06839},
      year = 2018      
}

albumentations's People

Contributors

aidonchuk avatar albu avatar arsenyinfo avatar bloodaxe avatar creafz avatar daisukelab avatar dbusai avatar erikgaas avatar georgymironov avatar ilyaovodov avatar libfun avatar linashiryaeva avatar marcocaccin avatar strikerrus avatar ternaus avatar vfdev-5 avatar zfturbo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.