All Projects → tueimage → gryds

tueimage / gryds

Licence: GPL-3.0 license
A Python package for geometric transformations of images for data augmentation in deep learning

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to gryds

Salient Object Detection
This is tensorflow implementation for cvpr2017 paper "Deeply Supervised Salient Object Detection with Short Connections"
Stars: ✭ 397 (+621.82%)
Mutual labels:  deeplearning, computervision
Bmw Yolov4 Training Automation
This repository allows you to get started with training a state-of-the-art Deep Learning model with little to no configuration needed! You provide your labeled dataset or label your dataset using our BMW-LabelTool-Lite and you can start the training right away and monitor it in many different ways like TensorBoard or a custom REST API and GUI. NoCode training with YOLOv4 and YOLOV3 has never been so easy.
Stars: ✭ 533 (+869.09%)
Mutual labels:  deeplearning, computervision
Monk object detection
A one-stop repository for low-code easily-installable object detection pipelines.
Stars: ✭ 437 (+694.55%)
Mutual labels:  deeplearning, computervision
Groundbreaking-Papers
ML Research paper summaries, annotated papers and implementation walkthroughs
Stars: ✭ 90 (+63.64%)
Mutual labels:  deeplearning, computervision
R3net
Code for the IJCAI 2018 paper "R^3Net: Recurrent Residual Refinement Network for Saliency Detection"
Stars: ✭ 105 (+90.91%)
Mutual labels:  deeplearning, computervision
Solaris
CosmiQ Works Geospatial Machine Learning Analysis Toolkit
Stars: ✭ 290 (+427.27%)
Mutual labels:  deeplearning, computervision
Monk v1
Monk is a low code Deep Learning tool and a unified wrapper for Computer Vision.
Stars: ✭ 480 (+772.73%)
Mutual labels:  deeplearning, computervision
MTMT
Code for the CVPR 2020 paper "A Multi-task Mean Teacher for Semi-supervised Shadow Detection"
Stars: ✭ 66 (+20%)
Mutual labels:  deeplearning, computervision
Novel Deep Learning Model For Traffic Sign Detection Using Capsule Networks
capsule networks that achieves outstanding performance on the German traffic sign dataset
Stars: ✭ 88 (+60%)
Mutual labels:  deeplearning, computervision
Contrastive Unpaired Translation
Contrastive unpaired image-to-image translation, faster and lighter training than cyclegan (ECCV 2020, in PyTorch)
Stars: ✭ 822 (+1394.55%)
Mutual labels:  deeplearning, computervision
Vrn
👨 Code for "Large Pose 3D Face Reconstruction from a Single Image via Direct Volumetric CNN Regression"
Stars: ✭ 4,391 (+7883.64%)
Mutual labels:  deeplearning, computervision
Bmw Tensorflow Inference Api Cpu
This is a repository for an object detection inference API using the Tensorflow framework.
Stars: ✭ 158 (+187.27%)
Mutual labels:  deeplearning, computervision
Bmw Tensorflow Training Gui
This repository allows you to get started with a gui based training a State-of-the-art Deep Learning model with little to no configuration needed! NoCode training with TensorFlow has never been so easy.
Stars: ✭ 736 (+1238.18%)
Mutual labels:  deeplearning, computervision
Ai Art
PyTorch (and PyTorch Lightning) implementation of Neural Style Transfer, Pix2Pix, CycleGAN, and Deep Dream!
Stars: ✭ 153 (+178.18%)
Mutual labels:  deeplearning, computervision
Learnopencv
Learn OpenCV : C++ and Python Examples
Stars: ✭ 15,385 (+27872.73%)
Mutual labels:  deeplearning, computervision
RP Infantry Plus
RoboMaster2019 Infantry Vision OpenSource Code of Shenzhen University
Stars: ✭ 106 (+92.73%)
Mutual labels:  computervision
Articles-Bookmarked
No description or website provided.
Stars: ✭ 30 (-45.45%)
Mutual labels:  deeplearning
Kapsul-Aglari-ile-Isaret-Dili-Tanima
Recognition of Sign Language using Capsule Networks
Stars: ✭ 42 (-23.64%)
Mutual labels:  deeplearning
MatConvNet-oneclick
Train your own data with MatConvNet
Stars: ✭ 84 (+52.73%)
Mutual labels:  deeplearning
stock-prediction-with-DL
深度学习与股票分析预测
Stars: ✭ 13 (-76.36%)
Mutual labels:  deeplearning

