Fixed an error.

This commit is contained in:
Batuhan Berk Başoğlu 2021-02-01 19:56:51 -05:00
parent ab1a6c665e
commit df72b54643

View file

@ -33,8 +33,7 @@ def inference():
x1 = x2 = y1 = y2 = 0 x1 = x2 = y1 = y2 = 0
cond = False cond = False
t = 0 thief_time = 0
while DBHelper.get_power() == "on": while DBHelper.get_power() == "on":
t = time.time() t = time.time()
success, im = cam.read() success, im = cam.read()
@ -98,13 +97,14 @@ def inference():
if cond: if cond:
DBHelper.set_motor("on") DBHelper.set_motor("on")
DBHelper.set_alarm("off") DBHelper.set_alarm("off")
thief_time = 0
time.sleep(1) time.sleep(1)
elif not cond: elif not cond:
DBHelper.set_motor("off") DBHelper.set_motor("off")
DBHelper.set_alarm("on") DBHelper.set_alarm("on")
t += 1 thief_time += 1
time.sleep(1) time.sleep(1)
if t == 120: if thief_time == 120:
Upload_Thief.upload_thief_face() Upload_Thief.upload_thief_face()
DBHelper.set_power("off") DBHelper.set_power("off")