Skip to content

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

Notifications You must be signed in to change notification settings

k3v007/image-dataset-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages