DNN-based Face Detection And Recognition | OpenCV Tutorials
cv::FaceDetectorYN Class Reference | OpenCV Online Documentation
2023/06/27 OpenCV DNN based Face Detection API/Model will update to YuNet v2 from OpenCV 4.8.0. If you want more detail, Please refer to Pull Request.
45行目のLINE_AAの指定がcv2ではなく、cvとなっています。
x cv2.rectangle(image, box, color, thickness, cv.LINE_AA)
o cv2.rectangle(image, box, color, thickness, cv2.LINE_AA)