-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
WARNING: Logging before InitGoogleLogging() is written to STDERR #2810
Comments
Hi @yoyojacky, Are you able to execute the code and see the result and Does that cause code breakage ? Python threading and glog logging did actually work ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
Hi sgowroji, |
I had the same issue and I found that: The problemYour problem is Memory. You are using your full memory. Why?Creating objects inside a loop. In your code here: hands = mp_hands.Hands(min_detection_confidence=0.5, min_tracking_confidence=0.5) you are creating a SolutionYou may need to move the line before the loop as such: import cv2
import mediapipe as mp
mp_draw = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
cap = cv2.VideoCapture(0)
hands = mp_hands.Hands(min_detection_confidence=0.5, min_tracking_confidence=0.5)
while True:
ret, frame = cap.read()
frame = cv2.flip(frame, 1)
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
frame_rgb.flags.writeable = False
result = hands.process(frame_rgb)
frame_rgb.flags.writeable = True
frame = cv2.cvtColor(frame_rgb, cv2.COLOR_RGB2BGR)
if result.multi_hand_landmarks:
for lms in result.multi_hand_landmarks:
mp_draw.draw_landmarks(frame, lms, mp_hands.HAND_CONNECTIONS,
mp_draw.DrawingSpec(color=(255, 0, 255),thickness=5, circle_radius=5))
mp_draw.draw_landmarks(frame, lms, mp_hands.HAND_CONNECTIONS, connection_drawing_spec=mp_draw.DrawingSpec((0, 255, 0), thickness=5, circle_radius=4))
cv2.imshow("junction2021", frame)
if cv2.waitKey(1) & 0xFF == 27:
break
cap.release()
cv2.destroyAllWindows() it will work perfectly. |
Current incranation of the the same title description now at #5371 |
Please make sure that this is a bug and also refer to the troubleshooting, FAQ documentation before raising any issues.
System information
Standalone code to reproduce the issue:
It also appears in my Raspberry Pi 4B too, with the same code and mediapipe version in Raspberry Pi 4b is
mediapipe-rpi4
.The text was updated successfully, but these errors were encountered: