Skip to content

Commit e5fd139

Browse files
committed
Make haarcascade face dection optional
1 parent 376d2c0 commit e5fd139

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

software/face.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, config, comms):
1919
self.extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE)
2020

2121
def detect(self, img, global_variance):
22-
if not self.config.get('TrackFace'):
22+
if not self.config.get('TrackFace') and not self.config.get('TensorFlow'):
2323
self.face_object = [0, 0, img.width(), img.height()]
2424
self.has_face = False
2525
return
@@ -42,6 +42,9 @@ def detect(self, img, global_variance):
4242
self.has_face = True
4343
return
4444

45+
if not self.config.get('TrackFace'):
46+
return
47+
4548
self.face_angle = 0
4649
face_objects = img.find_features(self.face_cascade, threshold=self.config.get('FaceThreshold'), scale_factor=self.config.get('FaceScaleFactor'))
4750

software/rem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def detect(self, variance, global_variance):
1919
self.eye_movements = self.eye_movements - 1
2020
self.last_eye_movement = now - 1000 * 58
2121

22-
if self.config.get('TrackFace') and not self.face.has_face:
22+
if (self.config.get('TrackFace') or self.config.get('TensorFlow')) and not self.face.has_face:
2323
return self.eye_movements
2424

2525
if variance >= self.config.get('TriggerThreshold'):

0 commit comments

Comments
 (0)