From b1199bbef0fd3d5e784755a36ecdfbe9a4ab4939 Mon Sep 17 00:00:00 2001 From: Ragha Date: Wed, 5 Jul 2017 21:50:08 -0700 Subject: [PATCH] Delete accidental commit --- applications/audio/visualize.py | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 applications/audio/visualize.py diff --git a/applications/audio/visualize.py b/applications/audio/visualize.py deleted file mode 100644 index 6e2e077..0000000 --- a/applications/audio/visualize.py +++ /dev/null @@ -1,30 +0,0 @@ -import numpy as np -from keras.models import load_model -from vis.visualization import visualize_cam, visualize_saliency -from vis.utils import utils - -from matplotlib import pyplot as plt -from keras import backend as K - -K.set_image_data_format('channels_first') -seed_input = np.load('input.npy') -model = load_model('2017_06_22_00_36_17_model.h5') - -pred_class = 4 -penultimate_idx = utils.find_layer_idx(model, 'bidirectional_2') -heatmap_weak = visualize_saliency(model, utils.find_layer_idx(model, 'weak_out'), - pred_class, seed_input, backprop_modifier='deconv') - -heatmap_strong = visualize_saliency(model, utils.find_layer_idx(model, 'strong_out'), - pred_class, seed_input, backprop_modifier='deconv') - -plt.figure() -plt.subplot(311) -plt.imshow(np.transpose(heatmap_strong, (1, 0, 2)), aspect='auto', origin='lower') - -plt.subplot(312) -plt.imshow(np.transpose(heatmap_weak, (1, 0, 2)), aspect='auto', origin='lower') - -plt.subplot(313) -plt.imshow(seed_input[0].T, aspect='auto', origin='lower') -plt.show()