solve incompatibility with lates pandas versions

This commit is contained in:
davidpagnon 2023-04-06 13:36:14 +02:00
parent 2e995e0b1a
commit 26797d9bfa
10 changed files with 49 additions and 10 deletions

View File

@ -50,7 +50,7 @@ likelihood_threshold = 0.3
min_cameras_for_triangulation = 2
interpolation = 'cubic' #linear, slinear, quadratic, cubic, or none
# 'none' if you don't want to interpolate missing points
show_interp_indices = false # true or false (lowercase). For each keypoint, return the frames that need to be interpolated
show_interp_indices = true # true or false (lowercase). For each keypoint, return the frames that need to be interpolated
[3d-filtering]
type = 'butterworth' # butterworth, butterworth_on_speed, gaussian, LOESS, median.

View File

@ -0,0 +1,39 @@
[cam_1]
name = "cam01"
size = [ 1087.0, 1919.0]
matrix = [ [ 1681.244873046875, 0.0, 532.97369384375], [ 0.0, 1681.075439453125, 948.137390140625], [ 0.0, 0.0, 1.0]]
distortions = [ -0.000721609375, 0.002187234375, 9.5e-06, 1.078125e-05]
rotation = [ 1.6882754799999993, 1.0483220499999997, -0.41955852000000016]
translation = [ 0.3211048899999996, 0.9563320600000009, 2.8907130499999996]
fisheye = false
[cam_2]
name = "cam02"
size = [ 1087.0, 1919.0]
matrix = [ [ 1673.729614265625, 0.0, 534.494567875], [ 0.0, 1673.79724121875, 963.225891109375], [ 0.0, 0.0, 1.0]]
distortions = [ -0.000747609375, 0.00213728125, 1.51875e-05, 4.546875e-06]
rotation = [ 1.34975875, 1.5963809099999993, -1.1983285799999999]
translation = [ -0.1115282900000002, 0.7766184800000001, 3.0675519599999994]
fisheye = false
[cam_3]
name = "cam03"
size = [ 1087.0, 1919.0]
matrix = [ [ 1681.598388671875, 0.0, 513.20837403125], [ 0.0, 1681.509887703125, 955.005126953125], [ 0.0, 0.0, 1.0]]
distortions = [ -0.000729765625, 0.00215034375, -8.46875e-06, -8.078125e-06]
rotation = [ 0.8109654899999995, -2.1972129299999996, 1.3760277799999996]
translation = [ -0.7934803899999995, 0.32283594000000126, 4.353514870000001]
fisheye = false
[cam_4]
name = "cam04"
size = [ 1087.0, 1919.0]
matrix = [ [ 1675.234985359375, 0.0, 540.106201171875], [ 0.0, 1675.204223640625, 964.0302734375], [ 0.0, 0.0, 1.0]]
distortions = [ -0.000744265625, 0.002104171875, 4.328125e-06, 3.109375e-06]
rotation = [ 1.4045571699999995, -1.3887412699999993, 0.42535743000000026]
translation = [ 0.5030217200000006, 0.04894934000000085, 4.406564460000002]
fisheye = false
[metadata]
adjusted = false
error = 0.0

View File

@ -77,7 +77,7 @@ def save_to_csv_or_h5(kpt_list, output_folder, video_name, to_csv, to_h5):
if to_csv:
csv_file = os.path.join(output_folder, video_name+'.csv')
df.to_csv(csv_file, sep=',', index=True, line_terminator='\n')
df.to_csv(csv_file, sep=',', index=True, lineterminator='\n')
if to_h5:
h5_file = os.path.join(output_folder, video_name+'.h5')

View File

@ -73,7 +73,7 @@ def trc_Zup_to_Yup_func(*args):
[trc_o.write(line) for line in header]
Q_Yup.insert(0, 'Frame#', frames_col)
Q_Yup.insert(1, 'Time', time_col)
Q_Yup.to_csv(trc_o, sep='\t', index=False, header=None, line_terminator='\n')
Q_Yup.to_csv(trc_o, sep='\t', index=False, header=None, lineterminator='\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser()

View File

@ -121,7 +121,7 @@ def trc_from_header_data(Header, Data, combined_path):
with open(combined_path, 'w') as trc_o:
trc_o.write(header_trc+'\n')
Data.to_csv(trc_o, sep='\t', index=False, header=None, line_terminator='\n')
Data.to_csv(trc_o, sep='\t', index=False, header=None, lineterminator='\n')
def trc_combine_func(*args):

View File

@ -74,7 +74,7 @@ def trc_desample_func(*args):
# write trc
with open(trc_desampled_path, 'w') as trc_o:
[trc_o.write(line) for line in header]
Q.to_csv(trc_o, sep='\t', index=False, header=None, line_terminator='\n')
Q.to_csv(trc_o, sep='\t', index=False, header=None, lineterminator='\n')
if __name__ == '__main__':

View File

@ -340,7 +340,7 @@ def trc_filter_func(**args):
[trc_o.write(line) for line in header]
Q_filt.insert(0, 'Frame#', frames_col)
Q_filt.insert(1, 'Time', time_col)
Q_filt.to_csv(trc_o, sep='\t', index=False, header=None, line_terminator='\n')
Q_filt.to_csv(trc_o, sep='\t', index=False, header=None, lineterminator='\n')
if __name__ == '__main__':

View File

@ -326,7 +326,7 @@ def filter_all(config):
[trc_o.write(line) for line in header]
Q_filt.insert(0, 'Frame#', frames_col)
Q_filt.insert(1, 'Time', time_col)
Q_filt.to_csv(trc_o, sep='\t', index=False, header=None, line_terminator='\n')
Q_filt.to_csv(trc_o, sep='\t', index=False, header=None, lineterminator='\n')
# Recap
recap_filter3d(config, trc_path_out)

View File

@ -154,7 +154,7 @@ def make_trc(config, Q, keypoints_names, f_range):
trc_path = os.path.join(pose3d_dir, trc_f)
with open(trc_path, 'w') as trc_o:
[trc_o.write(line+'\n') for line in header_trc]
Q.to_csv(trc_o, sep='\t', index=True, header=None, line_terminator='\n')
Q.to_csv(trc_o, sep='\t', index=True, header=None, lineterminator='\n')
return trc_path

View File

@ -1,6 +1,6 @@
[metadata]
name = pose2sim
version = 0.3.4
version = 0.3.5
author = David Pagnon
author_email = contact@david-pagnon.com
description = Perform a markerless kinematic analysis from multiple calibrated views as a unified workflow from an OpenPose input to an OpenSim result.
@ -39,7 +39,7 @@ install_requires =
PyQt5
tqdm
anytree
pandas
pandas>=1.5
scipy
statsmodels
c3d