Skip to content

Commit

Permalink
undo black formatting for face contours and ignore_names
Browse files Browse the repository at this point in the history
  • Loading branch information
cleong110 committed Jan 10, 2025
1 parent 61adc37 commit 5f86f29
Showing 1 changed file with 12 additions and 140 deletions.
152 changes: 12 additions & 140 deletions src/python/pose_format/utils/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,149 +282,21 @@ def reduce_holistic(pose: Pose) -> Pose:
"""
# To avoid installing mediapipe, we just hardcode the face contours given the above code
face_contours = [
"0",
"7",
"10",
"13",
"14",
"17",
"21",
"33",
"37",
"39",
"40",
"46",
"52",
"53",
"54",
"55",
"58",
"61",
"63",
"65",
"66",
"67",
"70",
"78",
"80",
"81",
"82",
"84",
"87",
"88",
"91",
"93",
"95",
"103",
"105",
"107",
"109",
"127",
"132",
"133",
"136",
"144",
"145",
"146",
"148",
"149",
"150",
"152",
"153",
"154",
"155",
"157",
"158",
"159",
"160",
"161",
"162",
"163",
"172",
"173",
"176",
"178",
"181",
"185",
"191",
"234",
"246",
"249",
"251",
"263",
"267",
"269",
"270",
"276",
"282",
"283",
"284",
"285",
"288",
"291",
"293",
"295",
"296",
"297",
"300",
"308",
"310",
"311",
"312",
"314",
"317",
"318",
"321",
"323",
"324",
"332",
"334",
"336",
"338",
"356",
"361",
"362",
"365",
"373",
"374",
"375",
"377",
"378",
"379",
"380",
"381",
"382",
"384",
"385",
"386",
"387",
"388",
"389",
"390",
"397",
"398",
"400",
"402",
"405",
"409",
"415",
"454",
"466",
'0', '7', '10', '13', '14', '17', '21', '33', '37', '39', '40', '46', '52', '53', '54', '55', '58', '61', '63',
'65', '66', '67', '70', '78', '80', '81', '82', '84', '87', '88', '91', '93', '95', '103', '105', '107', '109',
'127', '132', '133', '136', '144', '145', '146', '148', '149', '150', '152', '153', '154', '155', '157', '158',
'159', '160', '161', '162', '163', '172', '173', '176', '178', '181', '185', '191', '234', '246', '249', '251',
'263', '267', '269', '270', '276', '282', '283', '284', '285', '288', '291', '293', '295', '296', '297', '300',
'308', '310', '311', '312', '314', '317', '318', '321', '323', '324', '332', '334', '336', '338', '356', '361',
'362', '365', '373', '374', '375', '377', '378', '379', '380', '381', '382', '384', '385', '386', '387', '388',
'389', '390', '397', '398', '400', '402', '405', '409', '415', '454', '466'
]

ignore_names = [
"EAR",
"NOSE",
"MOUTH",
"EYE",
"THUMB",
"PINKY",
"INDEX",
"KNEE",
"ANKLE",
"HEEL",
"FOOT_INDEX",
] # Face # Hands # Feet
"EAR", "NOSE", "MOUTH", "EYE", # Face
"THUMB", "PINKY", "INDEX", # Hands
"KNEE", "ANKLE", "HEEL", "FOOT_INDEX" # Feet
]

body_component = [c for c in pose.header.components if c.name == "POSE_LANDMARKS"][0]
body_no_face_no_hands = [p for p in body_component.points if all([i not in p for i in ignore_names])]
Expand Down

0 comments on commit 5f86f29

Please sign in to comment.