Skip to content

Latest commit

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CVLearn

An easy-to-use package that helps with hand tracking, face detection, and more using OpenCV and Mediapipe.


Features

Core Features

  • 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

Installation

  • Use Python 3.6+
  • Open your terminal or command prompt and run:
pip install cvlearn

Install Dependencies (if needed)

pip install mediapipe opencv-python numpy

Hand Tracking

fromcvlearnimportHandTrackingModuleashandTrackerimportcv2cap=cv2.VideoCapture(0)
detector=handTracker.handDetector()
whileTrue:
ret, img=cap.read()
img=detector.findHands(img)
cv2.imshow("Result", img)
cv2.waitKey(1)

Result:

Hand Tracking


Face Detection

fromcvlearnimportFaceDetectionasfaceDetectorimportcv2cap=cv2.VideoCapture(0)
detector=faceDetector.FaceDetector()
whileTrue:
ret, img=cap.read()
img=detector.findFaces(img)
cv2.imshow("Result", img)
cv2.waitKey(1)

Result:

Face Detection

Side View:

Face Side View


Face Mesh

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:

Face Mesh


Finger Counting

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:

Finger Counter


Two Hands Finger Counting

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:

Two Hands Counter


Pose Detection

importcv2importcvlearnfromcvlearnimportPoseDetector, Utils

Gesture Recognition

importcv2fromcvlearnimportGestureRecognizercap=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()

About

This is an easy to use package which helps to do hand tracking, face detection, etc. with use of opencv module.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages