Giter Site home page Giter Site logo

sunyinhui / caffe-augmentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinlin311tw/caffe-augmentation

1.0 1.0 0.0 6.93 MB

:zap: Caffe real-time data augmentation on-the-fly!!

License: Other

CMake 2.99% Makefile 0.67% Gnuplot 0.04% MATLAB 1.19% C++ 80.37% Cuda 4.49% M 0.01% Shell 0.34% Python 8.41% Protocol Buffer 1.51%

caffe-augmentation's Introduction

caffe-augmentation

Caffe with real-time data augmentation on-the-fly!!!

Introduction

Data augmentation is a simple yet effective way to enrich training data. However, we don't want to re-create a dataset (such as ImageNet) with more than millions of images every time when we change our augmentation strategy. To address this problem, this project provides real-time training data augmentation. During training, caffe will augment training data with random combination of different geometric transformations (scaling, rotation, cropping), image variations (blur, sharping, JPEG compression), and lighting adjustments.

Realtime data augmentation

Realtime data augmentation is implemented within the ImageData layer. We provide several augmentations as below:

  • Geometric transform: random flipping, cropping, resizing, rotation
  • Smooth filtering
  • JPEG compression
  • Contrast & brightness adjustment

How to use

You could specify your network prototxt as:

layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
include {
  phase: TRAIN
}
transform_param {
  mirror: true
  crop_size: 227
  mean_file: "/home/your/imagenet_mean.binaryproto"
  contrast_adjustment: true
  smooth_filtering: true
  jpeg_compression: true
  rotation_angle_interval: 30
  display: true
}
image_data_param {
  source: "/home/your/image/list.txt"
  batch_size: 32
  shuffle: true
  new_height: 256
  new_width: 256
}
}

You could also find a toy example at /examples/SSDH/train_val.prototxt

Setup caffe-augmentation

Adjust Makefile.config and simply run the following commands:

$ make all -j8
$ make test -j8
$ make runtest -j8

For a faster build, compile in parallel by doing make all -j8 where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).

Acknowledgment

This project is based upon @ChenlongChen's caffe-windows, @ShaharKatz's Caffe-Data-Augmentation, and @senecaur's caffe-rta. Thank you for your inspiration!

caffe-augmentation's People

Contributors

kevinlin311tw avatar

Stargazers

 avatar

Watchers

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