Skip to content

Commit 6254cc8

Browse files
Copilotxiu-cs
andauthored
Fix typo: num_peroson -> num_person in gen_kpts.py and call sites
Agent-Logs-Url: https://github.com/AdaptiveMotorControlLab/FMPose3D/sessions/2136af56-29a8-4635-9ed4-faf9b8146672 Co-authored-by: xiu-cs <81274389+xiu-cs@users.noreply.github.com>
1 parent ec10769 commit 6254cc8

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

demo/vis_in_the_wild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def show3Dpose(vals, ax):
113113
def get_pose2D(path, output_dir, type):
114114

115115
print('\nGenerating 2D pose...')
116-
keypoints, scores = hrnet_pose(path, det_dim=416, num_peroson=1, gen_output=True, type=type)
116+
keypoints, scores = hrnet_pose(path, det_dim=416, num_person=1, gen_output=True, type=type)
117117
keypoints, scores, valid_frames = h36m_coco_format(keypoints, scores)
118118
re_kpts = revise_kpts(keypoints, scores, valid_frames)
119119
print('Generating 2D pose successful!')

fmpose3d/lib/hrnet/gen_kpts.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def model_load(config):
9999

100100
return model
101101

102-
def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=416, num_peroson=1, gen_output=False):
102+
def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=416, num_person=1, gen_output=False):
103103

104104
bboxs, scores = yolo_det(frame, human_model, reso=det_dim, confidence=args.thred_score)
105105
if bboxs is None or not bboxs.any():
@@ -117,7 +117,7 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
117117
if people_track.shape[0] == 1:
118118
people_track_ = people_track[-1, :-1].reshape(1, 4)
119119
elif people_track.shape[0] >= 2:
120-
people_track_ = people_track[-num_peroson:, :-1].reshape(num_peroson, 4)
120+
people_track_ = people_track[-num_person:, :-1].reshape(num_person, 4)
121121
people_track_ = people_track_[::-1]
122122
else:
123123
return [], []
@@ -129,7 +129,7 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
129129

130130
with torch.no_grad():
131131
# bbox is coordinate location
132-
inputs, origin_img, center, scale = PreProcess(frame, track_bboxs, cfg, num_peroson)
132+
inputs, origin_img, center, scale = PreProcess(frame, track_bboxs, cfg, num_person)
133133

134134
inputs = inputs[:, [2, 1, 0]]
135135

@@ -140,8 +140,8 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
140140
# compute coordinate
141141
preds, maxvals = get_final_preds(cfg, output.clone().cpu().numpy(), np.asarray(center), np.asarray(scale))
142142

143-
kpts = np.zeros((num_peroson, 17, 2), dtype=np.float32)
144-
scores = np.zeros((num_peroson, 17), dtype=np.float32)
143+
kpts = np.zeros((num_person, 17, 2), dtype=np.float32)
144+
scores = np.zeros((num_person, 17), dtype=np.float32)
145145
for i, kpt in enumerate(preds):
146146
kpts[i] = kpt
147147

@@ -151,7 +151,7 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
151151
return kpts, scores
152152

153153

154-
def gen_video_kpts(path, det_dim=416, num_peroson=1, gen_output=False, type='image'):
154+
def gen_video_kpts(path, det_dim=416, num_person=1, gen_output=False, type='image'):
155155
# Ensure checkpoints are downloaded only when HRNet is actually requested
156156
ensure_checkpoints()
157157

@@ -168,7 +168,7 @@ def gen_video_kpts(path, det_dim=416, num_peroson=1, gen_output=False, type='ima
168168
scores_result = []
169169
if type == "image":
170170
frame = cv2.imread(path)
171-
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_peroson=num_peroson, gen_output=gen_output)
171+
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_person=num_person, gen_output=gen_output)
172172
kpts_result.append(kpts)
173173
scores_result.append(scores)
174174

@@ -180,7 +180,7 @@ def gen_video_kpts(path, det_dim=416, num_peroson=1, gen_output=False, type='ima
180180
if not ret:
181181
continue
182182

183-
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_peroson=num_peroson, gen_output=gen_output)
183+
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_person=num_person, gen_output=gen_output)
184184
kpts_result.append(kpts)
185185
scores_result.append(scores)
186186

tests/test_demo_human.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_2d_pose_estimation(test_image_path, test_output_dir):
3838
from fmpose3d.lib.preprocess import h36m_coco_format, revise_kpts
3939

4040
# Run 2D pose estimation
41-
keypoints, scores = hrnet_pose(test_image_path, det_dim=416, num_peroson=1, gen_output=True, type='image')
41+
keypoints, scores = hrnet_pose(test_image_path, det_dim=416, num_person=1, gen_output=True, type='image')
4242

4343
# Check output shapes
4444
assert keypoints is not None, "Keypoints should not be None"

0 commit comments

Comments
 (0)