rotation fix
This commit is contained in:
		
							parent
							
								
									f715138204
								
							
						
					
					
						commit
						28961839d6
					
				
							
								
								
									
										8
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								main.py
									
									
									
									
									
								
							@ -24,7 +24,7 @@ startScreen = cv2.imread("noFace.png")
 | 
				
			|||||||
if cam.isOpened():
 | 
					if cam.isOpened():
 | 
				
			||||||
    while True:
 | 
					    while True:
 | 
				
			||||||
        ret, img = cam.read()
 | 
					        ret, img = cam.read()
 | 
				
			||||||
        img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
 | 
					        # img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
 | 
				
			||||||
        if cameraMode and ret:
 | 
					        if cameraMode and ret:
 | 
				
			||||||
            prev = time.time() 
 | 
					            prev = time.time() 
 | 
				
			||||||
            while TIMER > 0:
 | 
					            while TIMER > 0:
 | 
				
			||||||
@ -50,13 +50,13 @@ if cam.isOpened():
 | 
				
			|||||||
                    break
 | 
					                    break
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                ret, img = cam.read()
 | 
					                ret, img = cam.read()
 | 
				
			||||||
                img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
 | 
					                # img = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
 | 
				
			||||||
                predictions = DeepFace.analyze(img,actions=['emotion'])
 | 
					                predictions = DeepFace.analyze(img,actions=['emotion'])
 | 
				
			||||||
                fearPoint = predictions[0]["emotion"]["fear"]
 | 
					                fearPoint = predictions[0]["emotion"]["fear"]
 | 
				
			||||||
                print("FEAR:" + str(round(fearPoint,2)))
 | 
					                print("FEAR:" + str(round(fearPoint,2)))
 | 
				
			||||||
                if fearPoint>0:
 | 
					                if fearPoint>0:
 | 
				
			||||||
                    
 | 
					                    rotoImg = cv2.rotate(img, cv2.ROTATE_90_CLOCKWISE)
 | 
				
			||||||
                    cv2.imwrite('scared.jpg', img) 
 | 
					                    cv2.imwrite('scared.jpg', rotoImg) 
 | 
				
			||||||
                    basewidth = 384
 | 
					                    basewidth = 384
 | 
				
			||||||
                    imgCrop = Image.open('scared.jpg')
 | 
					                    imgCrop = Image.open('scared.jpg')
 | 
				
			||||||
                    wpercent = (basewidth/float(imgCrop.size[0]))
 | 
					                    wpercent = (basewidth/float(imgCrop.size[0]))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user