4e8a831d2a4f4ce8d80c25d43c614255237da71a,examples/attention_maps.py,,generate_cam,#,30

Before Change


    for path in ["../resources/ouzel.jpg", "../resources/ouzel_1.jpg"]:
        seed_img = utils.load_img(path, target_size=(224, 224))
        // 20 is the imagenet category for "ouzel"
        heatmap = visualize_cam(model, layer_idx, [20], seed_img)
        cv2.imshow("Importance map", heatmap)
        cv2.waitKey(0)

After Change



    for path in ["https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Tigerwater_edit2.jpg/170px-Tigerwater_edit2.jpg"]:
        seed_img = utils.load_img(path, target_size=(224, 224))
        pred_class = np.argmax(model.predict(np.array([img_to_array(seed_img)])))
        heatmap = visualize_cam(model, layer_idx, [pred_class], seed_img)
        cv2.imshow("Attention - {}".format(utils.get_imagenet_label(pred_class)), heatmap)
        cv2.waitKey(0)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: raghakot/keras-vis
Commit Name: 4e8a831d2a4f4ce8d80c25d43c614255237da71a
Time: 2016-12-24
Author: ragha@outlook.com
File Name: examples/attention_maps.py
Class Name:
Method Name: generate_cam


Project Name: 13o-bbr-bbq/machine_learning_security
Commit Name: 0bf81caddbc64e81b8b2989e8dbb5a0ec49e489a
Time: 2020-01-08
Author: takaesu235@gmail.com
File Name: Security_and_MachineLearning/src/defensive_chap7/face_auth.py
Class Name:
Method Name:


Project Name: raghakot/keras-vis
Commit Name: 4e8a831d2a4f4ce8d80c25d43c614255237da71a
Time: 2016-12-24
Author: ragha@outlook.com
File Name: examples/attention_maps.py
Class Name:
Method Name: generate_saliceny_map