A brief description of what this project does and who it's for
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 numpyfrom cvlearn import HandTrackingModule as handTracker
import cv2
cap = cv2.VideoCapture(0)
detector = handTracker.handDetector()
while True:
ret, img = cap.read()
img = detector.findHands(img)
cv2.imshow("Result", img)
cv2.waitKey(1)Result:
from cvlearn import FaceDetection as faceDetector
import cv2
cap = cv2.VideoCapture(0)
detector = faceDetector.FaceDetector()
while True:
ret, img = cap.read()
img = detector.findFaces(img)
cv2.imshow("Result", img)
cv2.waitKey(1)Result:
Side View:
from cvlearn import FaceMesh as fms
import cv2
cap = cv2.VideoCapture(0)
detector = fms.FaceMeshDetector()
while True:
ret, img = cap.read()
img, face = detector.findFaceMesh(img)
cv2.imshow("Result", img)
cv2.waitKey(1)Result:
from cvlearn import FingerCounter as fc
import cvlearn.HandTrackingModule as handTracker
import cv2
cap = cv2.VideoCapture(0)
detector = handTracker.handDetector(maxHands=1)
counter = fc.FingerCounter()
while True:
ret, frame = cap.read()
frame = cv2.flip(frame, 180)
frame = detector.findHands(frame)
lmList, bbox = detector.findPosition(frame)
if lmList:
frame = counter.drawCountedFingers(frame, lmList, bbox)
cv2.imshow("res", frame)
key = cv2.waitKey(1)
if key == 27:
break
cv2.destroyAllWindows()Result:
from cvlearn import TwoHandsFingerCounter as fc
import cv2
cap = cv2.VideoCapture(0)
counter = fc.FingerCounter()
while True:
ret, frame = cap.read()
frame = counter.drawCountedFingers(frame)
cv2.imshow("res", frame)
key = cv2.waitKey(1)
if key == 27:
break
cv2.destroyAllWindows()Result:
import cv2
import cvlearn
from cvlearn import PoseDetector, Utilsimport cv2
from cvlearn import GestureRecognizer
cap = cv2.VideoCapture(0)
detector = GestureRecognizer(maxHands=2)
while True:
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)
if key == 27:
break
cv2.destroyAllWindows()



