Skip to content

Commit 54209b0

Browse files
committed
Removed some bugs
1 parent aa47322 commit 54209b0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

pipeline.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@
5050
camera= picamera.PiCamera()
5151
camera.resolution = (1000,1000)
5252

53-
print ("Everything is loaded correctly")
53+
print ("Everything was loaded as intended")
54+
5455
while True:
5556
input_state = GPIO.input(21)
5657
if input_state == False:
57-
#time_ = time.time()
58-
print ("Starting to capture. Get ready")
5958
GPIO.output(12, 1)
6059
date = time.strftime("%Y-%m-%d_%H:%M:%S")
6160

@@ -82,14 +81,14 @@
8281
#flags = cv2.cv.CV_HAAR_SCALE_IMAGE
8382
flags = cv2.CASCADE_SCALE_IMAGE
8483
)
85-
if faces:
84+
if faces == ():
85+
print ("No faces found")
86+
continue
87+
else:
8688
for (x, y, w, h) in faces:
8789
boundary_factor = 0.1
8890
# Make new image for detection
8991
recog = image[y-int(boundary_factor*h):y+int(h*(1+boundary_factor)), x-int(boundary_factor*w):x+int(w*(1+boundary_factor))]
90-
91-
else:
92-
print ("No face detected")
9392

9493
### Analysing in CNN ###
9594
recog = cv2.resize(recog, (150,150))
@@ -99,7 +98,5 @@
9998
GPIO.output(12, 0)
10099
GPIO.output(16, 1)
101100
print prediction
102-
#print ("time needed: %.4f" %(time.time()-time_))
103101
time.sleep(5)
104102
GPIO.output(16, 0)
105-
recog = []

0 commit comments

Comments
 (0)