Repository navigation
Description
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
Arch Linux (Kernel: 7.2.7-arch1-1) - x86_64, Wayland
Mobile device if the issue happens on mobile device
No response
Browser and version if the issue happens on browser
No response
Programming Language and version
Python 3.14
MediaPipe version
1.0.1-1 python-mediapipe-bin aur
Bazel version
No response
Solution
HandLandmarker
Android Studio, NDK, SDK versions (if issue is related to building in Android environment)
No response
Xcode & Tulsi version (if issue is related to building for iOS)
No response
Describe the actual behavior
The Python process is abruptly terminated with PID killed python main.py (signal 9 / SIGKILL) right after initializing HandLandmarker options and creating the TFLite XNNPACK delegate. Tracking signal generation via bpftrace reveals that the kill signal is not emitted by the Linux kernel OOM killer or external system daemons, but originates internally from MediaPipe's own worker thread (drishti). The issue does not occur on Windows with identical pipeline logic and models, but fails consistently on Arch Linux regardless of whether packages are installed via yay (python-mediapipe-bin) or pip.
Describe the expected behaviour
HandLandmarker.create_from_options(options) should complete initialization and process video frames asynchronously via detect_async in LIVE_STREAM mode without triggering an internal panic/SIGKILL.
Standalone code/steps you may have used to try to get what you need
Install packages via yay: yay -S python-mediapipe-bin python-opencv python-numpy. Download model bundle: wget -O hand_landmarker.task https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/latest/hand_landmarker.task. Run script:
import time
import threading
from typing import Optional, List, Tuple
import cv2
import numpy as np
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
class HandTracker:
HAND_CONNECTIONS = [
(0, 1), (1, 2), (2, 3), (3, 4),
(0, 5), (5, 6), (6, 7), (7, 8),
(5, 9), (9, 10), (10, 11), (11, 12),
(9, 13), (13, 14), (14, 15), (15, 16),
(13, 17), (17, 18), (18, 19), (19, 20),
(0, 17)
]
def __init__(self, model_path: str = "hand_landmarker.task", num_hands: int = 1):
self._model_path = model_path
self._num_hands = num_hands
self._landmarker: Optional[vision.HandLandmarker] = None
self._lock = threading.Lock()
self._latest_result: Optional[vision.HandLandmarkerResult] = None
self._last_timestamp_ms: int = 0
def _result_callback(self, result: vision.HandLandmarkerResult, output_image: mp.Image, timestamp_ms: int):
with self._lock:
self._latest_result = result
def start(self):
options = vision.HandLandmarkerOptions(
base_options=python.BaseOptions(model_asset_path=self._model_path),
running_mode=vision.RunningMode.LIVE_STREAM,
num_hands=self._num_hands,
min_hand_detection_confidence=0.5,
min_hand_presence_confidence=0.5,
min_tracking_confidence=0.5,
result_callback=self._result_callback
)
self._landmarker = vision.HandLandmarker.create_from_options(options)
return self
def close(self):
if self._landmarker:
self._landmarker.close()
self._landmarker = None
def __enter__(self):
return self.start()
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
def process_frame_async(self, bgr_frame: np.ndarray):
if self._landmarker is None:
raise RuntimeError("HandTracker is not running.")
rgb_frame = cv2.cvtColor(bgr_frame, cv2.COLOR_BGR2RGB)
mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=rgb_frame)
current_timestamp_ms = int(time.time() * 1000)
if current_timestamp_ms <= self._last_timestamp_ms:
current_timestamp_ms = self._last_timestamp_ms + 1
self._last_timestamp_ms = current_timestamp_ms
self._landmarker.detect_async(mp_image, current_timestamp_ms)
def get_landmarks_pixel(self, frame_shape: Tuple[int, int, ...]) -> Optional[List[Tuple[int, int]]]:
h, w = frame_shape[:2]
with self._lock:
if not self._latest_result or not self._latest_result.hand_landmarks:
return None
first_hand = self._latest_result.hand_landmarks[0]
return [(int(pt.x * w), int(pt.y * h)) for pt in first_hand]
def draw_hand(frame: np.ndarray, landmarks: List[Tuple[int, int]]):
for start_idx, end_idx in HandTracker.HAND_CONNECTIONS:
p1 = landmarks[start_idx]
p2 = landmarks[end_idx]
cv2.line(frame, p1, p2, (0, 255, 0), 2)
for pt in landmarks:
cv2.circle(frame, pt, 4, (0, 0, 255), -1)
def main():
cap = cv2.VideoCapture(0)
if not cap.isOpened():
print("Error: Could not open camera.")
return
with HandTracker(model_path="hand_landmarker.task", num_hands=1) as tracker:
while True:
ret, frame = cap.read()
if not ret:
break
frame = cv2.flip(frame, 1)
tracker.process_frame_async(frame)
landmarks = tracker.get_landmarks_pixel(frame.shape)
if landmarks:
draw_hand(frame, landmarks)
index_tip = landmarks[8]
cv2.circle(frame, index_tip, 8, (255, 255, 0), -1)
cv2.imshow("MediaPipe Tracker", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
if __name__ == "__main__":
main()Other info / Complete Logs
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
[1] 55326 killed python main.pyKernel log (dmesg) and systemd-oomd confirm no system OOM events occurred:
$ sudo dmesg -T | grep -Ei "killed process|oom"
[Tue Oct 6 14:57:13 2026] OOM killer disabled.
[Tue Oct 6 14:57:13 2026] OOM killer enabled.
$ free -h
total used free shared buff/cache available
Mem: 11Gi 3.3Gi 3.6Gi 71Mi 4.3Gi 8.1Gi
Swap: 0B 0B 0BBpfTrace probe (tracepoint:signal:signal_generate /args->sig == 9/) output:
SENDER: drishti (PID 57337) -> VICTIM: PID 57376strace inspection shows initialization proceeds normally through mmap of hand_landmarker.task, spawning the thread pool (ThreadPoolExecu), setting thread name to drishti, configuring timers (timer_create(..., SIGPROF)), after which all spawned threads simultaneously receive SIGKILL without any SIGSEGV or SIGABRT being logged first.
Activity
HarishPermal commentedon Oct 7, 2026
hi @SidBroGG
Thanks for reporting, i'm trying to reproduce this issue and will get back with update.
HarishPermal commentedon Oct 7, 2026
Hi @SidBroGG,
I tested this in a clean Arch Linux docker container using Python 3.14.7, the official MediaPipe 1.1.0 wheel, and a 512 MiB memory limit.
Could you please retry using MediaPipe 1.1.0 in a clean virtual environment?
SidBroGG commentedon Oct 7, 2026
Hi, I tried running the code in a virtual environment, but the issue still persists
SidBroGG commentedon Oct 7, 2026
I just realized I ran main.py using the system python instead of the virtual environment's python. But again, the issue persists. Here is the updated log:
HarishPermal commentedon Oct 12, 2026
Thanks @SidBroGG let me test again, i'll update you
KacperPiotrowski commentedon Oct 18, 2026
Hi MediaPipe team!
We may have another reproduction of the SIGKILL / exit code 137 problem described here, but this time with FaceLandmarker rather than HandLandmarker.
Environment
mediapipe==1.1.1wheelface_landmarker.taskmodelMinimal reproduction
Actual result
The process is killed during
FaceLandmarker.create_from_options(), before processing any images.We reproduced this both with and without an OpenCV GUI, and with
output_face_blendshapes=False. The standalone reproducer does not access any camera or other hardware.This seems related to the original HandLandmarker report, but we have not traced the source of SIGKILL, so we cannot yet confirm the same root cause.
Our downstream investigation:
KacperPiotrowski/Kinect2Linux#25
Could you advise which additional diagnostics would be most useful to identify the source of SIGKILL on MediaPipe 1.1.1?
Thank you!