def plot_cam_map(img_path, img_size, batch_size, label_plot):
    'Plot class activation map.\n\n\t'
    gap_spacial_size = 14
    model = cam_model()
    im_ori = np.asarray(load_img(img_path, target_size=(img_size, img_size)))
    test_data = preprocess_image(img_path, img_size, expand_dims=True)
    im_cam = get_cam_img(model, test_data, label_plot, CAM_CONV_LAYER, ratio=(img_size / gap_spacial_size))
    if (im_cam.shape != im_ori[:, :, 0].shape):
        im_cam = cv2.resize(im_cam, (img_size, img_size), cv2.INTER_LINEAR)
    prediction_labels = model.predict(test_data.astype('float32'), batch_size=batch_size, verbose=1)
    print('Info: Predictions:\n{}'.format(prediction_labels))
    plt.imshow(im_ori)
    plt.imshow(im_cam, cmap='jet', alpha=0.5, interpolation='bilinear')
    plt.show()
Plot class activation map.
def plot_cam_map(img_path, img_size, batch_size, label_plot):
    '\n\n\t'
    gap_spacial_size = 14
    model = cam_model()
    im_ori = np.asarray(load_img(img_path, target_size=(img_size, img_size)))
    test_data = preprocess_image(img_path, img_size, expand_dims=True)
    im_cam = get_cam_img(model, test_data, label_plot, CAM_CONV_LAYER, ratio=(img_size / gap_spacial_size))
    if (im_cam.shape != im_ori[:, :, 0].shape):
        im_cam = cv2.resize(im_cam, (img_size, img_size), cv2.INTER_LINEAR)
    prediction_labels = model.predict(test_data.astype('float32'), batch_size=batch_size, verbose=1)
    print('Info: Predictions:\n{}'.format(prediction_labels))
    plt.imshow(im_ori)
    plt.imshow(im_cam, cmap='jet', alpha=0.5, interpolation='bilinear')
    plt.show()