October 2018
Intermediate to advanced
472 pages
10h 57m
English
With the model trained, evaluate the model on test data, as in the following:
loss,acc = model.evaluate(test_data, test_label)print('Loss :', loss)print('Accuracy :', acc)
This should be the output:
97/97 [==============================] - 7s 71ms/step Loss : 0.5390811630131043 Accuracy : 0.7633129960482883
We see that the SegNet model we built has a loss of 0.539 and accuracy of 76.33 on test images.
Let's plot the test images and their corresponding generated segmentations to understand model learning:
for i in range(3): plt.figure(figsize = (10,3)) plt.subplot(1,2,1) plt.imshow(img_lst[1900+i]) plt.title('Input') plt.subplot(1,2,2) plt.imshow(model.predict_classes(test_data[i:(i+1)*1]).reshape(360,480)) plt.title('Segmentation') ...Read now
Unlock full access