Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendered videos lagging on MacOS, getting this: INFO: Created TensorFlow Lite XNNPACK delegate for CPU #5417

Open
Vishruth23 opened this issue May 18, 2024 · 2 comments
Assignees
Labels
legacy:pose Pose Detection related issues os:macOS Issues on MacOS platform:python MediaPipe Python issues stale stat:awaiting response Waiting for user response type:support General questions

Comments

@Vishruth23
Copy link

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

MacOS

MediaPipe Tasks SDK version

No response

Task name (e.g. Image classification, Gesture recognition etc.)

Pose Estimation

Programming Language and version (e.g. C++, Python, Java)

Python

Describe the actual behavior

Rendered video extremely laggy, huge drop in FPS, I'm getting this: INFO: Created TensorFlow Lite XNNPACK delegate for CPU

Describe the expected behaviour

Rendered video should be smooth

Standalone code/steps you may have used to try to get what you need

import cv2
import mediapipe as mp
import time

cap = cv2.VideoCapture("PE-testcase2.mp4") # or VideoCapture(0)
mpPose = mp.solutions.pose
mpDraw = mp.solutions.drawing_utils

while True:
    success, image = cap.read()
    # cv2.imshow("Image", image)

    if not success:
        print("Ignoring empty camera frame.")
        continue

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

    with mpPose.Pose(model_complexity=1, min_detection_confidence=0.5, min_tracking_confidence=0.5) as pose:

        imgRGB = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
        imgRGB.flags.writeable = False

        results = pose.process(imgRGB)

        imgRGB.flags.writeable = True
        imgRGB = cv2.cvtColor(imgRGB, cv2.COLOR_RGB2BGR)

        if results.pose_landmarks:
            mpDraw.draw_landmarks(imgRGB, results.pose_landmarks, mpPose.POSE_CONNECTIONS)
        
        cv2.imshow("Image", imgRGB)



cap.release()
cv2.destroyAllWindows()

Other info / Complete Logs

No response

@Vishruth23 Vishruth23 changed the title Videos lagging Rendered videos lagging on MacOS, getting this: INFO: Created TensorFlow Lite XNNPACK delegate for CPU May 18, 2024
@kuaashish kuaashish self-assigned this May 20, 2024
@kuaashish kuaashish added os:macOS Issues on MacOS platform:python MediaPipe Python issues legacy:pose Pose Detection related issues type:support General questions labels May 20, 2024
@kuaashish
Copy link
Collaborator

Hi @Vishruth23,

After reviewing the provided standalone code, it appears that you are currently using the outdated pose solution, which is no longer maintained, and we have ceased support for it. This functionality has been integrated into the new Pose Landmarker Task API, detailed here.

We encourage you to explore the features of our updated Pose Landmarker Task API and suggest replacing the legacy Pose with the new Pose Landmarker. The new solution offers improved performance and additional functionality compared to the legacy pose solution. You can find the guide for the new Pose Landmarker here, along with specific instructions for implementation in the Python platform provided here. Additionally, a corresponding example Colab notebook is available for reference here.

Please report any observed behavior, ensuring to check if similar issues persist in the upgraded task API. Unfortunately, beyond this, there is limited action we can take to address the specific issue you are facing.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label May 20, 2024
Copy link

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:pose Pose Detection related issues os:macOS Issues on MacOS platform:python MediaPipe Python issues stale stat:awaiting response Waiting for user response type:support General questions
Projects
None yet
Development

No branches or pull requests

2 participants