O'Reilly logo

Python Deep Learning Cookbook by Indra den Bakker

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

How to do it...

  1. Let's import the libraries first:
import numpy as npimport pandas as pdimport globimport cv2import matplotlib.pyplot as pltfrom sklearn.preprocessing import LabelBinarizerfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import accuracy_scorefrom keras.models import Sequential, load_modelfrom keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D, Lambda, Cropping2Dfrom keras.utils import np_utilsfrom keras import backend as Kfrom keras.callbacks import EarlyStoppingfrom keras import optimizers
  1. Load the dataset and plot the first rows of the CSV:
DATA_DIR = 'Data/object-detection-crowdai/'labels = pd.read_csv(DATA_DIR + 'labels.csv', usecols=[0,1,2,3,4,5])# We will only localize ...

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