b2fe4f7ba3
Edits from @hunminkim98's awesome work at integrating pose estimation into Pose2Sim with RTMLib. Most of the changes in syntax are not necessarily better, it is mostly for the code to be more consistent with the rest of the library. Thank you again for your fantastic work! General: - Automatically detects whether a valid CUDA install is available. If so, use the GPU with the ONNXRuntime backend. Otherwise, use the CPU with the OpenVINO backend - The tensorflow version used for marker augmentation was incompatible with the cuda torch installation for pose estimation: edited code and models for it to work with the latest tf version. - Added logging information to pose estimation - Readme.md: provided an installation procedure for CUDA (took me a while to find something simple and robust) - Readme.md: added information about PoseEstimation with RTMLib - added poseEstimation to tests.py - created videos for the multi-person case (used to only have json, no video), and reorganized Demo folders. Had to recreate calibration file as well Json files: - the json files only saved one person, I made it save all the detected ones - tracking was not taken into account by rtmlib, which caused issues in synchronization: fixed, waiting for merge - took the save_to_openpose function out from the main function - minified the json files (they take less space when all spaces are removed) Detection results: - Compared the triangulated locations of RTMpose keypoints to the ones of OpenPose to potentially edit model marker locations on OpenSim. Did not seem to need it. Others in Config.toml: - removed the "to_openpose" option, which is not needed - added the flag: save_video = 'to_images' # 'to_video' or 'to_images' or ['to_video', 'to_images'] - changed the way frame_range was handled (made me change synchronization in depth, as well as personAssociation and triangulation) - added the flag: time_range_around_maxspeed in synchronization - automatically detect framerate from video, or set to 60 fps if we work from images (or give a value) - frame_range -> time_range - moved height and weight to project (only read for markerAugmentation, and in the future for automatic scaling) - removed reorder_trc from triangulation and Config -> call it for markerAugmentation instead Others: - Provided an installation procedure for OpenSim (for the future) and made continuous installation check its install (a bit harder since it cannot be installed via pip) - scaling from motion instead of static pose (will have to study whether it's as good or not) - added logging to synchronization - Struggled quite a bit with continuous integration * Starting point of integrating RTMPose into Pose2Sim. (#111) * RTM_to_Open Convert format from RTMPose to OpenPose * rtm_intergrated * rtm_integrated * rtm_integrated * rtm_integrated * rtm * Delete build/lib/Pose2Sim directory * rtm * Delete build/lib/Pose2Sim directory * Delete onnxruntime-gpu * device = cpu * add pose folder * Update tests.py * added annotation * fix typo * Should work be still lots of tests to run. Detailed commit coming soon * intermediary commit * last checks before v0.9.0 * Update continuous-integration.yml * Update tests.py * replaced tabs with spaces * unittest issue * unittest typo * deactivated display for CI test of pose detection * Try to make continuous integration work * a * b * c * d * e * f * g * h * i * j * k * l --------- Co-authored-by: HunMinKim <144449115+hunminkim98@users.noreply.github.com>
126 lines
7.5 KiB
XML
126 lines
7.5 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<OpenSimDocument Version="40000">
|
|
<InverseKinematicsTool>
|
|
<!--Name of the directory where results are written. Be default this is the directory in which the setup file is be executed.-->
|
|
<results_directory>./</results_directory>
|
|
<!--Name/path to the xml .osim file.-->
|
|
<model_file>../S00_Demo_Session/S00_P00_SingleParticipant/S00_P00_OpenSim/Model_Pose2Sim_S00_P00_coco_scaled.osim</model_file>
|
|
<!--The relative weighting of kinematic constraint errors. By default this is Infinity, which means constraints are strictly enforced as part of the optimization and are not appended to the objective (cost) function. Any other non-zero positive scalar is the penalty factor for constraint violations.-->
|
|
<constraint_weight>Inf</constraint_weight>
|
|
<!--The accuracy of the solution in absolute terms, i.e. the number of significant digits to which the solution can be trusted. Default 1e-5.-->
|
|
<accuracy>1.0000000000000001e-05</accuracy>
|
|
<!--The time range for the study.-->
|
|
<time_range>0.016666666666666666 1.6666666666666667</time_range>
|
|
<!--Name of the resulting inverse kinematics motion (.mot) file.-->
|
|
<output_motion_file>../S00_Demo_Session/S00_P00_SingleParticipant/S00_P00_OpenSim/S00_P00_T01_BalancingTrial_filt_butterworth_0-100_coco.mot</output_motion_file>
|
|
<!--Flag (true or false) indicating whether or not to report errors from the inverse kinematics solution. Default is true.-->
|
|
<report_errors>true</report_errors>
|
|
<!--Markers and coordinates to be considered (tasks) and their weightings. The sum of weighted-squared task errors composes the cost function.-->
|
|
<IKTaskSet>
|
|
<objects>
|
|
<IKMarkerTask name="Nose">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>0.10000000000000001</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="Neck">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>0.20000000000000001</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="LShoulder">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>2</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="RShoulder">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>2</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="LElbow">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="RElbow">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="LWrist">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="RWrist">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="LHip">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>2</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="RHip">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>2</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="LKnee">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="RKnee">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="LAnkle">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKMarkerTask name="RAnkle">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
</IKMarkerTask>
|
|
<IKCoordinateTask name="L5_S1_Flex_Ext">
|
|
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
|
|
<apply>true</apply>
|
|
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
|
|
<weight>1</weight>
|
|
<!--Indicates the source of the coordinate value for this task. Possible values are default_value (use default value of coordinate, as specified in the model file, as the fixed target value), manual_value (use the value specified in the value property of this task as the fixed target value), or from_file (use the coordinate values from the coordinate data specified by the coordinates_file property).-->
|
|
<value_type>default_value</value_type>
|
|
<!--This value will be used as the desired (or prescribed) coordinate value if value_type is set to manual_value.-->
|
|
<value>0</value>
|
|
</IKCoordinateTask>
|
|
</objects>
|
|
<groups />
|
|
</IKTaskSet>
|
|
<!--TRC file (.trc) containing the time history of observations of marker positions obtained during a motion capture experiment. Markers in this file that have a corresponding task and model marker are included.-->
|
|
<marker_file>../S00_Demo_Session/S00_P00_SingleParticipant/S00_P00_T01_BalancingTrial/pose-3d/S00_P00_T01_BalancingTrial_0-100_filt_butterworth.trc</marker_file>
|
|
<!--The name of the storage (.sto or .mot) file containing the time history of coordinate observations. Coordinate values from this file are included if there is a corresponding model coordinate and task. -->
|
|
<coordinate_file>Unassigned</coordinate_file>
|
|
<!--Flag indicating whether or not to report model marker locations. Note, model marker locations are expressed in Ground.-->
|
|
<report_marker_locations>false</report_marker_locations>
|
|
</InverseKinematicsTool>
|
|
</OpenSimDocument>
|