Advanced Computer Vision with Python - Full Course
Why Stack Overflow recommends it
Stack Overflow users link it when they are following its Mediapipe hand, pose and face tracking modules and hit errors, citing it as the tutorial they copied code from.
Recommended by 1 people across 1 different months, 2021 to 2022.
What it is
A 6h40m freeCodeCamp course by Murtaza Hassan on advanced computer vision with Python, using OpenCV and Mediapipe. It covers hand tracking, pose estimation, face detection and face mesh, then builds five projects such as gesture volume control, a finger counter, an AI personal trainer and a virtual painter.
What people said
Recommends Devang Patani · 2021-10 · Stack Overflow · on “TypeError: create_bool(): incompatible function arguments. The following argument types are supported:”
import PoseEstimationModule as pm Make sure you are giving these defaults in the above module if you are creating your module or else you can see the code of mediapipe.python.solutions.pose, class poseDetector(): def __init__(self, mode=False, modComplexity=1, smooth=True, eSegmentation=False, sSegmentation=True, detectionCon=0.5, trackCon=0.5): '''Code Here''' self.pose = self.mpPose.Pose(self.mode, self.modComplexity, self.smooth, self.eSegmentation, self.sSegmentation, self.detectionCon, self.trackCon) '''Rest CODE''' Then use this again, detector = pm.poseDetector() You can also watch this video [this video] . It gave me the same error, but I did the above changes in the module file and was a
Cites Aditya Deshpande · 2021-07 · Stack Overflow · on “findPose() missing 1 required positional argument: 'self'”
import cv2 import time import mediapipe as mp def main(): cap = cv2.VideoCapture(0) pTime = 0 # Previous time global img detector = poseDetector while True: success, img = cap.read() detector.findPose() cTime = time.time() print(cTime, pTime) fps = 1 / (cTime - pTime) pTime = cTime cv2.putText(img, str(int(fps)), (70, 50), cv2.FONT_HERSHEY_SCRIPT_COMPLEX, 3, (255, 0, 0), 3) cv2.imshow("Image", img) cv2.waitKey(1) class poseDetector(): def __init__(self, mode=True, complexity=1, smooth=True, detectionCon=0.5, trackCon=0.5): self.mode = mode self.complexity = complexity self.smooth = smooth self.detectionCon = detectionCon self.trackCon = trackCon self.mpDraw = mp.solutions.drawing_utils self.
Cites Павел К. · 2021-09 · Stack Overflow · on “TypeError: create_bool(): incompatible function arguments”
If you look at the Pose(SolutionBase) class of MediaPipe, you can see def __init__ : class Pose(SolutionBase): def __init__(self, static_image_mode=False, model_complexity=1, smooth_landmarks=True, enable_segmentation=False, smooth_segmentation=True, min_detection_confidence=0.5, min_tracking_confidence=0.5): You should have the same parameters in the class findPose() __init__ . Of course you can name them whatever you want, but the sequence and types must be the same. More information: [LINK] [this video] watch from 1:11
Cites FunkySplash48 · 2021-10 · Stack Overflow · on “Getting errors with mediapipe for making Hand Tracking Module in Python 3.7.9”
I am getting the following error whenever I try to run my code, I am following a tutorial for hand tracking, I followed the steps correctly but I still to have some sort of error. Link to Video: [this video] Traceback (most recent call last): File "C:/Users/aryan/Desktop/user/Study/Com_vis/Hand_T_M.py", line 56, in <module> main() File "C:/Users/aryan/Desktop/user/Study/Com_vis/Hand_T_M.py", line 41, in main detector = handDetector() File "C:/Users/aryan/Desktop/user/Study/Com_vis/Hand_T_M.py", line 12, in __init__ self.detectionCon, self.trackCon) File "C:\Users\aryan\Desktop\user\Study\Com_vis\venv\lib\site-packages\mediapipe\python\solutions\hands.py", line 127, in __init__ outputs=['multi_han
Cites Franklyn · 2021-10 · Stack Overflow · on “TypeError: findFaces() missing 1 required positional argument: 'vid'”
I have been watching this tutorial [this video] For the hand module it went fine but for the pose and face module I have been getting error at the same position I have gone through the code and I dont see where I have made a mistake. import cv2 as cv import mediapipe as mp import time class FaceDetector(): def __init__(self, minDetectionCon=0.5): self.minDetectionCon = minDetectionCon self.mpFD = mp.solutions.face_detection self.mpDraw = mp.solutions.drawing_utils self.faceDetection = self.mpFD.FaceDetection() def findFaces(self, vid, draw=True): vidRBG = cv.cvtColor(vid, cv.COLOR_BGR2RGB) self.results = self.faceDetection.process(vidRBG) #print(results) bboxs = [] if self.results.detections: for
Cites Eduardo V. Kuri · 2021-12 · Stack Overflow · on “Unknown problem with module using CV2 and mediapipe”
I have some trouble running the module on python 3.10.1. This is my code: import mediapipe as mp import cv2 import time class handDetector: def __init__(self, mode=False, maxHands=2, complexity = 1, detectionCon=0.5, trackCon=0.5): self.mode = mode self.maxHands = maxHands self.complexity = complexity self.detectionCon = detectionCon self.trackCon = trackCon self.mpDraw = mp.solutions.drawing_utils def FindHands(self, img, draw = True): imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) results = self.hands.process(imgRGB) landmarks = results.multi_hand_landmarks #print(results.multi_hand_landmarks) if landmarks: for handLms in landmarks: if draw: self.mpDraw.draw_landmarks(img, handLms, self.mpH
Cites quhtani · 2022-04 · Stack Overflow · on “when using mediapipe and opencv , multi_hand_landmarks doesn't work”
i'm following a youtube tutorial [this video] and i copied the code line by line but it seems like python cannot find multi_hand_landmarks im using VScode here is my code: import cv2 from cv2 import FONT_HERSHEY_COMPLEX import mediapipe import time cap = cv2.VideoCapture(0) ptime = 0 Ctime = 0 mpHands = mediapipe.solutions.mediapipe.python.solutions.hands hands = mpHands.Hands() mpDraw = mediapipe.solutions.mediapipe.python.solutions.drawing_utils while True: success , img = cap.read() imgRGB = cv2.cvtColor(img , cv2.COLOR_BGR2RGB) results = hands.process(imgRGB) if results.multi_hand_landmarks: for handLMS in results.multi_hand_landmraks: # for id , lm , in enumerate(handLMS.landmark): # h , w ,
Cites The Crafters · 2022-10 · Stack Overflow · on “How would I deal with an attribute error with mediapipe solutions?”
I get an attribute error if I use the function: def faceDetection(): if results.detections: for detection in results.detection: print(id, detection) AttributeError: type object 'SolutionOutputs' has no attribute 'detections' is the error I get if I try running, specifically it calls it on the results.detections: line it works fine in this [this video] at 1:43:56 I don't really know how to read the github code but here's [LINK] the link I do have mpFD = mp.solutions.face_detection # FD = face_detection fD = mpFD.FaceDetection() defined before the function already. Is this an issue with my code or is it something else?