def nextFrameSlot(self): ret, frame = self.cap.read() if a == 1: frame = f.find_face(frame) elif a == 2: image = e.format_image(frame) frame = e.emotions(image, frame) elif a == 3: image = e.format_image(frame) frame = e.emotions(image, frame) frame = f.find_face(frame) elif a == 4: dots.angry(frame) dots.happydots(frame) frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) img = QImage(frame, frame.shape[1], frame.shape[0], QImage.Format_RGB888) pix = QPixmap.fromImage(img) self.video_frame.setPixmap(pix)
def nextFrameSlot(self): ret, frame = self.cap.read() if self.flow(1): frame = f.find_face(frame) elif self.flow(2): image = e.format_image(frame) frame = e.emotions(image, frame) frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA) img = QImage(frame, frame.shape[1], frame.shape[0], QImage.Format_RGB888) pix = QPixmap.fromImage(img) self.video_frame.setPixmap(pix)