Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "3rdparty/eigen-git-mirror"]
path = 3rdparty/eigen
url = https://github.com/eigenteam/eigen-git-mirror.git
url = https://gitlab.com/libeigen/eigen.git
[submodule "3rdparty/Pangolin"]
path = 3rdparty/Pangolin
url = https://github.com/stevenlovegrove/Pangolin.git
2 changes: 1 addition & 1 deletion 3rdparty/Pangolin
Submodule Pangolin updated 539 files
2 changes: 1 addition & 1 deletion 3rdparty/eigen
Submodule eigen updated from 8e4790 to d71c30
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
cmake_minimum_required(VERSION 2.6.0)
cmake_minimum_required(VERSION 3.22)

project(Replica)

Expand All @@ -14,12 +14,11 @@ if(NOT ${Eigen3_FOUND})
endif()

# use system Pangolin if available
find_package(Pangolin)
find_package(Pangolin 0.9)
if(NOT ${Pangolin_FOUND})
message(STATUS "Using 3rd party Pangolin")
set(Pangolin_INCLUDE_DIRS "${THIRD_PARTY}/Pangolin/build/src/include")
list(APPEND Pangolin_INCLUDE_DIRS "${THIRD_PARTY}/Pangolin/include")
set(Pangolin_LIBRARIES "${THIRD_PARTY}/Pangolin/build/src/libpangolin.so")
list(APPEND CMAKE_PREFIX_PATH "${THIRD_PARTY}/Pangolin/build")
find_package(Pangolin 0.9 REQUIRED)
endif()

