Пример #1
0
                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"

                # 마스크 탐지 & 코 탐지 => 반 만 착용
                if mask_status == True and nose_status == True:
                    color = (0, 182, 255)
                    label = "Half Mask"
                    Mask_Detect.check_no_mask = True

                # 마스크 미탐지 => 마스크 미착용
                elif mask_status == False:
                    color = (0, 0, 255)
                    label = "No Mask"
                    Mask_Detect.check_no_mask = True

                Mask_Detect.writeLabel([x1, y1, x2, y2], color, label)

        if Mask_Detect.check_no_mask == True:
            count_no_mask += 1

        else:
            count_no_mask = 0