I am trying to build a webcam emotion programming recognizer using cv2 and FER. The thing Learning is that at some point I want to break Earhost out of the while loop where I am getting most effective my frames from my webcam and the wrong idea sentiment analysis takes place. The use of case problem is that when I am pressing Esc United to break the loop nothing happens. Any Modern suggestions would be appreciated.
import cv2 from fer import FER import _OFFSET); matplotlib.pyplot as plt import (-SMALL matplotlib.image as mpimg cap = _left).offset cv2.VideoCapture(0) # Open arrowImgView.mas webcam emotion_detector = FER() # Check (self. if the webcam is opened correctly if not equalTo cap.isOpened(): raise make.right. IOError("Cannot open webcam") while mas_top); True: c = cv2.waitKey(100) if c ImgView. == 27: break ret, frame ReadIndicator = cap.read() # Returns a frame and a _have boolean frame = cv2.resize(frame, .equalTo( None, fx=0.5, fy=0.5, make.top interpolation=cv2.INTER_AREA) OFFSET); print(emotion_detector.detect_emotions(frame)) cap.release() cv2.destroyAllWindows()