sha2nkt / moyo_toolkit

This is a repository for download, preprocessing, visualizing, running evaluations on the MOYO dataset.
Other
59 stars 2 forks source link

No SensorMat Markers #11

Open YoloZyk opened 3 weeks ago

YoloZyk commented 3 weeks ago

Hi,

I have some issues extracting pressure mat markers using the following code in pressure_mat_utils.py,

marker_id_one = np.where(data.point_labels == 'SensorMat:M_1                  ')[0]
marker_id_two = np.where(data.point_labels == 'SensorMat:M_2                  ')[0]
marker_id_three = np.where(data.point_labels == 'SensorMat:M_3               ')[0]
marker_id_four = np.where(data.point_labels == 'SensorMat:M_4                 ')[0]
marker_ids_unordered = [marker_id_one, marker_id_two, marker_id_three, marker_id_four]

I checked the point_labels in the c3d file, and there are no markers for the sensor mat?

array(['LFHD                          ', 'RFHD                          ',
       'LBHD                          ', 'RBHD                          ',
       'C7                            ', 'T10                           ',
       'CLAV                          ', 'STRN                          ',
       'RBAK                          ', 'LSHO                          ',
       'LUPA                          ', 'LELB                          ',
       'LFRM                          ', 'LWRA                          ',
       'LWRB                          ', 'LFIN                          ',
       'RSHO                          ', 'RUPA                          ',
       'RELB                          ', 'RFRM                          ',
       'RWRA                          ', 'RWRB                          ',
       'RFIN                          ', 'LASI                          ',
       'RASI                          ', 'LPSI                          ',
       'RPSI                          ', 'LTHI                          ',
       'LKNE                          ', 'LTIB                          ',
       'LANK                          ', 'LHEE                          ',
       'LTOE                          ', 'RTHI                          ',
       'RKNE                          ', 'RTIB                          ',
       'RANK                          ', 'RHEE                          ',
       'RTOE                          ', 'PELO                          ',
       'PELA                          ', 'PELL                          ',
       'PELP                          ', 'LFEO                          ',
       'LFEA                          ', 'LFEL                          ',
       'LFEP                          ', 'LTIO                          ',
       'LTIA                          ', 'LTIL                          ',
       'LTIP                          ', 'LFOO                          ',
       'LFOA                          ', 'LFOL                          ',
       'LFOP                          ', 'LTOO                          ',
       'LTOA                          ', 'LTOL                          ',
       'LTOP                          ', 'RFEO                          ',
       'RFEA                          ', 'RFEL                          ',
       'RFEP                          ', 'RTIO                          ',
       'RTIA                          ', 'RTIL                          ',
       'RTIP                          ', 'RFOO                          ',
       'RFOA                          ', 'RFOL                          ',
       'RFOP                          ', 'RTOO                          ',
       'RTOA                          ', 'RTOL                          ',
       'RTOP                          ', 'HEDO                          ',
       'HEDA                          ', 'HEDL                          ',
       'HEDP                          ', 'LCLO                          ',
       'LCLA                          ', 'LCLL                          ',
       'LCLP                          ', 'RCLO                          ',
       'RCLA                          ', 'RCLL                          ',
       'RCLP                          ', 'TRXO                          ',
       'TRXA                          ', 'TRXL                          ',
       'TRXP                          ', 'LHUO                          ',
       'LHUA                          ', 'LHUL                          ',
       'LHUP                          ', 'LRAO                          ',
       'LRAA                          ', 'LRAL                          ',
       'LRAP                          ', 'LHNO                          ',
       'LHNA                          ', 'LHNL                          ',
       'LHNP                          ', 'RHUO                          ',
       'RHUA                          ', 'RHUL                          ',
       'RHUP                          ', 'RRAO                          ',
       'RRAA                          ', 'RRAL                          ',
       'RRAP                          ', 'RHNO                          ',
       'RHNA                          ', 'RHNL                          ',
       'RHNP                          ', '*115                          ',
       '*116                          ', '*117                          ',
       '*118                          ', '*119                          ',
       '*120                          ', '*121                          ',
       '*122                          ', '*123                          ',
       '*124                          ', '*125                          ',
       'LHipAngles                    ', 'LKneeAngles                   ',
       'LAbsAnkleAngle                ', 'LAnkleAngles                  ',
       'RHipAngles                    ', 'RKneeAngles                   ',
       'RAnkleAngles                  ', 'RAbsAnkleAngle                ',
       'LPelvisAngles                 ', 'RPelvisAngles                 ',
       'LFootProgressAngles           ', 'RFootProgressAngles           ',
       'RNeckAngles                   ', 'LNeckAngles                   ',
       'RSpineAngles                  ', 'LSpineAngles                  ',
       'LShoulderAngles               ', 'LElbowAngles                  ',
       'LWristAngles                  ', 'RShoulderAngles               ',
       'RElbowAngles                  ', 'RWristAngles                  ',
       'LWaistMoment                  ', 'RWaistMoment                  ',
       'LNeckMoment                   ', 'RNeckMoment                   ',
       'LShoulderMoment               ', 'RShoulderMoment               ',
       'LElbowMoment                  ', 'RElbowMoment                  ',
       'LWristMoment                  ', 'RWristMoment                  ',
       'CentreOfMass                  ', 'CentreOfMassFloor             '],
      dtype=object)
sha2nkt commented 1 week ago

Hi,

Just want to confirm if you are using the correct c3d: In the released pressure folder, we have two c3ds, and I recommend using the pressure_mat_c3d.

image

You can also refer to this line where we initialize the PressureMat() object correctly

YoloZyk commented 6 days ago

Yeah, I am sure I used the pressure_mat_c3d file you mentioned, but it does contain only the fields I listed above. I also checked other c3d files, including the dataset in 20220923_20220926_with_hands, and got the same result. Here is a snippet of my script to initialize PressureMat(), which may help to prove that I am using it correctly.

csv_path = '../data/moyo/20221004_with_com/pressure/train/single_csv/'
xml_path = '../data/moyo/20221004_with_com/pressure/train/xml/'
c3d_path = '../data/moyo/20221004_with_com/pressure/train/pressure_mat_c3d/'

def check_pressure_util(csv, xml, c3d, index=666):
    pm = PressureMat(csv, xml, c3d)
        gt_pressures = pm.gt_pressures
    gt_heatmaps = pm.gt_heatmaps
        ...

if __name__ == '__main__':
        ...
        check_pressure_util(csv_path + filename + '.csv', xml_path + filename + '.xml', c3d_path + filename + '.c3d', index=index)