Github 项目推荐 | 真实全景图像强化学习 AI 平台 —— Matterport3DSimulator

时间:2022-05-06
本文章向大家介绍Github 项目推荐 | 真实全景图像强化学习 AI 平台 —— Matterport3DSimulator,主要内容包括特征、参考、安装、前提、举个例子,在 Ubuntu 上安装依赖关系:、如果你没有使用 --recursive 标志进行克隆,则需要从顶级目录手动克隆 pybind 子模块:、目录结构:、用 Cmake 构建 OSMESA、任务、基本概念、基础应用、原理机制和需要注意的事项等,并结合实例形式分析了其使用技巧,希望通过本文能帮助到大家理解应用这部分内容。
Matterport3DSimulator 可以使用视觉信息(RGB-D 图像)开发与真实 3D 环境交互的 AI Agent,它主要应用于深度强化学习的研究以及自然语言处理和机器人技术的结合技术。

请访问官网(https://bringmeaspoon.org/)获取最近的更新和 Demo。

这是早期发布的开发代码,官方可能会做一些重大的改变,尤其是考虑与 ParlAI 和 OpenAI Gym 整合之后。

特征

  • 数据集由 90 个不同的室内环境组成(包括住宅、办公室、酒店、教堂)
  • 所有的图像都是真实的,不是合成的(提供更多的视觉复杂度)
  • 用于 C++ 和 Python 的 API
  • 可定制的图像分辨率、相机参数等
  • 支持使用 OpenGL 的 GPU 渲染,以及使用 OSMESA 的离屏(off-screen)CPU 渲染。

参考

Matterport3DSimulator 和 Room-to-Room (R2R) 导航数据集在下述的论文中有详细描述:

https://arxiv.org/abs/1711.07280

如果你要使用模拟器或者数据集,请引用以下论文:

@article{mattersim,
  title={{Vision-and-Language Navigation}: Interpreting visually-grounded navigation instructions in real environments},
  author={Peter Anderson and Qi Wu and Damien Teney and Jake Bruce and Mark Johnson and Niko S{"u}nderhauf and Ian Reid and Stephen Gould and Anton van den Hengel},
  journal={arXiv preprint arXiv:1711.07280},
  year={2017}
}

安装

前提

有 C++11 支持的 C++ 编译器是必要的,另外,Matterport3DSimulator 有以下的依赖关系:

  • OpenCV >= 2.4 including 3.x
  • OpenGL
  • OSMesa
  • GLM
  • Numpy
  • pybind11 for Python bindings
  • Doxygen for building documentation

举个例子,在 Ubuntu 上安装依赖关系:

sudo apt-get install libopencv-dev python-opencv freeglut3 freeglut3-dev libglm-dev libjsoncpp-dev doxygen libosmesa6-dev libosmesa6

Clone Repo

Clone Matterport3DSimulator 库:

# Make sure to clone with --recursive
git clone --recursive https://github.com/peteanderson80/Matterport3DSimulator.git
cd Matterport3DSimulator

如果你没有使用 --recursive 标志进行克隆,则需要从顶级目录手动克隆 pybind 子模块:

git submodule update --init --recursive

目录结构:

  • connectivity: Json navigation graphs.
  • webgl_imgs: Contains dataset views rendered with javascript (for test comparisons).
  • sim_imgs: Will contain simulator rendered images after running tests.
  • models: Caffe models for precomputing ResNet image features.
  • img_features: Storage for precomputed image features.
  • data: You create a symlink to the Matterport3D dataset.
  • tasks: Currently just the Room-to-Room (R2R) navigation task.

下载数据集

要使用 Matterport3DSimulator,必须先下载 Matterport3D 数据集(https://niessner.github.io/Matterport/),或者下载预先计算的 ResNet 图像特征并使用离散化的视点。

编译

用 Cmake 来构建 OpenGL

mkdir build && cd build
cmake ..
make
cd ../

用 Cmake 构建 OSMESA

mkdir build && cd build
cmake -DOSMESA_RENDERING=ON ..
make
cd ../

要为doxygen目录中的 C ++ 类构建 html 文档,请运行以下命令并导航到 doxygen / html / index.html:

doxygen

Demo

这些是非常简单的 Demo 演示,旨在说明模拟器如何在 Python 和 C++ 中使用

Python demo:

python src/driver/driver.py

C++ demo:

build/mattersim_main

运行测试

build/tests

如果你没有安装 Matterport3D 数据集,则需要跳过渲染测试:

build/tests exclude:[Rendering]

其他的配置和用法,请参考 Catch 文档:https://github.com/philsquared/Catch

任务

目前模拟器只支持一项任务:Room-to-Room (R2R) 导航任务

请参阅具体的指导来设置和运行此任务:

https://github.com/peteanderson80/Matterport3DSimulator/blob/master/tasks/R2R/README.md

详细信息请访问 Matterport3DSimulator 官方 Github 页面:

https://github.com/peteanderson80/Matterport3DSimulator。