stream_hacks to main #2
|
@ -32,6 +32,20 @@ face_mesh_map = {
|
|||
],
|
||||
}
|
||||
|
||||
body_map = {
|
||||
LANDMARK_TYPES.SHOULDER | LANDMARK_TYPES.LEFT: [11],
|
||||
LANDMARK_TYPES.SHOULDER | LANDMARK_TYPES.RIGHT: [12],
|
||||
|
||||
LANDMARK_TYPES.ELBOW | LANDMARK_TYPES.LEFT: [13],
|
||||
LANDMARK_TYPES.ELBOW | LANDMARK_TYPES.RIGHT: [14],
|
||||
|
||||
LANDMARK_TYPES.HIP | LANDMARK_TYPES.LEFT: [23],
|
||||
LANDMARK_TYPES.HIP | LANDMARK_TYPES.RIGHT: [24],
|
||||
|
||||
LANDMARK_TYPES.KNEE | LANDMARK_TYPES.LEFT: [25],
|
||||
LANDMARK_TYPES.KNEE | LANDMARK_TYPES.RIGHT: [26],
|
||||
}
|
||||
|
||||
# SEE YEAH THESE MAKE SENSE GOOGLE WHAT THE HELL
|
||||
hand_mesh_map = {LANDMARK_TYPES.HAND | LANDMARK_TYPES.WRIST: [0]}
|
||||
_finger_map = {
|
||||
|
|
|
@ -2,7 +2,7 @@ import mediapipe
|
|||
import numpy as np
|
||||
|
||||
from ovtk_track.transform import TransformProcess
|
||||
from ovtk_track.transform.solve.mediapipe import face_mesh_map, hand_mesh_map
|
||||
from ovtk_track.transform.solve.mediapipe import face_mesh_map, hand_mesh_map, body_map
|
||||
from ovtk_track import types
|
||||
from ovtk_track.types.Landmarks import LANDMARK_TYPES
|
||||
|
||||
|
@ -83,6 +83,17 @@ class Process(TransformProcess):
|
|||
|
||||
available.append((right_hand_landmarks, mix_maps(hand_mesh_map, LANDMARK_TYPES.RIGHT)))
|
||||
|
||||
if results.pose_landmarks:
|
||||
raw_landmarks = results.pose_landmarks.landmark
|
||||
body_landmarks = np.empty((33, 3), dtype=np.float32)
|
||||
|
||||
for i in range(33):
|
||||
body_landmarks[i][0] = raw_landmarks[i].x
|
||||
body_landmarks[i][1] = raw_landmarks[i].y
|
||||
body_landmarks[i][2] = raw_landmarks[i].z
|
||||
|
||||
available.append((body_landmarks, body_map))
|
||||
|
||||
if available:
|
||||
avail_landmarks, maps = zip(*available)
|
||||
combo_map = combine_maps(zip(maps, (array.shape[0] for array in avail_landmarks)))
|
||||
|
|
|
@ -17,6 +17,17 @@ class LANDMARK_TYPES(Flag):
|
|||
LIPS = auto()
|
||||
CHIN = auto()
|
||||
|
||||
# Body
|
||||
SHOULDER = auto()
|
||||
ELBOW = auto()
|
||||
HIP = auto()
|
||||
KNEE = auto()
|
||||
|
||||
# Feet tracking lmao
|
||||
ANKLE = auto()
|
||||
HEEL = auto()
|
||||
TOE_INDEX = auto()
|
||||
|
||||
# Hand
|
||||
HAND = auto()
|
||||
WRIST = auto()
|
||||
|
|
Loading…
Reference in New Issue