-
-
Save karan19100/1b7968970e59bbfc1cb56590563e411f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Face detected but Lips not detected which means person is wearing mask | |
if(len(mouth_rects) == 0): | |
cv2.putText(img, weared_mask, org, font, font_scale, weared_mask_font_color, thickness, cv2.LINE_AA) | |
else: | |
for (mx, my, mw, mh) in mouth_rects: | |
if(y < my < y + h): | |
# Face and Lips are detected but lips coordinates are within face cordinates which means lips prediction is true and | |
# person is not waring mask | |
cv2.putText(img, not_weared_mask, org, font, font_scale, not_weared_mask_font_color, thickness, cv2.LINE_AA) | |
cv2.rectangle(img, (mx, my), (mx + mh, my + mw), (0, 0, 255), 3) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment