fix python code that can not run alone

This commit is contained in:
chikangxi 2021-03-19 18:41:09 +08:00 committed by GitHub
parent a92cff7a60
commit fc2f7b3b8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,9 @@ Supported configuration options:
```python
import cv2
import mediapipe as mp
mp_face_detction = mp.solutions.face_detection
mp_face_detection = mp.solutions.face_detection
mp_drawing = mp.solutions.drawing_utils
file_list = []
# For static images:
with mp_face_detection.FaceDetection(
@ -124,6 +126,7 @@ with mp_face_detection.FaceDetection(
for detection in results.detections:
mp_drawing.draw_detection(image, detection)
cv2.imshow('MediaPipe Face Detection', image)
#Press ESC to quit.
if cv2.waitKey(5) & 0xFF == 27:
break
cap.release()