diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ef64f3..6916618 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,9 +7,15 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + jobs: vlfm_main_build: - runs-on: ubuntu-latest + runs-on: + group: bdai-gh-large-runners defaults: run: shell: bash @@ -19,4 +25,5 @@ jobs: - uses: actions/checkout@v3 - name: Pytest run: | + pip install -e .[habitat] pytest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef927b8..13392d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,14 +7,18 @@ repos: - id: ruff args: ['--fix', '--config', 'pyproject.toml'] -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: end-of-file-fixer - - id: trailing-whitespace - - id: check-yaml - - id: check-added-large-files - - id: check-toml +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + args: ['--unsafe'] + - id: check-added-large-files + args: ['--enforce-all', '--maxkb', '200'] + - id: check-toml + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable - repo: https://github.com/psf/black rev: 23.3.0 @@ -37,3 +41,8 @@ repos: - types-PyYAML - types-toml - types-six + +- repo: https://github.com/jumanjihouse/pre-commit-hooks + rev: 3.0.0 + hooks: + - id: forbid-binary diff --git a/scripts/eval_dummy_policy.sh b/scripts/eval_dummy_policy.sh old mode 100644 new mode 100755 diff --git a/scripts/eval_itm_policy.sh b/scripts/eval_itm_policy.sh old mode 100644 new mode 100755 diff --git a/scripts/eval_oracle_fbe_policy.sh b/scripts/eval_oracle_fbe_policy.sh old mode 100644 new mode 100755 diff --git a/scripts/launch_vlm_servers.sh b/scripts/launch_vlm_servers.sh old mode 100644 new mode 100755 diff --git a/vlfm/mapping/obstacle_map.py b/vlfm/mapping/obstacle_map.py index ffcec79..59f069f 100644 --- a/vlfm/mapping/obstacle_map.py +++ b/vlfm/mapping/obstacle_map.py @@ -1,8 +1,8 @@ import cv2 import numpy as np - from frontier_exploration.frontier_detection import detect_frontier_waypoints from frontier_exploration.utils.fog_of_war import reveal_fog_of_war + from vlfm.mapping.base_map import BaseMap from vlfm.utils.geometry_utils import extract_yaw, get_point_cloud, transform_points from vlfm.utils.img_utils import fill_small_holes diff --git a/vlfm/policy/habitat_policies.py b/vlfm/policy/habitat_policies.py index 02c4ce8..2a42f83 100644 --- a/vlfm/policy/habitat_policies.py +++ b/vlfm/policy/habitat_policies.py @@ -4,6 +4,7 @@ import numpy as np import torch from depth_camera_filtering import filter_depth +from frontier_exploration.base_explorer import BaseExplorer from habitat.tasks.nav.object_nav_task import ObjectGoalSensor from habitat_baselines.common.baseline_registry import baseline_registry from habitat_baselines.common.tensor_dict import TensorDict @@ -15,7 +16,6 @@ from omegaconf import DictConfig from torch import Tensor -from frontier_exploration.base_explorer import BaseExplorer from vlfm.utils.geometry_utils import xyz_yaw_to_tf_matrix from vlfm.vlm.grounding_dino import ObjectDetections diff --git a/vlfm/policy/utils/non_habitat_policy/resnet.py b/vlfm/policy/utils/non_habitat_policy/resnet.py old mode 100644 new mode 100755 diff --git a/vlfm/policy/utils/non_habitat_policy/rnn_state_encoder.py b/vlfm/policy/utils/non_habitat_policy/rnn_state_encoder.py old mode 100644 new mode 100755 diff --git a/vlfm/run.py b/vlfm/run.py index 28d84f9..878a7bb 100644 --- a/vlfm/run.py +++ b/vlfm/run.py @@ -1,5 +1,12 @@ import os +# The following imports require habitat to be installed, and despite not being used by +# this script itself, will register several classes and make them discoverable by Hydra. +# This run.py script is expected to only be used when habitat is installed, thus they +# are hidden here instead of in an __init__.py file. This avoids import errors when used +# in an environment without habitat, such as when doing real-world deployment. noqa is +# used to suppress the unused import and unsorted import warnings by ruff. +import frontier_exploration # noqa import hydra # noqa from habitat import get_config # noqa from habitat.config import read_write @@ -10,13 +17,6 @@ from hydra.plugins.search_path_plugin import SearchPathPlugin from omegaconf import DictConfig -# The following imports require habitat to be installed, and despite not being used by -# this script itself, will register several classes and make them discoverable by Hydra. -# This run.py script is expected to only be used when habitat is installed, thus they -# are hidden here instead of in an __init__.py file. This avoids import errors when used -# in an environment without habitat, such as when doing real-world deployment. noqa is -# used to suppress the unused import and unsorted import warnings by ruff. -import frontier_exploration # noqa import vlfm.measurements.traveled_stairs # noqa: F401 import vlfm.obs_transformers.resize # noqa: F401 import vlfm.policy.action_replay_policy # noqa: F401 diff --git a/vlfm/utils/episode_stats_logger.py b/vlfm/utils/episode_stats_logger.py index 315d2f2..ad34b1b 100644 --- a/vlfm/utils/episode_stats_logger.py +++ b/vlfm/utils/episode_stats_logger.py @@ -3,8 +3,8 @@ import cv2 import numpy as np - from frontier_exploration.utils.general_utils import xyz_to_habitat + from vlfm.utils.geometry_utils import transform_points from vlfm.utils.habitat_visualizer import sim_xy_to_grid_xy from vlfm.utils.log_saver import log_episode diff --git a/vlfm/utils/habitat_visualizer.py b/vlfm/utils/habitat_visualizer.py index c184c2f..c09b375 100644 --- a/vlfm/utils/habitat_visualizer.py +++ b/vlfm/utils/habitat_visualizer.py @@ -2,12 +2,12 @@ import cv2 import numpy as np +from frontier_exploration.utils.general_utils import xyz_to_habitat from habitat.utils.visualizations import maps from habitat.utils.visualizations.maps import MAP_TARGET_POINT_INDICATOR from habitat.utils.visualizations.utils import overlay_frame from habitat_baselines.common.tensor_dict import TensorDict -from frontier_exploration.utils.general_utils import xyz_to_habitat from vlfm.utils.geometry_utils import transform_points from vlfm.utils.img_utils import ( reorient_rescale_map,