Celebration
This commit is contained in:
		
							parent
							
								
									8ff03abb53
								
							
						
					
					
						commit
						7d37fa8d91
					
				@ -41,7 +41,6 @@ void loop() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (distance < 70) UltraOK = true;  
 | 
					  if (distance < 70) UltraOK = true;  
 | 
				
			||||||
  else UltraOK = false;
 | 
					  else UltraOK = false;
 | 
				
			||||||
 | 
					 | 
				
			||||||
  if(digitalRead(ProxSensor) == LOW ) IROK = true;
 | 
					  if(digitalRead(ProxSensor) == LOW ) IROK = true;
 | 
				
			||||||
  else  IROK = false;
 | 
					  else  IROK = false;
 | 
				
			||||||
  char pi = 'N';
 | 
					  char pi = 'N';
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										5
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.py
									
									
									
									
									
								
							@ -47,9 +47,8 @@ def start( camera, face_cascade):
 | 
				
			|||||||
	j = 0
 | 
						j = 0
 | 
				
			||||||
	rawCapture = PiRGBArray(camera)
 | 
						rawCapture = PiRGBArray(camera)
 | 
				
			||||||
	face_recognizer = cv2.createLBPHFaceRecognizer()
 | 
						face_recognizer = cv2.createLBPHFaceRecognizer()
 | 
				
			||||||
	face_recognizer.load('faces/m')
 | 
						face_recognizer.load('faces/h')
 | 
				
			||||||
	names = loadNames()
 | 
						names = loadNames()
 | 
				
			||||||
	print('Known people '+ str(names))
 | 
					 | 
				
			||||||
	while 1:
 | 
						while 1:
 | 
				
			||||||
		try:
 | 
							try:
 | 
				
			||||||
			camera.capture(rawCapture, format="bgr")
 | 
								camera.capture(rawCapture, format="bgr")
 | 
				
			||||||
@ -88,7 +87,7 @@ def recognize(image,face_recognizer, names):
 | 
				
			|||||||
		label= face_recognizer.predict(img)
 | 
							label= face_recognizer.predict(img)
 | 
				
			||||||
	except:
 | 
						except:
 | 
				
			||||||
		print('[ Error ] Error in Recognize() function')
 | 
							print('[ Error ] Error in Recognize() function')
 | 
				
			||||||
	if label[1] > 100:
 | 
						if label[1] > 70:
 | 
				
			||||||
		return 'unknown'
 | 
							return 'unknown'
 | 
				
			||||||
	else:
 | 
						else:
 | 
				
			||||||
		print(str(label) + ' >>'+names[label[0]])
 | 
							print(str(label) + ' >>'+names[label[0]])
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user