diff --git a/config/experiments/reality.yaml b/config/experiments/reality.yaml index 236a26a..b4aa30b 100644 --- a/config/experiments/reality.yaml +++ b/config/experiments/reality.yaml @@ -1,6 +1,7 @@ +# @package _global_ + # Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved. -# @package _global_ defaults: - /policy: zsos_config_base - _self_ diff --git a/config/experiments/ver_pointnav.yaml b/config/experiments/ver_pointnav.yaml index 4dec75b..0baf173 100644 --- a/config/experiments/ver_pointnav.yaml +++ b/config/experiments/ver_pointnav.yaml @@ -1,7 +1,7 @@ -# Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved. - # @package _global_ +# Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved. + defaults: - /tasks: pointnav_depth_hm3d - /habitat_baselines: habitat_baselines_rl_config_base diff --git a/config/experiments/vlfm_objectnav_hm3d.yaml b/config/experiments/vlfm_objectnav_hm3d.yaml index a94b4e2..ee242a6 100644 --- a/config/experiments/vlfm_objectnav_hm3d.yaml +++ b/config/experiments/vlfm_objectnav_hm3d.yaml @@ -1,7 +1,7 @@ -# Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved. - # @package _global_ +# Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved. + defaults: - /habitat_baselines: habitat_baselines_rl_config_base - /benchmark/nav/objectnav: objectnav_hm3d diff --git a/vlfm/policy/base_objectnav_policy.py b/vlfm/policy/base_objectnav_policy.py index abc73c8..f11ded7 100644 --- a/vlfm/policy/base_objectnav_policy.py +++ b/vlfm/policy/base_objectnav_policy.py @@ -350,7 +350,8 @@ def _update_object_map( # If we are using vqa, then use the BLIP2 model to visually confirm whether # the contours are actually correct. - if (self._use_vqa is not None) and self._use_vqa: + + if self._use_vqa: contours, _ = cv2.findContours( object_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE ) diff --git a/vlfm/vlm/grounding_dino.py b/vlfm/vlm/grounding_dino.py index 25808e4..cd29b8f 100644 --- a/vlfm/vlm/grounding_dino.py +++ b/vlfm/vlm/grounding_dino.py @@ -39,7 +39,9 @@ def __init__( self.box_threshold = box_threshold self.text_threshold = text_threshold - def predict(self, image: np.ndarray, caption: str = "") -> ObjectDetections: + def predict( + self, image: np.ndarray, caption: Optional[str] = None + ) -> ObjectDetections: """ This function makes predictions on an input image tensor or numpy array using a pretrained model. @@ -58,7 +60,7 @@ def predict(self, image: np.ndarray, caption: str = "") -> ObjectDetections: image_transformed = F.normalize( image_tensor, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225] ) - if caption == "": + if caption is None: caption_to_use = self.caption else: caption_to_use = caption