Exemplo n.º 1
0
        if Mask_Detect.check_no_mask == True:
            count_no_mask += 1

        else:
            count_no_mask = 0

        cv2.putText(
            Mask_Detect.image,
            str(count_no_mask),
            (0, 50),
            cv2.FONT_HERSHEY_SIMPLEX,
            1,
            (0, 0, 255),
            1,
            cv2.LINE_AA,
        )

        Mask_Detect.showImage()

        if count_no_mask == 5:
            count_no_mask = 0
            # print("마스크 미착용자 발견")
            playsound("sound.wav")
            time.sleep(3)

        if cv2.waitKey(250) == ord("q"):
            break

cap.release()
cv2.destroyAllWindows()