Skip to content

Commit 467531d

Browse files
committed
fix(pose_estimators): Make it possible to only load a single pose estimation submodule
Catches ModuleNotFoundError if any given pose estimator submodule is not present.
1 parent 08e9c09 commit 467531d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

gisnav/pose_estimators/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@
1010
"""
1111
from .pose_estimator import PoseEstimator
1212
from .keypoint_pose_estimator import KeypointPoseEstimator
13-
from .superglue_pose_estimator import SuperGluePoseEstimator
14-
from .loftr_pose_estimator import LoFTRPoseEstimator
13+
try:
14+
from .superglue_pose_estimator import SuperGluePoseEstimator
15+
except ModuleNotFoundError as e:
16+
# Submodule not loaded
17+
pass
18+
try:
19+
from .loftr_pose_estimator import LoFTRPoseEstimator
20+
except ModuleNotFoundError as e:
21+
# Submodule not loaded
22+
pass

0 commit comments

Comments
 (0)