Beispiel #1
0
        # Cal Frame
        curTime = time.time()
        sec = curTime - prevTime
        prevTime = curTime
        fps = 1 / (sec)

        print(fps)
        Mask_Detect = Detect(image)

        # Detect Face
        Mask_Detect.detectFace()

        if len(Mask_Detect.face_lst) != 0:

            # Detect Mask & NOSE & MASK IN FACE
            Mask_Detect.detectMaskNose()

            # 조건에 맞게 결과 도출
            for face_info in Mask_Detect.face_lst:
                x1, y1, x2, y2 = face_info["roi_face"]
                mask_status = face_info["with_mask"]
                nose_status = face_info["with_nose"]
                color = (0, 0, 0)
                label = ""

                # 마스크 탐지 and 코 미 탐지
                if mask_status == True and nose_status == False:
                    color = (0, 255, 0)
                    label = "With Mask"

                # 마스크 탐지 & 코 탐지 => 반 만 착용