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

Before Change



        // 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"
        prob = preds[predict_idx] * 100
        if prob > THRESHOLD:
            judge = "Unlock"
        msg = "{} ({:.1f}%). res="{}"".format(classes[predict_idx], prob, judge)
        print(msg)

        // Draw frame to face.
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: WheatonCS/Lexos
Commit Name: 70fcd3094baba3139afcda727683d58c2928261f
Time: 2017-08-04
Author: liu_xinru@wheatoncollege.edu
File Name: lexos/processors/analyze/similarity.py
Class Name:
Method Name: similarity_maker


Project Name: WheatonCS/Lexos
Commit Name: ce5da48b8586d7cfdb392b8cad1988e6bfdd17d5
Time: 2017-08-03
Author: liu_xinru@wheatoncollege.edu
File Name: lexos/processors/analyze/similarity.py
Class Name:
Method Name: similarity_maker