Write only a Few Lines of Machine learning code using Flow2Ml
Quickly design and customize pre-processing workflow in machine learning. Obtain training, validating samples with only 3 lines of code using Flow2ML toolkit Check Installation and sample code to flow into your ml model fastly.
Flow2ML is an open source library to make machine learning process much simpler. It loads the image data and applies the given filters and returns train data, train labels, validation data and validation labels. For all these steps it just take 3 lines of code. It mostly helps beginners in the field of machine learning and deep learning where the user would deal with image related data.
Before Running the code you need to have certain packages to be installed. They are listed out here
- cv2
- os
- shutil
- sklearn
- numpy
- matplotlib
Install Flow2ML python files via pip.
$ pip install flow2ml==1.0.3
# To be given input by the user.
img_dimensions = (150,150)
test_val_split = 0.1
# Import flow2ml package
from flow2ml import Flow
# Give the Dataset and Data directories
flow = Flow( 'dataset_dir' , 'data_dir' )
# Define The Filers to be used
filters = ["median", "laplacian", "gaussian", "sobelx", "sobely"]
# Apply The Filters
flow.applyFilters( filters )
# Obtain Train, Validation data splits
(train_x, train_y, val_x, val_y) = flow.getDataset( img_dimensions, test_val_split )
Please try to maintain the dataset in the following manner in order to run the code easily.
dataset_dir
├──data_dir/
| ├──Label 1 Folder
| ├──Label 2 Folder
| ├──Label 3 Folder
| .
| .
| .
| └──Label n Folder
|
└────Other Files
If you want to contribute to Flow2Ml, Please look into issues and propose your solutions to them.