print("Detection of the face took {}".format(time.time() - start)) start = time.time() lbpFaceFeature = mlbp.computeFeaturePatchWise( cv2.cvtColor(alignedFaces[0], cv2.COLOR_RGB2GRAY)) print("Computing the mlbp feature of a face took {}".format(time.time() - start)) start = time.time() lbpFeature = mlbp.computeFeaturePatchWise( cv2.cvtColor(faceImg, cv2.COLOR_RGB2GRAY)) print("Computing the mlbp feature of the entire frame took {}".format( time.time() - start)) dsift = features.DSIFT() start = time.time() gray = cv2.cvtColor(alignedFaces[0], cv2.COLOR_RGB2GRAY) gray = gray.astype("float32") kp, dsiftFaceFeature = dsift.compute(gray, 8, 16) dsiftFaceFeature = np.transpose(dsiftFaceFeature) print("Computing the dsift feature of the face took {}".format(time.time() - start)) start = time.time() kpFull, dsiftFeature = dsift.compute(faceImg, 8, 8) print("Computing the dsift feature of the full image took {}".format( time.time() - start))
def __init__(self, lbp, path_to_classifier): self._lbp = lbp self._sift = features.DSIFT() self.clf = joblib.load(path_to_classifier)