sports2d 0.8.15__tar.gz → 0.8.16__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.8.15 → sports2d-0.8.16}/PKG-INFO +1 -1
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Utilities/tests.py +2 -2
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/process.py +18 -13
- {sports2d-0.8.15 → sports2d-0.8.16}/sports2d.egg-info/PKG-INFO +1 -1
- {sports2d-0.8.15 → sports2d-0.8.16}/.github/workflows/continuous-integration.yml +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/.github/workflows/joss_pdf.yml +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/.github/workflows/publish-on-release.yml +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/.gitignore +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/CITATION.cff +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/Demo_plots.png +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/Demo_results.png +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/Demo_terminal.png +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/Person_selection.png +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/Video_tuto_Sports2D_Colab.png +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/joint_convention.png +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/paper.bib +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/paper.md +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/sports2d_blender.gif +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Content/sports2d_opensim.gif +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/LICENSE +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/README.md +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Demo/Config_demo.toml +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Demo/demo.mp4 +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Sports2D.ipynb +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Sports2D.py +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Utilities/__init__.py +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Utilities/common.py +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/Utilities/filter.py +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/Sports2D/__init__.py +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/pyproject.toml +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/setup.cfg +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/sports2d.egg-info/SOURCES.txt +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/sports2d.egg-info/dependency_links.txt +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/sports2d.egg-info/entry_points.txt +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/sports2d.egg-info/requires.txt +0 -0
- {sports2d-0.8.15 → sports2d-0.8.16}/sports2d.egg-info/top_level.txt +0 -0
|
@@ -37,6 +37,7 @@ def test_workflow():
|
|
|
37
37
|
Test the workflow of Sports2D.
|
|
38
38
|
'''
|
|
39
39
|
|
|
40
|
+
from Sports2D import Sports2D
|
|
40
41
|
root_dir = os.path.dirname(os.path.abspath(__file__))
|
|
41
42
|
os.chdir(root_dir)
|
|
42
43
|
|
|
@@ -53,7 +54,6 @@ def test_workflow():
|
|
|
53
54
|
config_dict.get("base").update({"show_realtime_results":False})
|
|
54
55
|
config_dict.get("post-processing").update({"show_graphs":False})
|
|
55
56
|
|
|
56
|
-
from Sports2D import Sports2D
|
|
57
57
|
Sports2D.process(config_dict)
|
|
58
58
|
|
|
59
59
|
|
|
@@ -82,7 +82,7 @@ def test_workflow():
|
|
|
82
82
|
"--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]}"""]
|
|
83
83
|
subprocess.run(demo_cmd3, check=True, capture_output=True, text=True, encoding='utf-8')
|
|
84
84
|
|
|
85
|
-
# With a time range, inverse kinematics, marker augmentation
|
|
85
|
+
# With a time range, inverse kinematics, marker augmentation
|
|
86
86
|
demo_cmd4 = ["sports2d", "--person_ordering_method", "greatest_displacement", "--show_realtime_results", "False", "--show_graphs", "False",
|
|
87
87
|
"--time_range", "1.2", "2.7",
|
|
88
88
|
"--do_ik", "True", "--use_augmentation", "True",
|
|
@@ -1999,6 +1999,8 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
1999
1999
|
else:
|
|
2000
2000
|
visible_side_i = 'none'
|
|
2001
2001
|
new_visible_side += [visible_side_i]
|
|
2002
|
+
else:
|
|
2003
|
+
new_visible_side = visible_side.copy()
|
|
2002
2004
|
|
|
2003
2005
|
|
|
2004
2006
|
|
|
@@ -2063,7 +2065,7 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
2063
2065
|
for i, idx_person in enumerate(selected_persons):
|
|
2064
2066
|
angles_path_person = angles_output_path.parent / (angles_output_path.stem + f'_person{i:02d}.mot')
|
|
2065
2067
|
all_frames_angles_person = pd.DataFrame(all_frames_angles_homog[:,idx_person,:], columns=angle_names)
|
|
2066
|
-
|
|
2068
|
+
|
|
2067
2069
|
# Flip angles for left side when flip_left_right false
|
|
2068
2070
|
if new_visible_side[i] == 'left' and not flip_left_right:
|
|
2069
2071
|
all_frames_angles_homog[:, idx_person, :] = -all_frames_angles_homog[:, idx_person, :]
|
|
@@ -2169,19 +2171,22 @@ def process_fun(config_dict, video_file, time_range, frame_rate, result_dir):
|
|
|
2169
2171
|
new_keypoints_ids = list(range(len(new_keypoints_ids)))
|
|
2170
2172
|
|
|
2171
2173
|
# Draw pose and angles
|
|
2174
|
+
if 'first_trim' not in locals():
|
|
2175
|
+
first_trim, last_trim = 0, frame_count-1
|
|
2172
2176
|
for frame_count, (frame, valid_X, valid_X_flipped, valid_Y, valid_scores, valid_angles) in enumerate(zip(frames, all_frames_X_processed, all_frames_X_flipped_processed, all_frames_Y_processed, all_frames_scores_processed, all_frames_angles_processed)):
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2177
|
+
if frame_count >= first_trim and frame_count <= last_trim:
|
|
2178
|
+
img = frame.copy()
|
|
2179
|
+
img = draw_bounding_box(img, valid_X, valid_Y, colors=colors, fontSize=fontSize, thickness=thickness)
|
|
2180
|
+
img = draw_keypts(img, valid_X, valid_Y, valid_scores, cmap_str='RdYlGn')
|
|
2181
|
+
img = draw_skel(img, valid_X, valid_Y, pose_model_with_new_ids)
|
|
2182
|
+
if calculate_angles:
|
|
2183
|
+
img = draw_angles(img, valid_X, valid_Y, valid_angles, valid_X_flipped, new_keypoints_ids, new_keypoints_names, angle_names, display_angle_values_on=display_angle_values_on, colors=colors, fontSize=fontSize, thickness=thickness)
|
|
2184
|
+
|
|
2185
|
+
# Save video or images
|
|
2186
|
+
if save_vid:
|
|
2187
|
+
out_vid.write(img)
|
|
2188
|
+
if save_img:
|
|
2189
|
+
cv2.imwrite(str((img_output_dir / f'{output_dir_name}_{(frame_count+frame_range[0]):06d}.png')), img)
|
|
2185
2190
|
|
|
2186
2191
|
if save_vid:
|
|
2187
2192
|
out_vid.release()
|
|
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
|
|
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
|