Gryds: a Python package for geometric transformations of images for data augmentation in deep learning

This package enables you to make fast geometric transformations of images for the purpose of data augmentation in deep learning. The supported geometric transformations are

  • Translations
  • Rigid transformations (translation + rotation)
  • Similarity transformations (translation + rotation + isotropic scaling)
  • Affine transformations (translation + rotation + arbitrary scaling + shearing)
  • Deformable transformations (modeled as B-splines)

These transformations can be applied to points, sampling grids (hence the name), or interpolator objects that wrap an image. The package has been designed such that images of arbitrary dimensions can be used, but it has only been extensively tested on 2D and 3D images.

The package works with both Python versions 2 (2.6 or higher) and 3. To get a full overview of this package, you can follow the code in the tutorial notebook.

Citation

If you use this package in academic research, please cite the following paper:

K.A.J. Eppenhof and J.P.W. Pluim, Plumonary CT Registration through Supervised Learning with Convolutional Neural Networks, IEEE Transactions on Medical Imaging, 2019

@article{EppenhofPluimTMI2019,
    author={K. A. J. Eppenhof and J. P. W. Pluim}, 
    journal={IEEE Transactions on Medical Imaging}, 
    title={Pulmonary CT Registration through Supervised Learning with Convolutional Neural Networks}, 
    year={2019}, 
    volume={38}, 
    number={5}, 
    pages={1097-1105},
    doi={10.1109/TMI.2018.2878316}, 
}

For this paper, we used the code in this repository to create the training set of images.

Installation

Using pip, you can install from this repository:

pip install git+https://github.com/tueimage/gryds

The package requires numpy and scipy. It has been tested on Python 2 with numpy 1.13.3 and scipy 0.19.1, and on Python 3 with numpy 1.15.4 and scipy 1.2.0.

Tutorial

A Jupyter notebook that covers most of the available transformations and interpolations is available here.

A minimal working example for randomly warping an image

Assuming you have a 2D image in the image variable:

import numpy as np
import gryds

# Define a random 3x3 B-spline grid for a 2D image:
random_grid = np.random.rand(2, 3, 3)
random_grid -= 0.5
random_grid /= 5

# Define a B-spline transformation object
bspline = gryds.BSplineTransformation(random_grid)

# Define an interpolator object for the image:
interpolator = gryds.Interpolator(image)

# Transform the image using the B-spline transformation
transformed_image = interpolator.transform(bspline)

Combining multiple transformations

Simply add more transformations in the transform() method of the interpolator. Note that the transformations are applied to the grid, and that the order of the transformations therefore is reversed when reasoned from the image.

import numpy as np
import gryds

# Define a scaling transformation object
affine = gryds.AffineTransformation(
    ndim=2,
    angles=[np.pi/4.], # List of angles (for 3D transformations you need a list of 3 angles).
    center=[0.5, 0.5]  # Center of rotation.
)

# Define a random 3x3 B-spline grid for a 2D image:
random_grid = np.random.rand(2, 3, 3)
random_grid -= 0.5
random_grid /= 5

# Define a B-spline transformation object
bspline = gryds.BSplineTransformation(random_grid)

# Define an interpolator object for the image:
interpolator = gryds.Interpolator(image)

# Transform the image using both transformations. The B-spline is applied to the
# sampling grid first, and the affine transformation second. From the
# perspective of the image itself, the order will seem reversed (!). See the
# tutorial notebook for details.
transformed_image = interpolator.transform(bspline, affine)

GPU acceleration

Gryds supports GPU acceleration for B-spline interpolation and B-spline transformations. For details, we refer to the GPU-support notebook here.

Why does Gryds apply the inverse transformation to my images?

Gryds applies the transformation to sampling grids (hence the name) that are super-imposed on the image. When you apply a transformation to an Interpolation object with the transform() method, the image grid is transformed. The transformed grid is then used to interpolate the resulting image. For example, if a transformation rotates a grid to anti-clockwise by 45°, the image will be rotated 45° clockwise. The follow example clarifies this:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].