MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / normalize_gt_data

Function normalize_gt_data

models/strand_codec.py:66–100  ·  view source on GitHub ↗
(gt_dict, normalization_dict)

Source from the content-addressed store, hash-verified

64 return strands_data
65
66def 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
102def 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

Callers 2

generate_scalp_texturesFunction · 0.90
forwardMethod · 0.85

Calls 2

normalize_data_3DFunction · 0.85
normalize_data_2DFunction · 0.85

Tested by

no test coverage detected