0bf81caddbc64e81b8b2989e8dbb5a0ec49e489a,Security_and_MachineLearning/src/defensive_chap7/face_auth.py,,,#,11

Before Change


        cv2.imwrite(file_name, resized_face_image)

        // Transform image to 4 dimension tensor.
        img = image.load_img(file_name, target_size=(128, 128))
        array_img = image.img_to_array(img)
        array_img = np.expand_dims(array_img, axis=0)
        array_img = array_img / 255.0

        // Prediction.
        pred = model.predict(array_img)[0]
        top_indices = pred.argsort()[-1:][::-1]
        results = [(classes[i], pred[i]) for i in top_indices]

        // Final judgement.
        judge = "Reject"

After Change


        cv2.imwrite(file_name, resized_face_image)

        // Transform image to 4 dimension tensor.
        img = image.img_to_array(image.load_img(file_name, target_size=(img_width, img_height)))
        x = image.img_to_array(img)
        x = np.expand_dims(x, axis=0)
        x = x / 255.0

        // Prediction.
        preds = model.predict(x)[0]
        predict_idx = np.argmax(preds)

        // Final judgement.
        judge = "Reject"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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: IBM/adversarial-robustness-toolbox
Commit Name: fb4fbbb89295814079df2dace8340383dafe70a6
Time: 2017-07-24
Author: valentina.zantedeschi@ibm.com
File Name: generate_from_imagenet.py
Class Name:
Method Name:


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 4d586ecdb5f85be5d830b5b4982ec4b685d175d8
Time: 2017-07-24
Author: valentina.zantedeschi@ibm.com
File Name: generate_from_imagenet.py
Class Name:
Method Name: