An easy-to-use package that helps with hand tracking, face detection, and more using OpenCV and Mediapipe.
- Hand Tracking - Real-time hand pose detection and tracking
- Face Detection - Multi-face detection and bounding boxes
- Face Mesh - Detailed facial landmarks
- Finger Counting - Single and dual-hand finger detection
- Pose Detection - Full body pose estimation
- Gesture Recognition - Gesture recognition with combo detection and velocity-based gestures
- Use Python 3.6+
- Open your terminal or command prompt and run:
pip install cvlearnpip install mediapipe opencv-python numpyfromcvlearnimportHandTrackingModuleashandTrackerimportcv2cap=cv2.VideoCapture(0)
detector=handTracker.handDetector()
whileTrue:
ret, img=cap.read()
img=detector.findHands(img)
cv2.imshow("Result", img)
cv2.waitKey(1)Result:
fromcvlearnimportFaceDetectionasfaceDetectorimportcv2cap=cv2.VideoCapture(0)
detector=faceDetector.FaceDetector()
whileTrue:
ret, img=cap.read()
img=detector.findFaces(img)
cv2.imshow("Result", img)
cv2.waitKey(1)Result:
Side View:
fromcvlearnimportFaceMeshasfmsimportcv2cap=cv2.VideoCapture(0)
detector=fms.FaceMeshDetector()
whileTrue:
ret, img=cap.read()
img, face=detector.findFaceMesh(img)
cv2.imshow("Result", img)
cv2.waitKey(1)Result:
fromcvlearnimportFingerCounterasfcimportcvlearn.HandTrackingModuleashandTrackerimportcv2cap=cv2.VideoCapture(0)
detector=handTracker.handDetector(maxHands=1)
counter=fc.FingerCounter()
whileTrue:
ret, frame=cap.read()
frame=cv2.flip(frame, 180)
frame=detector.findHands(frame)
lmList, bbox=detector.findPosition(frame)
iflmList:
frame=counter.drawCountedFingers(frame, lmList, bbox)
cv2.imshow("res", frame)
key=cv2.waitKey(1)
ifkey==27:
breakcv2.destroyAllWindows()Result:
fromcvlearnimportTwoHandsFingerCounterasfcimportcv2cap=cv2.VideoCapture(0)
counter=fc.FingerCounter()
whileTrue:
ret, frame=cap.read()
frame=counter.drawCountedFingers(frame)
cv2.imshow("res", frame)
key=cv2.waitKey(1)
ifkey==27:
breakcv2.destroyAllWindows()Result:
importcv2importcvlearnfromcvlearnimportPoseDetector, Utilsimportcv2fromcvlearnimportGestureRecognizercap=cv2.VideoCapture(0)
detector=GestureRecognizer(maxHands=2)
whileTrue:
ret, frame=cap.read()
frame=detector.findHands(frame)
gesture, confidence=detector.recognizeGesture(frame)
frame=detector.drawGestureInfo(frame, gesture, confidence)
cv2.imshow("Result", frame)
key=cv2.waitKey(1)
ifkey==27:
breakcv2.destroyAllWindows()



