Skip to content

Commit

Permalink
removing unused field det_conf_threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
naokiyokoyamabd committed Sep 10, 2023
1 parent e98d3d9 commit 81458ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion config/experiments/reality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ policy:
name: "RealityITMPolicyV2"
pointnav_policy_path: "data/pointnav_weights.pth"
depth_image_shape: [212, 240] # height, width
det_conf_threshold: 0.6
pointnav_stop_radius: 1.2
use_max_confidence: False
object_map_erosion_size: 5
Expand Down
9 changes: 3 additions & 6 deletions zsos/policy/base_objectnav_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __init__(
self,
pointnav_policy_path: str,
depth_image_shape: Tuple[int, int],
det_conf_threshold: float,
pointnav_stop_radius: float,
object_map_erosion_size: float,
visualize: bool = True,
Expand Down Expand Up @@ -75,7 +74,6 @@ def __init__(
erosion_size=object_map_erosion_size
)
self._depth_image_shape = tuple(depth_image_shape)
self._det_conf_threshold = det_conf_threshold
self._pointnav_stop_radius = pointnav_stop_radius
self._visualize = visualize
self._vqa_prompt = vqa_prompt
Expand Down Expand Up @@ -232,7 +230,7 @@ def _get_policy_info(self, detections: ObjectDetections) -> Dict[str, Any]:
def _get_object_detections(self, img: np.ndarray) -> ObjectDetections:
if self._target_object in COCO_CLASSES:
detections = self._coco_object_detector.predict(img)
self._det_conf_threshold = self._coco_threshold
det_conf_threshold = self._coco_threshold
else:
detections = self._object_detector.predict(img)
detections.phrases = [
Expand All @@ -243,10 +241,10 @@ def _get_object_detections(self, img: np.ndarray) -> ObjectDetections:
detections.phrases = [
p.replace("dining table", "table") for p in detections.phrases
]
self._det_conf_threshold = self._non_coco_threshold
det_conf_threshold = self._non_coco_threshold
if self._detect_target_only:
detections.filter_by_class([self._target_object])
detections.filter_by_conf(self._det_conf_threshold)
detections.filter_by_conf(det_conf_threshold)

return detections

Expand Down Expand Up @@ -395,7 +393,6 @@ class ZSOSConfig:
text_prompt: str = "Seems like there is a target_object ahead."
pointnav_policy_path: str = "data/pointnav_weights.pth"
depth_image_shape: Tuple[int, int] = (224, 224)
det_conf_threshold: float = 0.8
pointnav_stop_radius: float = 0.9
use_max_confidence: bool = False
object_map_erosion_size: int = 5
Expand Down
1 change: 0 additions & 1 deletion zsos/semexp_env/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def main():
text_prompt="Seems like there is a target_object ahead.",
pointnav_policy_path="data/pointnav_weights.pth",
depth_image_shape=(224, 224),
det_conf_threshold=0.8,
pointnav_stop_radius=0.9,
use_max_confidence=False,
object_map_erosion_size=5,
Expand Down

0 comments on commit 81458ed

Please sign in to comment.