sports2d 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sports2d-0.7.0 → sports2d-0.7.2}/PKG-INFO +1 -1
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Utilities/tests.py +6 -5
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/process.py +18 -5
- {sports2d-0.7.0 → sports2d-0.7.2}/setup.cfg +1 -1
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/PKG-INFO +1 -1
- {sports2d-0.7.0 → sports2d-0.7.2}/LICENSE +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/README.md +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Demo/Config_demo.toml +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Demo/demo.mp4 +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Sports2D.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Utilities/__init__.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Utilities/common.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Utilities/filter.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/Utilities/skeletons.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/Sports2D/__init__.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/pyproject.toml +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/setup.py +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/SOURCES.txt +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/dependency_links.txt +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/entry_points.txt +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/not-zip-safe +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/requires.txt +0 -0
- {sports2d-0.7.0 → sports2d-0.7.2}/sports2d.egg-info/top_level.txt +0 -0
|
@@ -58,12 +58,14 @@ def test_workflow():
|
|
|
58
58
|
demo_cmd = ["sports2d", "--show_realtime_results", "False", "--show_graphs", "False"]
|
|
59
59
|
subprocess.run(demo_cmd, check=True, capture_output=True, text=True, encoding='utf-8')
|
|
60
60
|
|
|
61
|
-
# With no pixels to meters conversion, no multiperson, lightweight mode, detection frequency,
|
|
61
|
+
# With no pixels to meters conversion, no multiperson, lightweight mode, detection frequency, slowmo factor, gaussian filter, RTMO body pose model
|
|
62
62
|
demo_cmd2 = ["sports2d", "--show_realtime_results", "False", "--show_graphs", "False",
|
|
63
63
|
"--to_meters", "False",
|
|
64
64
|
"--multiperson", "False",
|
|
65
65
|
"--mode", "lightweight", "--det_frequency", "50",
|
|
66
|
-
"--
|
|
66
|
+
"--slowmo_factor", "4",
|
|
67
|
+
"--filter_type", "gaussian",
|
|
68
|
+
"--pose_model", "body", "--mode", """{'pose_class':'RTMO', 'pose_model':'https://download.openmmlab.com/mmpose/v1/projects/rtmo/onnx_sdk/rtmo-m_16xb16-600e_body7-640x640-39e78cc4_20231211.zip', 'pose_input_size':[640, 640]}"""]
|
|
67
69
|
subprocess.run(demo_cmd2, check=True, capture_output=True, text=True, encoding='utf-8')
|
|
68
70
|
|
|
69
71
|
# With a time range, inverse kinematics, marker augmentation, body pose_model and custom RTMO mode
|
|
@@ -71,9 +73,8 @@ def test_workflow():
|
|
|
71
73
|
"--time_range", "1.2", "2.7",
|
|
72
74
|
"--do_ik", "True", "--use_augmentation", "True",
|
|
73
75
|
"--px_to_m_from_person_id", "1", "--px_to_m_person_height", "1.65",
|
|
74
|
-
"--visible_side", "
|
|
75
|
-
|
|
76
|
-
subprocess.run(demo_cmd3, check=True, capture_output=True, text=True)
|
|
76
|
+
"--visible_side", "front", "auto", "--participant_mass", "55.0", "67.0"]
|
|
77
|
+
subprocess.run(demo_cmd3, check=True, capture_output=True, text=True, encoding='utf-8')
|
|
77
78
|
|
|
78
79
|
# From config file
|
|
79
80
|
cli_config_path = Path(__file__).resolve().parent.parent / 'Demo' / 'Config_demo.toml'
|
|
@@ -625,7 +625,7 @@ def trc_data_from_XYZtime(X, Y, Z, time):
|
|
|
625
625
|
'''
|
|
626
626
|
|
|
627
627
|
trc_data = pd.concat([pd.concat([X.iloc[:,kpt], Y.iloc[:,kpt], Z.iloc[:,kpt]], axis=1) for kpt in range(len(X.columns))], axis=1)
|
|
628
|
-
trc_data.insert(0, '
|
|
628
|
+
trc_data.insert(0, 'time', time)
|
|
629
629
|
|
|
630
630
|
return trc_data
|
|
631
631
|
|
|
@@ -928,6 +928,7 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
928
928
|
px_to_m_from_person_id = int(config_dict.get('project').get('px_to_m_from_person_id'))
|
|
929
929
|
px_to_m_person_height_m = config_dict.get('project').get('px_to_m_person_height')
|
|
930
930
|
visible_side = config_dict.get('project').get('visible_side')
|
|
931
|
+
if isinstance(visible_side, str): visible_side = [visible_side]
|
|
931
932
|
# Pose from file
|
|
932
933
|
load_trc_px = config_dict.get('project').get('load_trc_px')
|
|
933
934
|
if load_trc_px == '': load_trc_px = None
|
|
@@ -1127,12 +1128,18 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
1127
1128
|
logging.error(f'\n{load_trc_px} file needs to be in px, not in meters.')
|
|
1128
1129
|
logging.info(f'\nUsing a pose file instead of running pose estimation and tracking: {load_trc_px}.')
|
|
1129
1130
|
# Load pose file in px
|
|
1130
|
-
Q_coords, _,
|
|
1131
|
+
Q_coords, _, time_col, keypoints_names, _ = read_trc(load_trc_px)
|
|
1132
|
+
|
|
1131
1133
|
keypoints_ids = [i for i in range(len(keypoints_names))]
|
|
1132
1134
|
keypoints_all, scores_all = load_pose_file(Q_coords)
|
|
1133
1135
|
for pre, _, node in RenderTree(pose_model):
|
|
1134
1136
|
if node.name in keypoints_names:
|
|
1135
1137
|
node.id = keypoints_names.index(node.name)
|
|
1138
|
+
if time_range:
|
|
1139
|
+
frame_range = [abs(time_col - time_range[0]).idxmin(), abs(time_col - time_range[1]).idxmin()+1]
|
|
1140
|
+
else:
|
|
1141
|
+
frame_range = [0, len(Q_coords)]
|
|
1142
|
+
frame_iterator = tqdm(range(*frame_range))
|
|
1136
1143
|
|
|
1137
1144
|
else:
|
|
1138
1145
|
# Retrieve keypoint names from model
|
|
@@ -1336,7 +1343,10 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
1336
1343
|
all_frames_scores = make_homogeneous(all_frames_scores)
|
|
1337
1344
|
|
|
1338
1345
|
frame_range = [0,frame_count] if video_file == 'webcam' else frame_range
|
|
1339
|
-
|
|
1346
|
+
if not load_trc_px:
|
|
1347
|
+
all_frames_time = pd.Series(np.linspace(frame_range[0]/fps, frame_range[1]/fps, frame_count-frame_range[0]+1), name='time')
|
|
1348
|
+
else:
|
|
1349
|
+
all_frames_time = time_col
|
|
1340
1350
|
if not multiperson:
|
|
1341
1351
|
px_to_m_from_person_id = get_personID_with_highest_scores(all_frames_scores)
|
|
1342
1352
|
detected_persons = [px_to_m_from_person_id]
|
|
@@ -1475,7 +1485,6 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
1475
1485
|
if not np.array(trc_data[i].iloc[:,1:] ==0).all():
|
|
1476
1486
|
# Automatically determine visible side
|
|
1477
1487
|
visible_side_i = visible_side[i] if len(visible_side)>i else 'auto' # set to 'auto' if list too short
|
|
1478
|
-
|
|
1479
1488
|
# Set to 'front' if slope of X values between [-5,5]
|
|
1480
1489
|
if visible_side_i == 'auto':
|
|
1481
1490
|
try:
|
|
@@ -1648,7 +1657,11 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
1648
1657
|
logging.warning('Skipping marker augmentation and inverse kinematics as to_meters was set to False.')
|
|
1649
1658
|
else:
|
|
1650
1659
|
# move all trc files containing _m_ string to pose3d_dir
|
|
1651
|
-
|
|
1660
|
+
if not load_trc_px:
|
|
1661
|
+
trc_list = output_dir.glob('*_m_*.trc')
|
|
1662
|
+
else:
|
|
1663
|
+
trc_list = [pose_path_person_m_i]
|
|
1664
|
+
for trc_file in trc_list:
|
|
1652
1665
|
if (pose3d_dir/trc_file.name).exists():
|
|
1653
1666
|
os.remove(pose3d_dir/trc_file.name)
|
|
1654
1667
|
shutil.move(trc_file, pose3d_dir)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|