You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,7 +430,7 @@ sports2d --help
430
430
'calculate_angles': ["c", "calculate joint and segment angles. true if not specified"],
431
431
'save_angles': ["A", "save angles as mot files. true if not specified"],
432
432
'slowmo_factor': ["", "slow-motion factor. For a video recorded at 240 fps and exported to 30 fps, it would be 240/30 = 8. 1 if not specified"],
433
-
'pose_model': ["p", "only body_with_feet is available for now. body_with_feet if not specified"],
433
+
'pose_model': ["p", "body_with_feet, whole_body_wrist, whole_body, or body. body_with_feet if not specified"],
434
434
'mode': ["m", 'light, balanced, performance, or a """{dictionary within triple quote}""". balanced if not specified. Use a dictionary to specify your own detection and/or pose estimation models (more about in the documentation).'],
435
435
'det_frequency': ["f", "run person detection only every N frames, and inbetween track previously detected bounding boxes. keypoint detection is still run on all frames.\n\
436
436
Equal to or greater than 1, can be as high as you want in simple uncrowded cases. Much faster, but might be less accurate. 1 if not specified: detection runs on all frames"],
@@ -444,6 +444,7 @@ sports2d --help
444
444
'save_calib': ["", "save calibration file. true if not specified"],
445
445
'do_ik': ["", "do inverse kinematics. false if not specified"],
446
446
'use_augmentation': ["", "Use LSTM marker augmentation. false if not specified"],
447
+
'feet_on_floor': ["", "offset marker augmentation results so that feet are at floor level. true if not specified"],
447
448
'use_contacts_muscles': ["", "Use model with contact spheres and muscles. false if not specified"],
448
449
'participant_mass': ["", "mass of the participant in kg or none. Defaults to 70 if not provided. No influence on kinematics (motion), only on kinetics (forces)"],
449
450
'close_to_zero_speed_m': ["","Sum for all keypoints: about 50 px/frame or 0.2 m/frame"],
use_augmentation = false# true or false (lowercase) # Set to true if you want to use the model with augmented markers
154
+
feet_on_floor = false# true or false (lowercase) # Set to false if you want to use the model with feet not on the floor (e.g. running, jumping, etc.)
154
155
use_contacts_muscles = true# true or false (lowercase) # If true, contact spheres and muscles are added to the model
155
156
participant_mass = [55.0, 67.0] # kg # defaults to 70 if not provided. No influence on kinematics (motion), only on kinetics (forces)
156
157
right_left_symmetry = true# true or false (lowercase) # Set to false only if you have good reasons to think the participant is not symmetrical (e.g. prosthetic limb)
Copy file name to clipboardExpand all lines: Sports2D/Sports2D.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -205,6 +205,7 @@
205
205
},
206
206
'kinematics':{'do_ik': False,
207
207
'use_augmentation': False,
208
+
'feet_on_floor': False,
208
209
'use_contacts_muscles': True,
209
210
'participant_mass': [55.0, 67.0],
210
211
'right_left_symmetry': True,
@@ -244,7 +245,7 @@
244
245
'calculate_angles': ["c", "calculate joint and segment angles. true if not specified"],
245
246
'save_angles': ["A", "save angles as mot files. true if not specified"],
246
247
'slowmo_factor': ["", "slow-motion factor. For a video recorded at 240 fps and exported to 30 fps, it would be 240/30 = 8. 1 if not specified"],
247
-
'pose_model': ["p", "only body_with_feet is available for now. body_with_feet if not specified"],
248
+
'pose_model': ["p", "body_with_feet, whole_body_wrist, whole_body, or body. body_with_feet if not specified"],
248
249
'mode': ["m", 'light, balanced, performance, or a """{dictionary within triple quote}""". balanced if not specified. Use a dictionary to specify your own detection and/or pose estimation models (more about in the documentation).'],
249
250
'det_frequency': ["f", "run person detection only every N frames, and inbetween track previously detected bounding boxes. keypoint detection is still run on all frames.\n\
250
251
Equal to or greater than 1, can be as high as you want in simple uncrowded cases. Much faster, but might be less accurate. 1 if not specified: detection runs on all frames"],
@@ -258,6 +259,7 @@
258
259
'save_calib': ["", "save calibration file. true if not specified"],
259
260
'do_ik': ["", "do inverse kinematics. false if not specified"],
260
261
'use_augmentation': ["", "Use LSTM marker augmentation. false if not specified"],
262
+
'feet_on_floor': ["", "offset marker augmentation results so that feet are at floor level. true if not specified"],
261
263
'use_contacts_muscles': ["", "Use model with contact spheres and muscles. false if not specified"],
262
264
'participant_mass': ["", "mass of the participant in kg or none. Defaults to 70 if not provided. No influence on kinematics (motion), only on kinetics (forces)"],
263
265
'close_to_zero_speed_m': ["","Sum for all keypoints: about 50 px/frame or 0.2 m/frame"],
# Select the appropriate model based on the model_type
1431
+
logging.info('\nEstimating pose...')
1429
1432
ifpose_model.upper() in ('HALPE_26', 'BODY_WITH_FEET'):
1430
1433
model_name='HALPE_26'
1431
1434
ModelClass=BodyWithFeet# 26 keypoints(halpe26)
1432
1435
logging.info(f"Using HALPE_26 model (body and feet) for pose estimation.")
1433
-
elifpose_model.upper() =='WHOLE_BODY_WRIST':
1434
-
model_name='COCO_133_WRIST'
1435
-
ModelClass=Wholebody
1436
-
logging.info(f"Using COCO_133 model (body, feet, 2 hand points) for pose estimation.")
1437
-
elifpose_model.upper() in ('COCO_133', 'WHOLE_BODY'):
1436
+
elifpose_model.upper() in ('COCO_133', 'WHOLE_BODY', 'WHOLE_BODY_WRIST'):
1438
1437
model_name='COCO_133'
1439
1438
ModelClass=Wholebody
1440
1439
logging.info(f"Using COCO_133 model (body, feet, hands, and face) for pose estimation.")
1441
1440
elifpose_model.upper() in ('COCO_17', 'BODY'):
1442
1441
model_name='COCO_17'
1443
1442
ModelClass=Body
1444
1443
logging.info(f"Using COCO_17 model (body) for pose estimation.")
1444
+
elifpose_model.upper() =='HAND':
1445
+
model_name='HAND_21'
1446
+
ModelClass=Hand
1447
+
logging.info(f"Using HAND_21 model for pose estimation.")
1448
+
elifpose_model.upper() =='FACE':
1449
+
model_name='FACE_106'
1450
+
logging.info(f"Using FACE_106 model for pose estimation.")
1451
+
elifpose_model.upper() =='ANIMAL':
1452
+
model_name='ANIMAL2D_17'
1453
+
logging.info(f"Using ANIMAL2D_17 model for pose estimation.")
1445
1454
else:
1446
-
raiseValueError(f"Invalid model_type: {model_name}. Must be 'HALPE_26', 'COCO_133', or 'COCO_17'. Use another network (MMPose, DeepLabCut, OpenPose, AlphaPose, BlazePose...) and convert the output files if you need another model. See documentation.")
1455
+
model_name=pose_model.upper()
1456
+
logging.info(f"Using model {model_name} for pose estimation.")
0 commit comments