File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,22 +261,24 @@ def visualize_results_yolo_pose_inference(
261261
262262 # Process each prediction
263263 for pred in predictions :
264+ print (pred .boxes )
265+ print (pred .keypoints )
264266
265267 # Get the bounding boxes and convert them to a list of lists
266268 boxes = pred .boxes .xyxy .cpu ().int ().tolist ()
267269
268270 # Get the classes and convert them to a list
269271 classes = pred .boxes .cls .cpu ().int ().tolist ()
270272
271- # Get the mask confidence scores
273+ # Get the confidence scores
272274 confidences = pred .boxes .conf .cpu ().numpy ()
273275
274- landmarks_visibility = pred .keypoints .conf .cpu ().tolist ()
275-
276- landmarks_xy = pred .keypoints .xy .cpu ().int ().tolist ()
277-
278276 num_objects = len (classes )
279277
278+ if num_objects > 0 :
279+ landmarks_visibility = pred .keypoints .conf .cpu ().tolist ()
280+ landmarks_xy = pred .keypoints .xy .cpu ().int ().tolist ()
281+
280282 # Visualization
281283 for i in range (num_objects ):
282284 # Get the class for the current detection
You can’t perform that action at this time.
0 commit comments