Skip to content
Snippets Groups Projects
Commit 14ddac72 authored by Cribellier, Antoine's avatar Cribellier, Antoine
Browse files

Some small debugging and text corrections

parent 1f77e1ef
No related branches found
No related tags found
1 merge request!10Major development of the various modules + many bugs were solved
......@@ -10,10 +10,8 @@ start = time.time()
xyz_path = os.path.join(os.getcwd(),
'data/examples/mosquito_escapes/calib/to_delete/xyz_calibration_device_small.csv')
#xy_path = os.path.join(os.getcwd(), 'data/calib/20200615_xypts-rot.csv')
xy_path = os.path.join(os.getcwd(),
'data/examples/mosquito_escapes/calib/to_delete/20200615_xypts.csv')
dlt_path = os.path.join(os.getcwd(),
'data/examples/mosquito_escapes/calib/to_delete/20200615_DLTcoefs-py.csv')
xy_path = os.path.join(os.getcwd(), 'data/examples/mosquito_escapes/calib/to_delete/20200615_xypts.csv')
dlt_path = os.path.join(os.getcwd(), 'data/examples/mosquito_escapes/calib/to_delete/20200615_DLTcoefs-py.csv')
dlc_cfg_path = '/home/user/Desktop/Antoine/_DLC/config.yaml'
img_size = (896, 896)
......
......@@ -624,9 +624,6 @@ class BatchProcessing:
show_plot:
"""
# TODO check parameter needed for fit_skeleton
# csv_path=csv_wings_geo_path, body_param_names=body_param_names, wing_param_names=wing_param_names,
kwargs['animal_name'] = animal_name
kwargs['model_name'] = model_name
kwargs['res_method'], kwargs['opt_method'] = res_method, opt_method
......
......@@ -403,7 +403,7 @@ def save_stroboscopic_images(image_sequence: MultiImageSequence, frames: List[in
# 'y': np.nan * np.ones(np.size(skeleton2d[obj_name]['frames'])),
# 'z': np.nan * np.ones(np.size(skeleton2d[obj_name]['frames']))}
#
# # Compute angles btw the right and left wing/bodyparts
# # Compute angles btw the right and left limb/bodyparts
# angles, angles_out, mean_angles = {}, {}, {}
# for i, camn in enumerate(range(1, nb_cam + 1)):
# angles[camn], angles_out[camn] = {}, {}
......@@ -448,7 +448,7 @@ def save_stroboscopic_images(image_sequence: MultiImageSequence, frames: List[in
#
# if show_plot:
# fig1, axs1 = plt.subplots(nb_cam, 1)
# fig1.suptitle('Angle of the line btw right and left wing part - Before unscrambling')
# fig1.suptitle('Angle of the line btw right and left limb part - Before unscrambling')
# for i, camn in enumerate(range(1, nb_cam + 1)):
# axs1[i].clear()
# for label_right in label_names_right:
......@@ -637,7 +637,7 @@ def save_stroboscopic_images(image_sequence: MultiImageSequence, frames: List[in
#
# if show_plot:
# fig2, axs2 = plt.subplots(nb_cam, 1)
# fig2.suptitle('Angle of the line btw right and left wing part - After unscrambling')
# fig2.suptitle('Angle of the line btw right and left limb part - After unscrambling')
# for i, camn in enumerate(range(1, nb_cam + 1)):
# axs2[i].clear()
# for label_right in label_names_right:
......
This diff is collapsed.
......@@ -238,8 +238,9 @@ def estimate_params_from_skeleton3d(wing_skeleton3d_world: Dict[str, List[float]
r_world2stroke = Rotation.from_euler('xyz', [- body_params['roll_a'], - body_params['pitch_a'], - body_params['yaw_a']], degrees=True)
for label in wing_skeleton_stroke.keys():
wing_skeleton_stroke[label] = r_world2stroke.inv().apply(wing_skeleton_stroke[label])
wing_skeleton_stroke[label] = r_stroke2body.inv().apply(wing_skeleton_stroke[label])
if not any(np.isnan(wing_skeleton_stroke[label])):
wing_skeleton_stroke[label] = r_world2stroke.inv().apply(wing_skeleton_stroke[label])
wing_skeleton_stroke[label] = r_stroke2body.inv().apply(wing_skeleton_stroke[label])
# Vectors along the span and chord
span_v = wing_skeleton_stroke['tip'] - wing_skeleton_stroke['hinge']
......
......@@ -79,26 +79,26 @@ def distance_btw_pts(pt1, pt2):
return length_from_vector(pt2 - pt1)
def load_body_params_from_csv(path, labels):
def load_body_params_from_csv(path, param_names):
body_params = {}
params_csv = np.genfromtxt(path, delimiter=',', skip_header=0, names=True)
for body_param_name in labels:
for body_param_name in param_names:
body_params[body_param_name] = params_csv[body_param_name]
return body_params
def load_limbs_params_from_csv(path, body_labels, limb_labels):
def load_limbs_params_from_csv(path, body_param_names, limb_labels):
limbs_params = {}
params_csv = np.genfromtxt(path, delimiter=',', skip_header=0, names=True)
for side in ['right', 'left']:
limbs_params[side] = {}
for wing_param_name in limb_labels:
if wing_param_name in body_labels:
limbs_params[side][wing_param_name] = params_csv[wing_param_name]
for limb_param_name in limb_labels:
if limb_param_name in body_param_names:
limbs_params[side][limb_param_name] = params_csv[limb_param_name]
else:
limbs_params[side][wing_param_name] = params_csv[wing_param_name + '_' + side]
limbs_params[side][limb_param_name] = params_csv[limb_param_name + '_' + side]
return limbs_params
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment