@@ -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
0 commit comments