Skip to content

Commit

Permalink
final renaming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
naokiyokoyama committed Dec 6, 2023
1 parent e88f45f commit 456ccef
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ pip install -e .[reality]
```
Install all the dependencies:
```bash
git clone git@github.com:WongKinYiu/yolov7.git # if using YOLOv7
git clone git@github.com:IDEA-Research/GroundingDINO.git
git clone git@github.com:WongKinYiu/yolov7.git # if using YOLOv7
```
Follow the install directions for GroundingDINO. Nothing needs to be done for YOLOv7, but it needs to be cloned into the repo.
Follow the original install directions for GroundingDINO, which can be found here: https://github.com/IDEA-Research/GroundingDINO.

Nothing needs to be done for YOLOv7, but it needs to be cloned into the repo.

### Installing GroundingDINO (Only if using conda-installed CUDA)
Only attempt if the installation instructions in the GroundingDINO repo do not work.
Expand Down
2 changes: 1 addition & 1 deletion config/experiments/reality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2023 Boston Dynamics AI Institute LLC. All rights reserved.

defaults:
- /policy: zsos_config_base
- /policy: vlfm_config_base
- _self_

policy:
Expand Down
2 changes: 1 addition & 1 deletion config/experiments/vlfm_objectnav_hm3d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults:
- /habitat/task/measurements:
- frontier_exploration_map
- traveled_stairs
- /habitat_baselines/rl/policy: zsos_policy
- /habitat_baselines/rl/policy: vlfm_policy
- _self_

habitat:
Expand Down
8 changes: 4 additions & 4 deletions vlfm/policy/base_objectnav_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _infer_depth(


@dataclass
class ZSOSConfig:
class VLFMConfig:
name: str = "HabitatITMPolicy"
text_prompt: str = "Seems like there is a target_object ahead."
pointnav_policy_path: str = "data/pointnav_weights.pth"
Expand All @@ -421,16 +421,16 @@ class ZSOSConfig:
hole_area_thresh: int = 100000
use_vqa: bool = False
vqa_prompt: str = "Is this "
coco_threshold: float = 0.6
coco_threshold: float = 0.8
non_coco_threshold: float = 0.4
agent_radius: float = 0.18

@classmethod # type: ignore
@property
def kwaarg_names(cls) -> List[str]:
# This returns all the fields listed above, except the name field
return [f.name for f in fields(ZSOSConfig) if f.name != "name"]
return [f.name for f in fields(VLFMConfig) if f.name != "name"]


cs = ConfigStore.instance()
cs.store(group="policy", name="zsos_config_base", node=ZSOSConfig())
cs.store(group="policy", name="vlfm_config_base", node=VLFMConfig())
10 changes: 5 additions & 5 deletions vlfm/policy/habitat_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from vlfm.vlm.grounding_dino import ObjectDetections

from ..mapping.obstacle_map import ObstacleMap
from .base_objectnav_policy import BaseObjectNavPolicy, ZSOSConfig
from .base_objectnav_policy import BaseObjectNavPolicy, VLFMConfig
from .itm_policy import ITMPolicy, ITMPolicyV2, ITMPolicyV3

HM3D_ID_TO_NAME = ["chair", "bed", "potted plant", "toilet", "tv", "couch"]
Expand Down Expand Up @@ -95,9 +95,9 @@ def __init__(
def from_config(
cls, config: DictConfig, *args_unused: Any, **kwargs_unused: Any
) -> "HabitatMixin":
policy_config: ZSOSPolicyConfig = config.habitat_baselines.rl.policy
policy_config: VLFMPolicyConfig = config.habitat_baselines.rl.policy
kwargs = {
k: policy_config[k] for k in ZSOSPolicyConfig.kwaarg_names # type: ignore
k: policy_config[k] for k in VLFMPolicyConfig.kwaarg_names # type: ignore
}

# In habitat, we need the height of the camera to generate the camera transform
Expand Down Expand Up @@ -287,9 +287,9 @@ class HabitatITMPolicyV3(HabitatMixin, ITMPolicyV3):


@dataclass
class ZSOSPolicyConfig(ZSOSConfig, PolicyConfig):
class VLFMPolicyConfig(VLFMConfig, PolicyConfig):
pass


cs = ConfigStore.instance()
cs.store(group="habitat_baselines/rl/policy", name="zsos_policy", node=ZSOSPolicyConfig)
cs.store(group="habitat_baselines/rl/policy", name="vlfm_policy", node=VLFMPolicyConfig)
8 changes: 4 additions & 4 deletions vlfm/policy/reality_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from torch import Tensor

from vlfm.mapping.obstacle_map import ObstacleMap
from vlfm.policy.base_objectnav_policy import ZSOSConfig
from vlfm.policy.base_objectnav_policy import VLFMConfig
from vlfm.policy.itm_policy import ITMPolicyV2

INITIAL_ARM_YAWS = np.deg2rad([-90, -60, -30, 0, 30, 60, 90, 0]).tolist()
Expand Down Expand Up @@ -48,8 +48,8 @@ def __init__(
def from_config(
cls, config: DictConfig, *args_unused: Any, **kwargs_unused: Any
) -> Any:
policy_config: ZSOSConfig = config.policy
kwargs = {k: policy_config[k] for k in ZSOSConfig.kwaarg_names} # type: ignore
policy_config: VLFMConfig = config.policy
kwargs = {k: policy_config[k] for k in VLFMConfig.kwaarg_names} # type: ignore

return cls(**kwargs)

Expand Down Expand Up @@ -194,7 +194,7 @@ def _infer_depth(

@dataclass
class RealityConfig(DictConfig):
policy: ZSOSConfig = ZSOSConfig()
policy: VLFMConfig = VLFMConfig()


class RealityITMPolicyV2(RealityMixin, ITMPolicyV2):
Expand Down
2 changes: 1 addition & 1 deletion vlfm/semexp_env/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
args = get_args()
args.agent = "vlfm" # Doesn't really matter as long as it's not "sem_exp"
args.split = "val"
args.task_config = "objnav_gibson_zsos.yaml"
args.task_config = "objnav_gibson_vlfm.yaml"
# Ensure a random seed
args.seed = int(time.time() * 1000) % 2**32

Expand Down
File renamed without changes.

0 comments on commit 456ccef

Please sign in to comment.