nicknochnack / ActionDetectionforSignLanguage

A practical implementation of sign language estimation using an LSTM NN built on TF Keras.
410 stars 253 forks source link

newwwww #25

Closed Tinycoder22 closed 1 year ago

Tinycoder22 commented 1 year ago

mp_holistic = mp.solutions.holistic mp_drawing = mp.solutions.drawing_utils

def mp_detection(image, model): image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image.flags.writable = False results = model.process(image) image.flags.writable = True image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) return image, results def draw_landmarks(image, results): mp_drawing.draw_landmarks(image,results.face_landmarks,mp_holistic.FACE_CONNECTIONS) mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_holistic.POSE_CONNECTIONS) mp_drawing.draw_landmarks(image, results.left_hand_landmarks, mp_holistic.HAND_CONNECTIONS) mp_drawing.draw_landmarks(image, results.right_hand_landmarks, mp_holistic.HAND_CONNECTIONS)

cap = cv2.VideoCapture(0) with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic: while cap.isOpened(): ret, frame = cap.read() image, results = mp_detection(frame, holistic) print(results) cv2.imshow("live feed", frame)

    if cv2.waitKey(10) & 0xFF == ord('q'):
        break

cap.release() cv2.destroyAllWindows() plt.imshow()