-
Notifications
You must be signed in to change notification settings - Fork 1
/
mproc_cli.py
51 lines (42 loc) · 1.88 KB
/
mproc_cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import fire
import registration
import normalisation
import augmentation
def fire_no_out_print(component=None, command=None, name=None, serialize=None):
try:
fire.Fire(component, command, name, serialize)
except ModuleNotFoundError as error_msg:
if "open3d" in str(error_msg):
# Fire tries to Print the trimesh result. Apparently this requires
# additional libraries (i.e. open3d). Since the error is raised
# only using the CLI and it does not affect the correct execution of
# the code, the known error is detected and ignored.
pass
else:
print(f"something went wrong wile fire was running the code"
f"the following error has been reported: {str(error_msg)}")
if __name__ == "__main__":
registration_dict = {
"procrustes_landmark_registration":
registration.ProcrustesLandmarkRegisterer,
"inertia_axes_and_icp_registration":
registration.InertiaAxesAndIcpRegisterer,
"procrustes_landmark_and_icp_registration":
registration.ProcrustesLandmarkAndIcpRegisterer,
"procrustes_landmark_and_nicp_registration":
registration.ProcrustesLandmarkAndNicpRegisterer,
}
normalisation_dict = {
"normalisation": normalisation.Normaliser,
"normalization": normalisation.Normaliser,
"encryption": normalisation.Normaliser
} # expose the same class with different names
augmentation_dict = {
"random_linear_interpolation": augmentation.RandomLinearInterpolation,
"random_spectral_interpolation":
augmentation.RandomSpectralInterpolation,
"random_spectral_perturbation": augmentation.RandomSpectralPerturbation
}
fire_no_out_print({**registration_dict,
**normalisation_dict,
**augmentation_dict})