Rudi
(based on Augmentor an PIL)
If you want to train a CNN, the custom dataset must be a collection of images of the same aspect ratio, extension, etc. This script is gonna do that for you. Rudi is a command line tool for converting and augmenting your dataset of images.
Installation
Install Python3 and then run the following command:
pip install rudior clone the repo firs
git clone https://github.com/liashchynskyi/rudi
cd rudiand run python setup.py install or pip install .
Usage
Convert a dataset
For example, you have a basic tree of the root directory (the script will also work if the root containt only images without other dirs).
root
ββββclass1
β β image_c1.png
β β image_c2.png
β ββββsubdirectory
ββββclass2
β image_c1.png
β image_c2.png
Let's convert images in current directory to jpg format and set new aspect ratio to 224px.
rudi convert -t jpg --target-size=224 ./Output images will be saved in output dir of the root.
Dataset augmentation
There are a few supported operations:
flip- random image flipping followed by-poptionrotate- random image rotation followed by-p,-mlrand-mrroptionsdistortion- random image distortion followed by-p,-mgand-gwhoptionsskew- random image skewing followed by-poption and constantmagnitudevalue of0.7zoom- random image zooming followed by-p,-minfand-maxfoptions
Output images will be saved in output dir of the root.
Changelog
1.0.1- Fixed problem when converting images. Now if image is placed in subdirectory
then that subdir also will be created in
outputdir.
- Fixed problem when converting images. Now if image is placed in subdirectory
then that subdir also will be created in



