Code for fish recognition

After explaining the main building blocks for our fish recognition example, we are ready to see all the code pieces connected together and see how we managed to build such a complex system with just a few lines of code:

#Loading the required libraries along with the deep learning platform Keras with TensorFlow as backendimport numpy as npnp.random.seed(2017)import osimport globimport cv2import pandas as pdimport timeimport warningsfrom sklearn.cross_validation import KFoldfrom keras.models import Sequentialfrom keras.layers.core import Dense, Dropout, Flattenfrom keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2Dfrom keras.optimizers import SGDfrom keras.callbacks import EarlyStoppingfrom ...

Get Deep Learning By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.