InternNav

repository·main·Indexed 21 days ago

https://github.com/internrobotics/internnav

An open-source toolbox for embodied navigation based on PyTorch, Habitat, and Isaac Sim. It supports modular customization for Vision-Language Navigation (VLN), including VLN-CE and VLN-PE, and Visual Navigation (VN) across various simulation platforms. The framework includes a model zoo featuring InternVLA-N1 dual-system models, specialized environment wrappers like HabitatVllnEnv, and evaluation pipelines such as HabitatDialogEvaluator for interactive navigation tasks.

Tokens
12.1K
Snippets
24
Records
54
Agent score
76%

What's inside InternNav

  1. Overview of the IROS Challenge 2025 Nav Track

    main

    The IROS Challenge 2025 Nav Track focuses on Vision-and-Language Navigation (VLN) in Physical Environments.

    Core Objectives

    • Multimodal Perception: Integrating egocentric RGB/depth vision with natural language instructions.
    • Physics-based Robustness: Maintaining stable control of a humanoid robot in a physics simulator, specifically handling camera shake, motion blur, dynamic height shifts, and obstacle avoidance.
    • Human-like Navigation: Achieving smooth and interpretable movement.

    Simulation Details

    • Platform: InternUtopia (Physics-driven simulation).
    • Robot: Unitree H1 humanoid robot model.
    • Tasks: Instruction-based navigation in indoor scenes.
  2. Overview of InternNav benchmarks and models

    main

    InternNav provides a comprehensive suite of benchmarks and a model zoo for studying embodied navigation.

    Supported Benchmarks

    • VLN (Vision-Language Navigation): VLN-CE, VLN-PE
    • VN (Visual Navigation): Cluttered Environments, GRScenes-100

    Model Zoo Categories

    • VLN Single-System: Includes models like Seq2Seq, CMA, and RDP.
    • VN System (System 1): Includes baseline libraries such as DD-PPO, iPlanner, ViPlanner, GNM, ViNT, NoMad, and NavDP (which uses InternVLA-N1 as System 1).
    • VLN Multi-System: Features advanced dual-system models like InternVLA-N1 (System 2) combined with Decoupled System 1, InternVLA-N1 (Dual System) with NavDP* (jointly tuned), and InternVLA-N1 (Dual System) DualVLN.
  3. Understand the InternData-N1 dataset structure

    main

    The InternData-N1 dataset follows a specific directory structure for training and evaluation.

    Key components:

    • vln_pe/raw_data/r2r/: Contains JSON files defining tasks, navigation goals, and dataset splits (e.g., train/, val_seen/, val_unseen/).
    • vln_pe/traj_data/: Contains training sample data (trajectories) for different scene types like interiornav/ or r2r/.
    • scene_data/mp3d_pe/: Contains the underlying scene assets organized by ID.
    • Embodiments/: Contains embodiment-specific data.
    data/
    ├── Embodiments/
    ├── scene_data/
    │   └── mp3d_pe/
    │       ├──17DRP5sb8fy/
    │       ├── 1LXtFkjw3qL/
    │       └── ...
    └── vln_pe/
        ├── raw_data/                       # JSON files defining tasks, navigation goals, and dataset splits
        │   └── r2r/
        │       ├── train/
        │       ├── val_seen/
        │       │   └── val_seen.json.gz
        │       └── val_unseen/
        └── traj_data/                      # training sample data for two types of scenes
            ├── interiornav/
            │   └── kujiale_xxxx.tar.gz
            └── r2r/
                └── trajectory_0/
                    ├── data/
                    ├── meta/
                    └── videos/
  4. Use the SimpleNPC module for agent interaction

    main

    The simple_npc package provides a lightweight NPC that allows agents to ask clarification questions during navigation.

    Features

    • OpenAI Integration: Wraps an OpenAI chat client to generate natural language responses.
    • Dialog Modes: Supports one- or two-turn prompt flows, including requests for disambiguation or path descriptions.
    • Context Awareness: Uses get_description.py to build natural-language descriptions of navigation paths and regions, which are then used to inform NPC answers.

    Implementation details like prompt templates are managed in simple_npc/prompt.py.

  5. Understand the DialogAgent behavior and action decoding

    main

    The DialogAgent (defined in internnav/agent/dialog_agent.py) is driven by the evaluator and uses a Hugging Face Qwen2.5-VL model to process observations and generate actions.

    Core Responsibilities

    • Sensor Handling: Uses convert_input to filter depth via Habitat's filter_depth and maintains RGB/depth history.
    • Prompt Construction: The inference method builds chat-style prompts combining the current instruction, historical observations (as <image> tokens), and prior NPC exchanges.
    • Action Decoding: The convert_output method parses the model's language output to identify:
      • <talk>: Triggers a dialog request to the NPC.
      • look down: Triggers a look-down action.
      • Pixel Goal Coordinates: Converts coordinates to world GPS points, validates navigability, and uses Habitat's ShortestPathFollower for motion.
    • Step Loop: The step method manages the alternation between model inference and executing queued navigation actions.
  6. InternVLA-N1 Model Configurations

    main

    InternVLA-N1 is a dual-system navigation foundation model. When using or training InternVLA-N1, you can choose between different configurations:

    1. InternVLA-N1 (Dual System) with NavDP:* This configuration involves joint tuning between System 1 and System 2.
    2. InternVLA-N1 (Dual System) DualVLN: A high-performance configuration that uses RGB observations and has shown state-of-the-art results on VLN-CE and VLN-PE benchmarks.
    3. InternVLA-N1 (System 2) + Decoupled System 1: Uses a pre-existing System 1 (like NavDP or iPlanner) paired with the InternVLA-N1 System 2 model.

    For detailed architecture and training specifics, refer to the DualVLN paper.

  7. Understand the Nav Track Task Requirements

    main

    The Nav Track task requires building a multimodal mobile robot navigation system. Your pipeline must integrate four key components:

    1. Egocentric visual perception: Processing real-time camera feeds.
    2. Natural language instruction understanding: Interpreting human commands.
    3. Historical trajectory modeling: Tracking the robot's path over time.
    4. Navigation action prediction: Generating movement commands.

    Key technical requirements:

    • The system must handle camera shake, height changes, and local obstacle avoidance.
    • It must generalize to unseen indoor environments and novel language instructions.
    • The goal is cross-room end-to-end navigation using vision-language fusion.
  8. Implement a custom Model, Agent, and Trainer

    main

    InternNav uses a modular architecture consisting of Models, Agents, and Trainers. To add a new navigation algorithm, you must implement these three components.

    1. Custom Model

    The Model implements the neural network and inference logic. It expects an observation (obs) from the ego-centric camera and returns an action.

    Observation Format (obs):

    obs = [{
        'globalgps': [X, Y, Z],              # robot location
        'globalrotation': [X, Y, Z, W],      # robot orientation in quaternion
        'rgb': np.array(256, 256, 3),        # rgb camera image
        'depth': np.array(256, 256, 1)       # depth image
    }]

    Action Format (action): Returns a List[int] representing actions for each environment:

    • 0: stop
    • 1: move forward
    • 2: turn left
    • 3: turn right

    Configuration: Define a Config class that inherits from PretrainedConfig (see CMAModelConfig in internnav/model/cma/cma_policy.py for reference).

    Registration: Register the model in internnav/model/__init__.py using get_policy and get_config.

    2. Custom Agent

    The Agent wraps the Model and handles environment interaction and preprocessing. Inherit from Agent and implement:

    • reset(): Resets internal state (e.g., RNN states).
    • inference(obs): Performs preprocessing and calls the model.
    • step(obs): The external interface that calls inference.

    3. Custom Trainer

    The Trainer manages the training loop. Inherit from Base Trainer and implement:

    • train_epoch(): Handles batch iteration, forward pass, and parameter updates.
    • eval_epoch(): Evaluates on the validation set.
    • save_checkpoint() / load_checkpoint(): Manages model weights and state.
  9. Execute the Official Evaluation Flow

    main

    The evaluation process for the IROS Challenge follows a specific pipeline. If you are participating in the official evaluation via AliCloud, the system will mount your evaluation config and the full dataset (val_seen, val_unseen, test).

    To manually trigger the evaluation execution (e.g., via SSH + screen), run the following command:

    challenge/start_eval_iros.sh --config scripts/eval/configs/challenge_cfg.py

    A polling loop will monitor the process for result files. Once completed, metrics for each split are parsed and submitted to the EvalAI leaderboard.

    Note on Scoring: The final released results are a weighted sum of the test subsets from VLNPE-R2R (MP3D scenes) and Interior-Agent (Kujiale scenes), using a 2:1 weighting ratio.

  10. Install the VL-LN Benchmark and Checkpoints

    main

    To use the Vision-Language-and-Language Navigation (VL-LN) extensions, you must download the benchmark dataset and the latest model checkpoints from HuggingFace.

    1. Download the VL-LN-Bench dataset.
    2. Download the latest checkpoints.
    3. Place the downloaded files into the following directory structure to match the default expected path:

    InternNav/projects/VL-LN-Bench

    This directory should contain subdirectories such as base_model/, raw_data/, scene_datasets/, and traj_data/.

  11. Package and submit your model for the IROS Challenge

    main

    To participate in the IROS challenge, you must package your model and code into a Docker image and submit a JSON file to Eval.AI.

    1. Build and Test your Docker Image

    Ensure your trained weights and code are located at /root/InternNav inside the image. Use the following command to build:

    docker build -t my-internnav-custom:v1 .

    To test your image locally using a mini split:

    docker run --name internnav-test -it --gpus all --network host \
      -e "ACCEPT_EULA=Y" \
      -e "PRIVACY_CONSENT=Y" \
      -e "DISPLAY=${DISPLAY}" \
      --entrypoint /bin/bash \
      -w /root/InternNav \
      -v /tmp/.X11-unix/:/tmp/.X11-unix \
      -v ${PWD}/data:/root/InternNav/data \
      -v ${PWD}/interiornav_data:/root/InternNav/interiornav_data \
      your-registry/internnav-custom:v1 \
      -c "challenge/start_eval_iros.sh --config scripts/eval/configs/challenge_cfg.py --split mini; exec /bin/bash"

    2. Submit to Eval.AI

    Push your image to a public registry (e.g., Aliyun or Quay) and create a JSON file with the following structure:

    {
        "url": "your-registry/internnav-custom:v1",
        "team": {
            "name": "your-team-name",
            "members": [
                {
                    "name": "John Doe",
                    "affiliation": "University of Example",
                    "email": "john.doe@example.com",
                    "leader": true
                }
            ]
        }
    }

    Upload this JSON file to Eval.AI using the 'Upload file' submission type.