chat-with-nerf

sled-groupApache-2.0长期未更新

用自然语言对话就能定位和操作 NeRF 三维场景中的物体,把 ChatGPT 和 BLIP2 接进 NeRFStudio,省去手动标注的麻烦。

[ICRA 2024] Chat with NeRF enables users to interact with a NeRF model by typing in natural language.

暂无版本322star22fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
docker pull jedyang97/chat-with-nerf:latest
docker run --gpus "device=0" -p 7777:7777 -v /<parent_path_chat-with-nerf>/:/workspace/ -v /home/<your_username>/.cache/:/home/user/.cache/ --rm -it --shm-size=12gb chat-with-nerf:latest
硬件要求按 README 说明

README 未明确给出显存数值;本地安装要求 CUDA 11.3 与 cu117 版 PyTorch,Docker 运行时用 --gpus "device=0" 指定单卡,并建议 --shm-size=12gb。

需要 CUDA有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用自然语言对话在 NeRF 三维场景中定位任意物体,把开放词汇 3D 视觉定位做成可交互 demo

用自然语言对话就能定位和操作 NeRF 三维场景中的物体,把 ChatGPT 和 BLIP2 接进 NeRFStudio,省去手动标注的麻烦。

核心能力

  • 以 LLM 作为 agent 解析对话并驱动 3D 定位
  • 支持开放词汇,可定位训练类别之外的新物体
  • 基于 LERF 与 NeRFStudio 提取 3D 场景嵌入
  • 用 LLaVA 做图像描述替代 BLIP-2
  • 提供 Gradio 交互 demo 并可视化 3D 定位结果

容易踩的坑

需自行下载并按 LLaVA 文档构造 llava-13b-v0 权重,放到 pre-trained-weights/LLaVA 或改 settings.py 的 LLAVA_PATH;运行 demo 前必须在 .env 里填 OPENAI_API_KEY 和 API_URL;本地安装要求特定 CUDA 11.3,且需先装 tiny-cuda-nn 与 nerfstudio。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    :camera_flash: Chat with NeRF: Grounding 3D Objects in Neural Radiance Field through Dialog

    Project Paper Video Demo Embark

    Demo of Chat-with-NeRF

    :bulb: Highlight

    • Open-Vocabulary 3D Localization. Locate anything with natural language dialog!
    • Interactive Grounding. Humans will be able to chat with an agent to localize novel objects.

    :fire: News

    :label: TODO

    • A faster process to determine camera poses and rendering pictures. See discussion #15. Implemented in #17.
    • Use LLaVA to replace BLIP-2 for better image captioning.
    • Improve the foundation model (currently CLIP is used) used in LERF for grounding, which can potentially improve spatial and affordance understanding. Potential candidate: LLaVA, BLIP-2, OWL-ViT.

    :hammer_and_wrench: Install

    To install the dependencies we provide a Dockerfile:

    docker build -t chat-with-nerf:latest .
    

    Or if you want to pull remote image from Dockerhub to save significant time, please try:

    docker pull jedyang97/chat-with-nerf:latest
    

    Otherwise, if you prefer build it locally:

    conda create --name nerfstudio -y python=3.8
    conda activate nerfstudio
    pip install torch==1.13.1 torchvision functorch --extra-index-url https://download.pytorch.org/whl/cu117
    pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
    pip install nerfstudio
    
    git clone https://github.com/kerrj/lerf
    python -m pip install -e .
    ns-train -h
    

    Note that specific CUDA 11.3 is required. For further information, please check nerfstudio installation guide.

    Then locally you need to run

    git clone https://github.com/sled-group/chat-with-nerf.git
    

    Download and construct the llava-13b-v0 checkpoint (see LLaVA's documentation on how to construct the checkpoint). Then assuming you store the constructed llava-13b-v0 checkpoint under <my_path_to_llava>/llava-13b-v0, move the checkpoint to /chat-with-nerf/pre-trained-weights/LLaVA.

    cd chat-with-nerf
    mkdir -p pre-trained-weights/LLaVA
    cd pre-trained-weights/LLaVA
    mv <my_path_to_llava>/llava-13b-v0 .
    

    Alternatively, you can supply a different version of LLaVA checkpoint and change LLAVA_PATH's value in chat_with_nerf/settings.py:

    LLAVA_PATH = "/workspace/pre-trained-weights/LLaVA/<my_llava_checkpoint>"
    

    Open up your directory's permission for the docker container:

    cd <parent_path_chat-with-nerf>
    chmod -R 777 .
    

    If using Docker, you can use the following command to spin up a docker container with chat-with-nerf mounted under workspace

    docker run --gpus "device=0" -p 7777:7777 -v /<parent_path_chat-with-nerf>/:/workspace/ -v /home/<your_username>/.cache/:/home/user/.cache/ --rm -it --shm-size=12gb chat-with-nerf:latest
    

    Then install Chat with NeRF dependencies

    cd /workspace/chat-with-nerf
    pip install -e .
    pip install -e .[dev]
    

    (or use your favorite virtual environment manager)

    :arrow_forward: Inference

    Interactive Demo

    Write your OpenAI API key and URL in a /workspace/chat-with-nerf/.env file:

    API_URL=https://XXXXXXXXXXXXXXXX.openai.azure.com/openai/deployments/gpt-4-8k/chat/completions?api-version=2023-03-15-preview
    OPENAI_API_KEY=XXXXXXXXXXXXXXXXXXXX
    

    We provide the code to interactively play with our agent. To run the demo:

    cd /workspace/chat-with-nerf
    export $(cat .env | xargs); gradio chat_with_nerf/app.py
    

    Reproduce Results in the Paper

    We provide four Jupyter notebooks to reproduce results in the paper. To run these notebooks, please refer to the Evaluation README.

    To facillate easier reproduction of our results, we provide pre-processed data here.

    Preprocess / Preprare your own Data

    If you would like to use your own 3D scenes, please follow the next two sections:

    Extracting openscene embeddings

    For extracting the openscene embeddings, we used the pre-trained Distillation model checkpoint, shared by the Openscene Authors for generating the representation. To generate the corresponding representations, kindly refer to the guidelines provided in the Openscene GitHub repository, specifically focusing on the Data Preparation and Run Sections.

    https://github.com/pengsongyou/openscene#data-preparation
    https://github.com/pengsongyou/openscene#run
    
    Extracting LERF embeddings

    We include a version of NeRFStudio code in our released docker and you can use generate point cloud function to acquire the H5 embedding. We slightly altered the ns-export function: https://docs.nerf.studio/reference/cli/ns_export.html to get the H5 embeddings.

    Related Work

    Citation

    @misc{yang2023llmgrounder,
          title={LLM-Grounder: Open-Vocabulary 3D Visual Grounding with Large Language Model as an Agent}, 
          author={Jianing Yang and Xuweiyi Chen and Shengyi Qian and Nikhil Madaan and Madhavan Iyengar and David F. Fouhey and Joyce Chai},
          year={2023},
          eprint={2309.12311},
          archivePrefix={arXiv},
          primaryClass={cs.CV}
    }