October 2018
Intermediate to advanced
472 pages
10h 57m
English
This module contains the test() function that will be called in the train_dqn.py script so that it can test the performance of the trained model, as shown:
"""This module contains the function to test the vgg16 model performance."""from plotting import *import osimport pandas as pdimport numpy as npimport cv2 as cvimport matplotlib.pyplot as pltdef test(model, nrows=200, batch_size=128): """Test trained vgg16.""" # load the train data test = pd.read_csv('FLIC-full/test/test_joints.csv', header=None, nrows=nrows) test_img_ids = test.iloc[:, 0].values # load validation images test_images = np.array( [cv.imread('FLIC-full/test/{}'.format(x)) for x in test_img_ids]) # convert validation images to dtype float test_images = test_images.astype(float) ...Read now
Unlock full access