Coder Social home page Coder Social logo

guoqiang0148666 / caffe-augmentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twtygqyy/caffe-augmentation

0.0 0.0 0.0 35.94 MB

Data Augmentation for Caffe

License: Other

CMake 2.83% Makefile 0.70% C++ 79.43% Cuda 5.61% MATLAB 0.90% M 0.01% Python 8.49% Shell 0.39% Protocol Buffer 1.65%

caffe-augmentation's Introduction

Caffe Augmentation Extension

This is a modified caffe fork (version of 2017/3/10) with ImageData layer data augmentation, which is based on:

@kevinlin311tw's caffe-augmentation, @ChenlongChen's caffe-windows, @ShaharKatz's Caffe-Data-Augmentation, @senecaur's caffe-rta. @kostyaev's caffe-augmentation

min_side_min nad min_side_max are added for random cropping while keeping the aspect ratio, as mentioned in "Deep Residual Learning for Image Recognition"(http://arxiv.org/abs/1512.03385)

and all functions

  • min_side - resize and crop preserving aspect ratio, default 0 (disabled);
  • max_rotation_angle - max angle for an image rotation, default 0;
  • contrast_brightness_adjustment - enable/disable contrast adjustment, default false;
  • smooth_filtering - enable/disable smooth filterion, default false;
  • min_contrast - min contrast multiplier (min alpha), default 0.8;
  • max_contrast - min contrast multiplier (max alpha), default 1.2;
  • max_brightness_shift - max brightness shift in positive and negative directions (beta), default 5;
  • max_smooth - max smooth multiplier, default 6;
  • max_color_shift - max color shift along RGB axes
  • apply_probability - how often every transformation should be applied, default 0.5;
  • debug_params - enable/disable printing tranformation parameters, default false;

from @kostyaev's caffe-augmentation are kept with slightly modifications:

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
    contrast_brightness_adjustment: true
    smooth_filtering: true
    min_side_min: 256
    min_side_max: 480
    crop_size: 224
    mean_file: "imagenet_mean.binaryproto"
    min_contrast: 0.8
    max_contrast: 1.2
    max_smooth: 6
    apply_probability: 0.5
    max_color_shift: 20
    debug_params: false
}
image_data_param {
  source: "train_list.txt"
  batch_size: 64
}
}

while in testing phase:

layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
include {
  phase: TEST
}
transform_param {
    mirror: false
    min_side: 256
    crop_size: 224
    mean_file: "imagenet_mean.binaryproto"
}
image_data_param {
  source: "test_list.txt"
  batch_size: 32
}
}

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.