diff --git a/Facial_Recognition_Inference.py b/Facial_Recognition_Inference.py index f83c2f164..88a12fea1 100644 --- a/Facial_Recognition_Inference.py +++ b/Facial_Recognition_Inference.py @@ -3,7 +3,6 @@ import dlib import cv2 import numpy as np import DBHelper -import time import Upload_Thief @@ -34,11 +33,10 @@ def inference(): cond = False thief = False - thief_time = 0 label = 'unknown' + start = time.time() while DBHelper.get_power() == "on": - t = time.time() success, im = cam.read() if not success: @@ -100,12 +98,12 @@ def inference(): if cond: DBHelper.set_motor("on") DBHelper.set_alarm("off") - thief_time = 0 + start = time.time() elif not cond: DBHelper.set_motor("off") DBHelper.set_alarm("on") - thief_time += 1 - if thief_time == 10: + end = time.time() + if end - start >= 30: thief = True DBHelper.set_power("off") diff --git a/Facial_images/face_rec/train/User_1/1.jpg b/Facial_images/face_rec/train/User_1/1.jpg index e69de29bb..b83310775 100644 Binary files a/Facial_images/face_rec/train/User_1/1.jpg and b/Facial_images/face_rec/train/User_1/1.jpg differ diff --git a/__pycache__/Facial_Recognition_Inference.cpython-36.pyc b/__pycache__/Facial_Recognition_Inference.cpython-36.pyc index 96f706063..5afd27ce4 100644 Binary files a/__pycache__/Facial_Recognition_Inference.cpython-36.pyc and b/__pycache__/Facial_Recognition_Inference.cpython-36.pyc differ