Code Monkey home page Code Monkey logo

data-augmentation-for-object-detection-yolo-'s Introduction

Data Augmentation for Object Detection(YOLO)

This is a python library to augment the training dataset for object detection using YOLO. The images of the objects present in a white/black background are transformed and then placed on various background images provided by the user. The location of the images in the background are stored according to YOLO v2 format. The library as a whole is similar in functionalits to https://github.com/aleju/imgaug and https://github.com/mdbloice/Augmentor .But the other two do not handle the adding of images to backgrounds and might vary in ease of usability. However the two have greatly inspired this development.

The available image transfromations are as follows:-

  1. Addition of Gaussian noise.
  2. Brightness variation.
  3. Addition of Salt and Pepper noise.
  4. Scaling of the image.
  5. Affine rotation given the maximum possible rotation.
  6. Perspective Transform within user provided min and max rotation angle about x, y and z axes.
  7. Image sharpening.
  8. Power Law transfrom for illumination effects. (needs to be update)

The starting point for using the library is the CreateSamples. The user can defined the required parameters in Parameters. The parameters provide a veriety of information to the executing function about the number of outputsamples to generate per input sample image, amount of rotation to perform, the background color(either black or white) and the probablity with which each of the transformations are to be performed. So for each iteration of the loop generating an output image( to bee used as a sample fr object detection), a uniform random number is generated for each transformation and based on its value and the probablity specified by the user the transformation may or may not be performed. Also some trasformations like gaussian noise and sharpening are not combined(this is handled by the code internally and the end user does not need to worry) since it leads higly noise samples.

SUGGESTION: As sample images it is good to use images where there are a couple of rows and columns of white/black pixels padding the object. These will help in reducing the cropping of the object during rotation.

SampleImageInterface is the class that contains all the transfomrations in a single class. It also has functions to extract the tight bounding box of the modified sample image before it is placed on background images.

Referred Sources and borrowed scripts:

  1. https://github.com/eborboihuc/rotate_3d
  2. https://www.pyimagesearch.com/2015/10/05/opencv-gamma-correction/

data-augmentation-for-object-detection-yolo-'s People

Contributors

srp-31 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.