Комментарии:
Anyone else run into the divided by zero error when making the face detection module? The error comes from line 11 where fps = 1/cTime -pTime . cTime is set as time.time() while pTime is set to cTime which means they are the same value resulting in 0 being their difference. This error seemingly prevents the script from executing though, sometimes it just runs until it runs into the error. Any notes to fix this?
Ответитьhow do I open the "hands" in parameters if I'm on a mac, he said to control right click but it doesn't work.
Ответитьhow could I get the codes through websites
Ответитьsome link error? can u share trainer ai videos and jpg for demos?
ОтветитьNC
ОтветитьAmazing
Ответитьi have problem in transforming the poseEstimationmin to pose module what to do help guys
ОтветитьAttributeError: module 'cv2.dnn' has no attribute 'DictValue'
I got some error, please help me fix this error.
quick hint if your video is too big for the screen:
cv2.namedWindow("Resized_Window", cv2.WINDOW_NORMAL)
cv2.resizeWindow("Resized_Window", 1200, 700)
cv2.imshow("Resized_Window", img)
### resized window values are the rectangle sides, you can adjust them as you wish
In Pose Estimation, how can i find the z cordinate ? and show the depth frame also with poses?
Ответитьcasualy uploads a 6 hour comp vision course brooo, thanks bhai !
ОтветитьCan I use vs code instead? If yes, how do i integrate mediapipe & opencv like he did?
ОтветитьGreat course!
ОтветитьImgae = I am gay
ОтветитьReplace FACE_CONNECTIONS with FACEMESH_TESSELATION if you get an attribute error (Face Mesh section)
ОтветитьHand Tracking module does not work..
ОтветитьCan I use vs code for my learning instead of pycharm as used in this tutorial?
ОтветитьWhy i can not install mediapipe . Its give an error
ОтветитьGreat video, congratulations!! Can mediapipe be adapted to recognize the foot palm (like the hand) ?
Ответитьhelp. What should I do if the automatically translated subtitles are not displayed in the second half of the video?
ОтветитьI couldn't down load OpenCV in current platform.
ОтветитьHow do you fix the point out of bounds error?
Ответитьcant we detect multiple pose?
ОтветитьWould we able to import this python script in blender for object tracking??
Ответитьhii sir ,i want to install a library named mediapipe for my project and i have 3.11 version of the python and im facing problem in installing the library ,will you please help me out for doing this plz plz plz
ОтветитьOkay I tried 10 hours but unable to install mediapipe , now some one has to help me please
Ответитьcan you do pose estimation with pictures rather than video?
Ответитьwhere to get the videos of pose detection
ОтветитьSir I am unable to access the source code you provided through the link you have given in description
ОтветитьIs this for beginners??
ОтветитьHey guys if u are getting any errors in hand tracking module please refer to the below code:---
import cv2
import mediapipe as mp
import time
import math
import numpy as np
class handDetector():
def __init__(self, mode=False, maxHands=2, detectionCon=0.7, trackCon=0.5):
self.mode = mode
self.maxHands = maxHands
self.detectionCon = detectionCon
self.modelComplex = 1
self.trackCon = trackCon
self.mpHands = mp.solutions.hands
self.hands = self.mpHands.Hands(self.mode, self.maxHands, self.modelComplex, self.detectionCon, self.trackCon)
self.mpDraw = mp.solutions.drawing_utils
self.tipIds = [4, 8, 12, 16, 20]
def findHands(self, img, draw=True):
imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
self.results = self.hands.process(imgRGB)
# print(results.multi_hand_landmarks)
if self.results.multi_hand_landmarks:
for handLms in self.results.multi_hand_landmarks:
if draw:
self.mpDraw.draw_landmarks(img, handLms,self.mpHands.HAND_CONNECTIONS)
return img
def findPosition(self, img, handNo=0, draw=True):
xList = []
yList = []
bbox = []
self.lmList = []
if self.results.multi_hand_landmarks:
myHand = self.results.multi_hand_landmarks[handNo]
for id, lm in enumerate(myHand.landmark):
# print(id, lm)
h, w, c = img.shape
cx, cy = int(lm.x * w), int(lm.y * h)
xList.append(cx)
yList.append(cy)
# print(id, cx, cy)
self.lmList.append([id, cx, cy])
if draw:
cv2.circle(img, (cx, cy), 5, (255, 0, 255), cv2.FILLED)
xmin, xmax = min(xList), max(xList)
ymin, ymax = min(yList), max(yList)
bbox = xmin, ymin, xmax, ymax
if draw:
cv2.rectangle(img, (xmin - 20, ymin - 20), (xmax + 20, ymax + 20),
(0, 255, 0), 2)
return self.lmList, bbox
def fingersUp(self):
fingers = []
# Thumb
if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0] - 1][1]:
fingers.append(1)
else:
fingers.append(0)
# Fingers
for id in range(1, 5):
if self.lmList[self.tipIds[id]][2] < self.lmList[self.tipIds[id] - 2][2]:
fingers.append(1)
else:
fingers.append(0)
# totalFingers = fingers.count(1)
return fingers
def findDistance(self, p1, p2, img, draw=True,r=15, t=3):
x1, y1 = self.lmList[p1][1:]
x2, y2 = self.lmList[p2][1:]
cx, cy = (x1 + x2) // 2, (y1 + y2) // 2
if draw:
cv2.line(img, (x1, y1), (x2, y2), (255, 0, 255), t)
cv2.circle(img, (x1, y1), r, (255, 0, 255), cv2.FILLED)
cv2.circle(img, (x2, y2), r, (255, 0, 255), cv2.FILLED)
cv2.circle(img, (cx, cy), r, (0, 0, 255), cv2.FILLED)
length = math.hypot(x2 - x1, y2 - y1)
return length, img, [x1, y1, x2, y2, cx, cy]
def main():
pTime = 0
cTime = 0
cap = cv2.VideoCapture(0)
detector = handDetector()
while True:
success, img = cap.read()
img = detector.findHands(img)
lmList, bbox = detector.findPosition(img)
if len(lmList) != 0:
print(lmList[4])
cTime = time.time()
fps = 1 / (cTime - pTime)
pTime = cTime
cv2.putText(img, str(int(fps)), (10, 70), cv2.FONT_HERSHEY_PLAIN, 3,
(255, 0, 255), 3)
cv2.imshow("Image", img)
if cv2.waitKey(20) & 0xFF==ord('s'):
break
# cv2.waitKey(1)
if _name_ == "__main__":
main()
i'm only 40 minutes in the course and WOW!
thank you very much!
post code in comments
ОтветитьThis is such a great course, my man just gave everyone the steps to a free working AI framework. That you can customize if you put your own time in. You sir deserve the recognition o7.
ОтветитьWhat are prerequisites for this video can any one please tell me? If you know
Ответитьwhy do we get an error when we open the link to the code?
ОтветитьCould you please gave me the code
ОтветитьHow can I download images for finger counter project ?
ОтветитьFor me, I install python 3.8.10 version again and uninstall my new version. It fix the error installing mediapipe. It helps you to keep going this courses. I don't know why python 3.11 doesn't work.
Ответитьikd why I cant run the module properly even I extractly like yours, but when I import this module in another file then it still work well, its kinda confused for me
ОтветитьIf someone is having issues like "cannot find videocapture in ___in....bla bla"
Right click on Lib folder and mark directory as source
Hi, i´m beginer in programation, bot your tutorial is very comprensive , thanks
Ответитьan error occurring while installing autopy
anybody facing this problem?
How can ai be a thinker and creator?
Ответить