O'Reilly logo

Deep Learning By Example by Ahmed Menshawy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required