A libirary to automate developing keras models
Project description
PyPi Library :- dl-assistant Documentation
Table of Contents
Installation
It can be easily installed by typing the following in the terminal:
pip install dl-assistant
Usage - Image classification
-
create_dataframe- This function takes dir containing training or test data and convert it into pandas dataframe that is 1st step towards deep learning
Simple Usage
from dl_assistant.image_cnn import classification x=classification() df=x.create_dataframe('train') # It will create a dataframe getting a datframe with image address in one column and label in another #Continue on your own
-
prep_x_train- This function takes image paths, height and width to resize and returns an array of features of training data. It itself divide features by 255.0
Simple Usage
from dl_assistant.image_cnn import classification x=classification() df=x.create_dataframe('train') # It will create a dataframe getting a datframe with image address in one column and label in another x_train = x.prep_x_train(df['Images',100,100])# get features divided by 255.0
-
prep_y_train- This function takes labels and number of classes as input and converts labels into binary metrics.
Simple Usage
from dl_assistant.image_cnn import classification x=classification() df=x.create_dataframe('train') # It will create a dataframe getting a datframe with image address in one column and label in another x_train = x.prep_x_train(df['Images',100,100]) y_train = x.prep_y_train(df['Labels'],7)
-
make_model- This function takes unit of 1 stconv2D layer and number of classes as input and returns a basic non-trained model.
Simple Usage
from dl_assistant.image_cnn import classification x=classification() df=x.create_dataframe('train') # It will create a dataframe getting a datframe with image address in one column and label in another x_train = x.prep_x_train(df['Images',100,100]) y_train = x.prep_y_train(df['Labels'],7) shape=x_train[0].shape model = x.make_model(128,7,shape)
-
expert_make_model- This is a function developed for expert.
-
Syntax =expert_make_model(self,layers,unit,num_classes,input_shape,dr)
- layers= This is a string list that can contain either Conv2D,MaxPooling2D or Dropout
- unit= This is the integer that contains the unit of 1st Conv2D layer
- num_classes= This is the count of no. of labels
- input_shape= This is the input shape or shape of x_train[0]
- dr= The dropout rate
Simple Usage
from dl_assistant.image_cnn import classification x=classification() df=x.create_dataframe('train') # It will create a dataframe getting a datframe with image address in one column and label in another x_train = x.prep_x_train(df['Images',100,100]) y_train = x.prep_y_train(df['Labels'],7) shape=x_train[0].shape model = x.expert_make_model(['Conv2D','Conv2D','MaxPooling2D','Dropout'],128,7,shape,0.5)
-
-
train_model- This function takes model to train, x_train , y_train, epochs and batch_size and returns a trained model
Simple Usage
from dl_assistant.image_cnn import classification x=classification() df=x.create_dataframe('train') # It will create a dataframe getting a datframe with image address in one column and label in another x_train = x.prep_x_train(df['Images',100,100]) y_train = x.prep_y_train(df['Labels'],7) shape=x_train[0].shape model = x.make_model(128,7,shape) batch_size=32 epochs=70 model.x.train_model(model,x_train,y_train,batch_size,epochs)
Examples
Create a emotion-classification model
`from dl_assistant.image_cnn import classification model = classification() model = model.create('TRAIN',7) model.predict([x_test[0]])`
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dl_assistant-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a7a2659cb1bdce9abb1d5b2d8407dd47ba621c50f3c4d9005af95f9700f4605 |
|
MD5 | 46b987fd77e109e3709eeead8a99c621 |
|
BLAKE2b-256 | 371407b905afe4883c253d8dc6cdbc657b7b7bc86b31656aa337495ea534c4d1 |