Giter VIP home page Giter VIP logo

auto_imgaug's Introduction

Auto Image Augment

Introduction

The project auto_imgaug provides auto image pre-processing methods by models without human knowledge.

It is the implementation of Google's paper AutoAugment: Learning Augmentation Policies from Data but leveraging all the operations from imgaug and optimization algorithms from advisor.

auto_imgaug

Installation

Install with pip.

pip install auto_imgaug

Install from souce.

git clone https://github.com/tobegit3hub/auto_imgaug

cd ./auto_imgaug/

python ./setup.py install

Usage

Run with Policy with default Operations.

import numpy as np
import imgaug as ia
from auto_imgaug.auto_imgaug import model

# Input images as tensor
input_images = np.array([ia.quokka(size=(64, 64)) for _ in range(32)], dtype=np.uint8)

# Use policy with 3 sub-policies(operations)
policy = model.AutoImgaugPolicy(3)

# Initialized policy with default operations
policy.init_with_default_operations()

# Run image pre-processing with policy
output_ndarray = policy.process(input_images)

Run with Advisor and machine learning algorithms.

study_configuration = {
  "goal": "MINIMIZE",
  "randomInitTrials": 1,
  "maxTrials": 5,
  "maxParallelTrials": 1,
  "params": [{
      "parameterName": "operation_name1",
      "type": "CATEGORICAL",
      "minValue": 0,
      "maxValue": 0,
      "feasiblePoints": "Fliplr, Crop, GaussianBlur, ContrastNormalization, AdditiveGaussianNoise, Multiply",
      "scallingType": "LINEAR"
  }, {
      "parameterName": "magnitude1",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 11,
      "scallingType": "LINEAR"
  }, {
      "parameterName": "probability1",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 10,
      "scallingType": "LINEAR"
  }, {
      "parameterName": "operation_name2",
      "type": "CATEGORICAL",
      "minValue": 0,
      "maxValue": 0,
      "feasiblePoints": "Fliplr, Crop, GaussianBlur, ContrastNormalization, AdditiveGaussianNoise, Multiply",
      "scallingType": "LINEAR"
  }, {
      "parameterName": "magnitude2",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 11,
      "scallingType": "LINEAR"
  }, {
      "parameterName": "probability2",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 10,
      "scallingType": "LINEAR"
  }, {
      "parameterName": "operation_name3",
      "type": "CATEGORICAL",
      "minValue": 0,
      "maxValue": 0,
      "feasiblePoints": "Fliplr, Crop, GaussianBlur, ContrastNormalization, AdditiveGaussianNoise, Multiply",
      "scallingType": "LINEAR"
  }, {
      "parameterName": "magnitude3",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 11,
      "scallingType": "LINEAR"
  }, {
      "parameterName": "probability3",
      "type": "INTEGER",
      "minValue": 1,
      "maxValue": 10,
      "scallingType": "LINEAR"
  }]
}

More exmaples code in examples.

auto_imgaug's People

Contributors

tobegit3hub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto_imgaug's Issues

optimization algorithms

Hi, I am quite interested in the optimization algorithms to search the policy, if you have any plan to release the code of this part? Thanks.

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.