Skip to content

Instantly share code, notes, and snippets.

@karan19100
Created Dec 18, 2020
Embed
What would you like to do?
# 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