1e619d91956c813d2328a5460da0a273fe135905,hook/zmes_hook_helpers/face.py,Face,detect,#Face#Any#,123

Before Change


        matched_face_names = []
        matched_face_rects = []

        for idx,face_encoding in enumerate(face_encodings):
            preds = self.svm_model.predict_proba([face_encoding])[0]

            print (preds, self.svm_model.classes_)
            best_pred_ndx = np.argmax(preds)
            best_pred = preds[best_pred_ndx]
            loc = face_locations[idx]

            if best_pred >= g.config["face_recog_min_confidence"]:
                 matched_face_names.append(self.svm_model.classes_[best_pred_ndx])
                 g.logger.debug("face:{} matched with confidence: {}".format(self.svm_model.classes_[best_pred_ndx], best_pred))
            else:     
                g.logger.debug ("face matched:{} but confidence of:{} is less than {}, marking it unknown".format(self.svm_model.classes_[best_pred_ndx], best_pred, g.config["face_recog_min_confidence"]))
                matched_face_names.append(g.config["unknown_face_name"])
                best_pred = 1 // if unknown, don"t carry over pred prob
            matched_face_rects.append((loc[3], loc[0], loc[1], loc[2]))
            conf.append(best_pred)
        return matched_face_rects, matched_face_names, conf

After Change



        // Use the KNN model to find the best matches for the test face
        closest_distances = self.knn.kneighbors(face_encodings, n_neighbors=1)
        are_matches = [closest_distances[0][i][0] <= g.config["face_recog_dist_threshold"] for i in range(len(face_locations))]

        matched_face_names = []
        matched_face_rects = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pliablepixels/zmeventnotification
Commit Name: 1e619d91956c813d2328a5460da0a273fe135905
Time: 2019-11-15
Author: pliablepixels@gmail.com
File Name: hook/zmes_hook_helpers/face.py
Class Name: Face
Method Name: detect


Project Name: pliablepixels/zmeventnotification
Commit Name: 1e619d91956c813d2328a5460da0a273fe135905
Time: 2019-11-15
Author: pliablepixels@gmail.com
File Name: hook/zmes_hook_helpers/face.py
Class Name: Face
Method Name: detect


Project Name: fgnt/pb_bss
Commit Name: b27721ab556fabb2a7e7fcb223ec1f9f6eb4418d
Time: 2015-10-07
Author: cbj@mail.uni-paderborn.de
File Name: nt/speech_enhancement/beamformer.py
Class Name:
Method Name: get_pca_vector


Project Name: dnouri/skorch
Commit Name: ef1838cd5c59ae07e5179138469b3c6dab2e5f81
Time: 2017-11-16
Author: marian.tietz@ottogroup.com
File Name: examples/word_language_model/net.py
Class Name: Net
Method Name: score