(gt_dict, normalization_dict)
| 64 | return strands_data |
| 65 | |
| 66 | def normalize_gt_data(gt_dict, normalization_dict): |
| 67 | # mean=normalization_dict["xyz_mean"] |
| 68 | # std=normalization_dict["xyz_std"] |
| 69 | # strands_data=normalize_data(strands_data, mean, std) |
| 70 | |
| 71 | gt_dict_out = {} |
| 72 | |
| 73 | gt_strand_positions=normalize_data_3D(gt_dict["strand_positions"], normalization_dict["xyz_mean"], normalization_dict["xyz_std"]) |
| 74 | gt_dict_out["strand_positions"]=gt_strand_positions |
| 75 | |
| 76 | gt_strand_dirs=normalize_data_3D(gt_dict["strand_directions"], normalization_dict["dir_mean"], normalization_dict["dir_std"]) |
| 77 | gt_dict_out["strand_directions"]=gt_strand_dirs |
| 78 | |
| 79 | # gt_strand_curv=normalize_data_3D(gt_dict["strand_curvatures"], normalization_dict["curv_mean"], normalization_dict["curv_std"]) |
| 80 | # gt_dict_out["strand_curvatures"]=gt_strand_curv |
| 81 | |
| 82 | if "stft_directions" in gt_dict: |
| 83 | gt_stft_dirs=normalize_data_3D(gt_dict["stft_directions"], |
| 84 | normalization_dict["stft_64_32_64_mean_across_freq"], |
| 85 | normalization_dict["stft_64_32_64_std_across_freq"]) |
| 86 | gt_dict_out["stft_directions"]=gt_stft_dirs |
| 87 | |
| 88 | if "fft_directions" in gt_dict: |
| 89 | print("before normalization",gt_dict["fft_directions"].mean()) |
| 90 | gt_fft_dirs=normalize_data_2D(gt_dict["fft_directions"], |
| 91 | normalization_dict["fft_mean"], |
| 92 | normalization_dict["fft_std"]) |
| 93 | |
| 94 | # gt_fft_dirs=gt_dict["fft_directions"] |
| 95 | print("after normalization",gt_fft_dirs.mean()) |
| 96 | gt_dict_out["fft_directions"]=gt_fft_dirs |
| 97 | |
| 98 | # gt_dict_out["fft_directions"]=gt_dict["fft_directions"] |
| 99 | |
| 100 | return gt_dict_out |
| 101 | |
| 102 | def align_pred_with_gt(pred_dict, normalization_dict): |
| 103 | #the positions (originating from integration of directions) from the codec start at 0 but we need to shift this by the amount that normalize_gt_data shifts the origin |
no test coverage detected