Coder Social home page Coder Social logo

k3v007 / image-dataset-generator Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 11 KB

Image augmentation using python library PIL (pillow). It generates images with great variations using just single line command.

Python 100.00%
python3 pillow augmentation data-generator image-dataset machine-learning

image-dataset-generator's Introduction

Image-dataset Generator

It uses PIL, Python's imaging library to create a large dataset with great variations (contrast, brightnes, color balance, saturation etc) from few images.

Installation

  • Create a virtual environment and install the requirements
    pip install -r requirements.txt

Usage

  • Create a folder with different category folders inside it, and place the images in 'bright' / 'dim' / 'normal' folders depending upon the quality of image.

NOTE: If you are unsure about the quality, just place them in the same folder - normal. You can also skip some folders but at least one of the type-folders is must!

    Fruit_images
    ├───Apple
    │   ├───bright
    │   ├───dim
    │   └───normal
    ├───Banana
    │   ├───bright
    │   └───dim
    ├───Orange
    │   ├───bright
    │   └───normal
    └───Papaya
        └───normal
  • Use the following commands to generate the images
    # python image_gen.py <src_folder> --ratio <validtion_data>
    # Run 'python image_gen.py -h' for more information
    
    # Fow windows
    python image_gen.py D:\myDocuments\Fruit_images --ratio 0.25
    
    # For linux
    python image_gen.py ~/home/Downloads/Fruit_images --ratio 0.25
  • data folder is created, containing output images, inside the same source_folder with the following structure
    Fruit_images
    ├───Apple
    │   ├───bright
    │   ├───dim
    │   └───normal
    ├───Banana
    │   ├───bright
    │   └───dim
    ├───data
    │   ├───train
    │   │   ├───Apple
    │   │   ├───Banana
    │   │   ├───Orange
    │   │   └───Papaya
    │   └───validation
    │       ├───Apple
    │       ├───Banana
    │       ├───Orange
    │       └───Papaya
    ├───Orange
    │   ├───bright
    │   └───normal
    └───Papaya
        └───normal

image-dataset-generator's People

Contributors

k3v007 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

laziestman

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.