y, w, h) in faces: cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2) idnum, confidence...= recognizer.predict(gray[y:y + h, x:x + w]) if confidence confidence = "{0}%".format(round(100 - confidence)) else: idnum = "unknown..." confidence = "{0}%".format(round(100 - confidence)) cv2.putText(img, str(idnum),...(x + 5, y - 5), font, 1, (0, 0, 255), 1) cv2.putText(img, str(confidence), (x + 5, y + h - 5),