find_package(dl REQUIRED)
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the [technical report](https://arxiv.org/abs/1906.05797) for more details.

The Replica SDK contained in this repository allows visual inspection of the
datasets via the ReplicaViewer and gives an example of how to render out images
from the scenes headlessly via the ReplicaRenderer.
from the scenes headlessly via the ReplicaRenderer.

For machine learning purposes each dataset also contains an export to the format
employed by [AI Habitat](https://www.aihabitat.org/) and is therefore usable
Expand All @@ -21,7 +21,7 @@ seamlessly in that framework for AI agent training and other ML tasks.

If you use the Replica dataset in your research directly or indirectly via derivative datasets or frameworks, please cite the following
[technical report](https://arxiv.org/abs/1906.05797):
```
```bibtex
@article{replica19arxiv,
title = {The {R}eplica Dataset: A Digital Replica of Indoor Spaces},
author = {Julian Straub and Thomas Whelan and Lingni Ma and Yufan Chen and Erik Wijmans and Simon Green and Jakob J. Engel and Raul Mur-Artal and Carl Ren and Shobhit Verma and Anton Clarkson and Mingfei Yan and Brian Budge and Yajie Yan and Xiaqing Pan and June Yon and Yuyang Zou and Kimberly Leon and Nigel Carter and Jesus Briales and Tyler Gillingham and Elias Mueggler and Luis Pesqueira and Manolis Savva and Dhruv Batra and Hauke M. Strasdat and Renzo De Nardi and Michael Goesele and Steven Lovegrove and Richard Newcombe },
Expand All @@ -42,14 +42,14 @@ Each Replica contains the following assets:
```
├── glass.sur
├── habitat
├── mesh_semantic.ply
├── mesh_semantic.ply
├── mesh_semantic.navmesh
├── info_semantic.json
├── mesh_preseg_semantic.ply
├── mesh_preseg_semantic.ply
├── mesh_preseg_semantic.navmesh
├── info_preseg_semantic.json
├── replica_stage.stage_config.json
└── sorted_faces.bin
└── sorted_faces.bin
├── mesh.ply
├── preseg.bin
├── preseg.json
Expand All @@ -69,22 +69,22 @@ The different files contain the following:
- `preseg.json` and `preseg.bin`: the presegmentation in terms of planes and non-planes of the scene.
- `semantic.json` and `semantic.bin`: the semantic segmentation of the scene.
- `textures`: the high resolution and high dynamic range textures of the scene.
- `habitat/mesh*semantic.ply`: the quad meshes including semantic or presegmentation information for AI Habitat.
- `habitat/mesh*semantic.ply`: the quad meshes including semantic or presegmentation information for AI Habitat.
- `habitat/info*semantic.json`: mapping from instance IDs in the respective `mesh_*.ply` to semantic names.
- `habitat/mesh*semantic.navmesh`: navigation grid for AI Habitat.
- `habitat/replica_stage.stage_config.json`: configuration file defining scene level parameters for habitat-sim.
- `habitat/sorted_faces.bin`: binary file containing pre-processed geometry data for habitat-sim Ptex rendering support.

### Download on Mac OS and Linux
Make sure `pigz`, `wget`, and `unzip` are installed:
```
```bash
# on Mac OS
brew install wget pigz unzip
# on Ubuntu
sudo apt-get install wget pigz unzip
```
To download and decompress the dataset use the `download.sh` script:
```
```bash
./download.sh /path/to/replica_v1
```

Expand All @@ -97,7 +97,7 @@ Execute `win_download.bat` to download Replica.
### Setup
After installing the dependencies of [Pangolin](https://github.com/stevenlovegrove/Pangolin),
the Replica SDK can be compiled using the build script via
```
```bash
git submodule update --init
./build.sh
```
Expand All @@ -108,36 +108,36 @@ to be installed. If you wish to use the headless renderer ensure you have the li

### ReplicaViewer

ReplicaViewer is an interactive UI to explore the Replica Dataset.
ReplicaViewer is an interactive UI to explore the Replica Dataset.

```
```bash
./build/bin/ReplicaViewer mesh.ply /path/to/atlases [mirrorFile]
```

![ReplicaViewer](./assets/ReplicaViewer.png)

The exposure value for rendering from the HDR textures can be adjusted on the
top left.
top left.

### ReplicaRenderer

The ReplicaRenderer shows how to render out images from a Replica for a
programmatically defined trajectory without UI. This executable can be run
headless on a server if so desired.
headless on a server if so desired.

```
```bash
./build/bin/ReplicaRenderer mesh.ply textures glass.sur
```

## Replica and AI Habitat

To use Replica within AI Habitat checkout the AI Habitat Sim at [https://github.com/facebookresearch/habitat-sim](https://github.com/facebookresearch/habitat-sim).
After building the project you can launch the test viewer to verify that everything works:
```
```bash
./build/viewer --dataset /PATH/TO/REPLICA/replica.scene_dataset_config.json -- frl_apartment_0
```

## Team
## Team

Julian Straub, Thomas Whelan, Lingni Ma, Yufan Chen, Erik Wijmans, Simon Green, Jakob J. Engel, Raul Mur-Artal, Carl Ren, Shobhit Verma, Anton Clarkson, Mingfei Yan, Brian Budge, Yajie Yan, Xiaqing Pan, June Yon, Yuyang Zou, Kimberly Leon, Nigel Carter, Jesus Briales, Tyler Gillingham Elias Mueggler, Luis Pesqueira, Manolis Savva, Dhruv Batra, Hauke M. Strasdat, Renzo De Nardi, Michael Goesele, Steven Lovegrove, and Richard Newcombe.

Expand Down
13 changes: 8 additions & 5 deletions ReplicaSDK/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
cmake_minimum_required(VERSION 2.6.0)
cmake_minimum_required(VERSION 3.22)

project(ReplicaSDK)

Expand All @@ -10,28 +10,29 @@ set(PTEX_SHADER_DIR "${CMAKE_CURRENT_LIST_DIR}/shaders" CACHE PATH "Where the sh
file(GLOB srcs_ptex ptex/*.cpp)
file(GLOB hdrs include/*.h)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -msse2 -msse3 -Wall -std=c++11 -fopenmp -DSHADER_DIR=${PTEX_SHADER_DIR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -msse2 -msse3 -Wall -fopenmp -DSHADER_DIR=${PTEX_SHADER_DIR}")

add_library(ptex SHARED
${srcs_ptex}
${hdrs}
)

target_link_libraries(ptex
${Eigen_LIBRARIES}
Eigen3::Eigen
${Pangolin_LIBRARIES}
${dl_LIBRARIES}
stdc++fs
X11
)
target_include_directories(ptex PUBLIC
${Pangolin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
${dl_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}
)

set_property(TARGET ptex PROPERTY CXX_STANDARD 17)

include_directories(${Pangolin_INCLUDE_DIRS})
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(${dl_INCLUDE_DIRS})
include_directories("./include")

Expand All @@ -56,3 +57,5 @@ target_link_libraries(ReplicaRenderer
ptex
stdc++fs
)

install(TARGETS ptex ReplicaViewer ReplicaRenderer)
2 changes: 1 addition & 1 deletion ReplicaSDK/include/PTexLib.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#pragma once
#include <pangolin/display/opengl_render_state.h>
#include <pangolin/gl/opengl_render_state.h>
#include <pangolin/gl/gl.h>
#include <pangolin/gl/glsl.h>
#include <memory>
Expand Down
6 changes: 4 additions & 2 deletions ReplicaSDK/ptex/EGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ EGLCtx::EGLCtx(const bool createCtx, const int cudaDevice, const bool createSurf
display = eglGetPlatformDisplayEXT(EGL_PLATFORM_X11_KHR, x11, 0);
}
ASSERT(display != EGL_NO_DISPLAY, "Can't create EGL display");

EGLint major, minor;
ASSERT(eglInitialize(display, &major, &minor), "Can't init EGL");

Expand All @@ -156,17 +156,19 @@ EGLCtx::EGLCtx(const bool createCtx, const int cudaDevice, const bool createSurf
"Can't bind EGL context");
}

#ifdef HAVE_GLEW
GLenum err = glewInit();

#ifdef GLEW_ERROR_NO_GLX_DISPLAY
if (err == GLEW_ERROR_NO_GLX_DISPLAY) {
std::cout << "Can't initialize EGL GLEW GLX display, may crash!" << std::endl;
}
else
else
#endif
if (err != GLEW_OK) {
ASSERT(false, "Can't initialize EGL, glewInit failing completely.");
}
#endif

// Setup default OpenGL parameters
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
Expand Down
4 changes: 3 additions & 1 deletion ReplicaSDK/src/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <PTexLib.h>

#include <pangolin/display/display.h>
#include <pangolin/display/widgets/widgets.h>
#include <pangolin/display/widgets.h>

#include "GLCheck.h"
#include "MirrorRenderer.h"
Expand All @@ -29,9 +29,11 @@ int main(int argc, char* argv[]) {
// Setup OpenGL Display (based on GLUT)
pangolin::CreateWindowAndBind("ReplicaViewer", uiWidth + width, height);

#ifdef HAVE_GLEW
if (glewInit() != GLEW_OK) {
pango_print_error("Unable to initialize GLEW.");
}
#endif

if(!checkGLVersion()) {
return 1;
Expand Down
14 changes: 5 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved

cd 3rdparty/Pangolin
mkdir build
cd build
cmake ..
make -j
cmake -B build
cmake --build build -j

cd ../../../
mkdir build
cd build
cmake ..
make -j
cd ../../
cmake -B build
cmake --build build -j