From 421179ef60801a808c6183856439e0930af3f7a2 Mon Sep 17 00:00:00 2001 From: NishanthJKumar Date: Tue, 25 Jul 2023 16:50:19 -0400 Subject: [PATCH] actually fix checks --- predicators/spot_utils/perception_utils.py | 2 +- predicators/spot_utils/spot_utils.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/predicators/spot_utils/perception_utils.py b/predicators/spot_utils/perception_utils.py index d7ff43e68f..b86bb18989 100644 --- a/predicators/spot_utils/perception_utils.py +++ b/predicators/spot_utils/perception_utils.py @@ -151,7 +151,7 @@ def query_detic_sam(image_in: np.ndarray, classes: List[str], # necessary in the future. for obj_class in classes: class_mask = (d['classes'] == obj_class) - if np.all(class_mask is False): + if np.all(class_mask == False): # pylint:disable=singleton-comparison continue max_score = np.max(d['scores'][class_mask]) max_score_idx = np.where(d['scores'] == max_score)[0] diff --git a/predicators/spot_utils/spot_utils.py b/predicators/spot_utils/spot_utils.py index 624da269ed..a6d959133d 100644 --- a/predicators/spot_utils/spot_utils.py +++ b/predicators/spot_utils/spot_utils.py @@ -334,9 +334,8 @@ def get_objects_in_view_by_camera( ) # Next, convert the keys of this dictionary to be april # tag id's instead. - viewable_obj_poses: Dict[int, - Tuple[float, float, - float]] = {} # type: ignore + viewable_obj_poses: Dict[int, # type: ignore + Tuple[float, float, float]] = {} for k, v in sam_pose_results.items(): viewable_obj_poses[obj_name_to_apriltag_id[ vision_prompt_to_obj_name[k]]] = v