December 2018
Intermediate to advanced
318 pages
8h 28m
English
This section explains about training the neural network model to identify each character.
We start by importing the desired packages for the purpose. The label binarizor class is used to convert a vector into one-hot encoding in one step. The model_selection import, train_test_split, is used to split into test and train sets. Several other keras packages are used for training the model:
import cv2import pickleimport os.pathimport numpy as npfrom imutils import pathsfrom sklearn.preprocessing import LabelBinarizerfrom sklearn.model_selection import train_test_splitfrom keras.models import Sequentialfrom keras.layers.convolutional import Conv2D, MaxPooling2Dfrom keras.layers.core import Flatten, Densefrom helpers import resize_to_fit ...
Read now
Unlock full access