# -*- coding: UTF-8 -*-importcv2frommask_detectimportMaskPred# The MaskPred class implements the function of face mask detection,# including face detection and face mask classificationmp=MaskPred(True,True,0)# Turn on the first camera, 0 means device IDcap=cv2.VideoCapture(0)cv2.namedWindow('Mask Detect')whileTrue:ret,frame=cap.read()ifcv2.waitKey(10)==ord("q"):breakresult=mp.run(frame)cv2.imshow("image",result['img'])