diff --git a/eyes.py b/eyes.py index 5450a14..b9ef216 100644 --- a/eyes.py +++ b/eyes.py @@ -5,8 +5,6 @@ import cv2 import onnxruntime import time - - def clamp_to_im(pt, w, h): #8 times per frame, but that only accounts for 0.005ms x=max(pt[0],0) y=max(pt[1],0) @@ -33,14 +31,10 @@ def rotate_image(image, a, center): #twice per frame, 0.2ms - 0.25ms each, impro image = cv2.warpAffine(image, M, (w, h), flags = cv2.INTER_CUBIC) return image - - - class Eye(): def __init__(self,index): self.eye_tracking_frames = 0 - self.index = index self.state = [1.,0.,0.,0.] self.image = None @@ -67,7 +61,9 @@ class Eye(): im = im[int(y1):int(y2), int(x1):int(x2)] if np.prod(im.shape) < 1: - return None, None, None, None, None, None + self.image = None + self.info = None + if self.index == 1: im = cv2.flip(im, 1) scale = [(x2 - x1)/ 32., (y2 - y1)/ 32.] @@ -145,7 +141,6 @@ class Eye(): self.standardDeviation = math.sqrt(self.averageEyeConfidenceVariance) - class EyeTracker(): def __init__(self): self.leftEye = Eye(1) diff --git a/tracker.py b/tracker.py index 0cbfa3d..02699ff 100644 --- a/tracker.py +++ b/tracker.py @@ -121,7 +121,6 @@ class Tracker(): eye_state = self.EyeTracker.get_eye_state(frame, lms) - self.face_info[0].update((conf, (lms, eye_state)), np.array(lms)[:, 0:2].mean(0)) duration_model = 1000 * (time.perf_counter() - start_model)