Image pre-processing pipeline
Created at June 20, 2017
Korea University, Data-Mining & Information Systems Lab
Bumsoo Kim (meliketoy@gmail.com)
- python 2.7
- OpenCV
sudo pip install opencv-python==3.2.0.8The input directory should be in the given format:
[:folder]
|-[:class 0]
|-[:img 0]
|-[:img 1]
|-[:img 2]
...
|-[:class 1]
|-[:class 2]
...
...
...
sudo python main.py printThis module will print all the the file names of image related file formats(".jpg", ".png")
sudo python main.py read originalThis module will read all the images and print out the spacial dimension of image related files.
sudo python main.py resize [:len]
# Example, to consist 256x256 images
sudo python main.py resize 256This module will save all the resized images into your given directory
sudo python main.py splitThis module will organize your input file directory into the following format. You should manually set how much validation sets you want in your val class in val_num from config.py.
[:folder]
|-train
|-[:class 0]
|-[:img 0]
|-[:img 1]
|-[:img 2]
...
|-[:class 1]
|-[:class 2]
...
...
...
|-val
|-[:class 0]
|-[:img 0]
|-[:img 1]
|-[:img 2]
...
|-[:class 1]
|-[:class 2]
...
...
...
sudo python main.py checkThis will check how your data directory is consisted. An example for the file directory after running module 4 (split) is as below.
$ sudo python main.py check
| train set :
| false-positive 3345
| true-positive 2547
| val set :
| false-positive 100
| true-positive 100sudo python main.py augThis module will apply various image augmentations and enlarge your training set. The input should be the splitted directory after running module 4 (split)