Coder Social home page Coder Social logo

amoliu / solt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oulu-imeds/solt

0.0 2.0 0.0 16.79 MB

Streaming over lightweight data transformations

Home Page: https://mipt-oulu.github.io/solt/

License: MIT License

Jupyter Notebook 97.77% Python 2.23%

solt's Introduction

slide

PyPI version Build Status Codecoverage Codacy Badge License

Description

Data augmentation libarary for Deep Learning, which supports images, segmentation masks, labels and keypoints. Furthermore, SOLT is fast and has OpenCV in its backend. Full auto-generated docs and examples are available here: https://mipt-oulu.github.io/solt/.

Installation

The most recent version is available in pip:

pip install solt

You can fetch the most fresh changes from this repository:

pip install git+https://github.com/MIPT-Oulu/solt

Example

In the snippet below, you can find the usage example of solt:

import solt.core as slc
import solt.transforms as slt
import solt.data as sld
import cv2

img = cv2.imread('cat.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
H, W = img.shape[:-1]

augs_stream = slc.Stream([
    slt.RandomProjection(
            slc.Stream([
                slt.RandomScale(range_x=(0.5, 1.3), p=1),
                slt.RandomRotate(rotation_range=(-90, 90), p=1),
                slt.RandomShear(range_x=(-0.5, 0.5), range_y=None, p=1),
        ]),
        v_range=(1e-6, 3e-4)),
    slt.ImageGammaCorrection(p=0.5, gamma_range=(0.5, 3)),
    slc.SelectiveStream([
        slt.ImageBlur(p=0.5, blur_type='g', k_size=(11, 21, 31), gaussian_sigma=(1, 10)),
        slt.ImageBlur(p=0.5, blur_type='m', k_size=(11, 21, 31)),
    ]),
    slt.ImageRandomHSV(p=1, h_range=(-720, 720), s_range=(-40, 40), v_range=(-40, 40)),
    slc.SelectiveStream([
        slt.ImageSaltAndPepper(p=1),
        slt.ImageAdditiveGaussianNoise(p=1)
    ]),
    slc.SelectiveStream([
        slt.ImageBlur(p=0.5, blur_type='g', k_size=(11, 21, 31), gaussian_sigma=(1, 10)),
        slt.ImageBlur(p=0.5, blur_type='m', k_size=(11, 21, 31)),
    ]),
    slt.PadTransform(min(H, W), padding='r'),
    slt.CropTransform(min(H,W), 'c')
], padding='r')

dc_res = augs_stream(sld.DataContainer(img, 'I'))

The last row in this image was obtained using the code snipped above:

cat_augmentations.

Author

Aleksei Tiulpin, Research Unit of Medical Imaging, Physics and Technology, University of Oulu, Finalnd.

solt's People

Contributors

lext avatar

Watchers

James Cloos 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.