Download use.py from qvx-o/QeyPoint-Face: direct link, hf CLI and curl.
- Browser
- Download file 830 Bytes
-
https://huggingface.co/qvx-o/QeyPoint-Face/resolve/main/use.py
- Command line
-
hf download hf://qvx-o/QeyPoint-Face/use.py
-
curl -L -o use.py https://huggingface.co/qvx-o/QeyPoint-Face/resolve/main/use.py
830 Bytes
| import cv2 | |
| from QeyP import QeyPointDetector | |
| detector = QeyPointDetector() | |
| print("Starting stream demo. Press Q to quit.") | |
| for result in detector.stream_from_cam(camera_id=0, wait_seconds=0.01): | |
| if result is None: | |
| continue | |
| frame = result["frame"] | |
| landmarks = result["landmarks"] | |
| confidence = result["confidence"] | |
| face_box = result["face_box"] | |
| fx, fy, fw, fh = face_box | |
| cv2.rectangle(frame, (fx, fy), (fx + fw, fy + fh), (255, 180, 0), 2, lineType=cv2.LINE_AA) | |
| for (px, py), conf in zip(landmarks, confidence): | |
| if conf > 0.0: | |
| cv2.circle(frame, (int(px), int(py)), 3, (0, 255, 0), -1, lineType=cv2.LINE_AA) | |
| cv2.imshow("QeyPoints Demo", frame) | |
| if cv2.waitKey(1) & 0xFF == ord('q'): | |
| break | |
| cv2.destroyAllWindows() | |
| print("Demo ended.") | |