├── sim_imgs └── .gitkeep ├── tasks ├── agent │ ├── __init__.py │ ├── pomdp │ │ ├── __init__.py │ │ ├── instruction_attention.py │ │ ├── ast.py │ │ └── avast.py │ ├── observation │ │ ├── __init__.py │ │ ├── cv │ │ │ ├── __init__.py │ │ │ └── panorama_encoder.py │ │ ├── nlp │ │ │ ├── __init__.py │ │ │ ├── glove.py │ │ │ └── instruction_encoder.py │ │ ├── .DS_Store │ │ └── observation_encoder.py │ ├── model.py │ ├── agent_reinforce.py │ ├── replay_memory.py │ └── agent_seq2seq.py ├── env │ ├── __init__.py │ ├── adj_dict │ │ └── .gitkeep │ ├── img_features │ │ └── .gitkeep │ ├── nlp_features │ │ └── .gitkeep │ ├── r2r_dataset │ │ └── .gitkeep │ ├── mp_env_sim.py │ └── mp_env_dict.py ├── data │ ├── load_weight │ │ └── .gitkeep │ ├── results │ │ └── 0 │ │ │ └── .gitkeep │ ├── save_weight │ │ └── .gitkeep │ └── scripts │ │ └── generate_adj_dict.py ├── config.json ├── utils.py ├── reinforce_fine_tune.py └── ast_pre_train.py ├── .dockerignore ├── web ├── .gitignore ├── app │ ├── js │ │ ├── RequestAnimationFrame.js │ │ ├── Detector.js │ │ └── Matterport3D.js │ ├── index.html │ └── trajectory.html ├── package.json ├── gulpfile.js └── README.md ├── .gitmodules ├── teaser.jpg ├── .gitignore ├── webgl_imgs ├── 5ZKStnWn8Zo_c76b52856e7c4f2a9a4419000c8e646a_4.13470589902238_-0.02922217527541366.png ├── 8194nk5LbLH_c9e8dc09263e4d0da77d16de0ecddd39_4.05504292862083_0.008533161479170466.png ├── ARNzJeq3xxb_9a671e6915de4eb897f45fee8bf2031d_5.616355886953764_0.02583868533558965.png ├── cV4RVeZvu5T_1b321779a4374c2b952c51820daa9e6c_6.266463179566256_0.07914721704610106.png ├── 17DRP5sb8fy_85c23efeaecd4d43a7dcd5b90137179e_2.551961945320492_0.008557380839564054.png ├── 1LXtFkjw3qL_187589bb7d4644f2943079fb949c0be9_1.8699330579409539_0.0004921836022802584.png ├── 1pXnuDYAj8r_163d61ac7edb43fb958c5d9e69ae11ad_4.626331047551077_-0.02444352614304746.png ├── 29hnd4uzFmX_1576d62e7bbb45e8a5ef9e7bb37b1839_5.844119909926444_-0.0006838914039405167.png ├── 2azQ1b91cZZ_3daad58ad53742038e50d62e91f84e7b_3.1736484087962933_0.016732869758208434.png ├── 2n8kARJN3HM_94ac3cea52ec455993f8562f78da3be1_2.604601935142565_-0.0009188787844489273.png ├── 5LpN3gDmAk7_bda8025f20404048a77381e9e0dc0ccf_5.325207878739601_-0.01083211073205187.png ├── 759xd9YjKW5_2343ef3bf04a4433af62f0d527d7512a_3.5451019786019264_-0.016938006310169448.png ├── 7y3sRwLe3Va_9bbf903d50da4ffd9e5d1fb7c9f4d69b_1.7348660165523566_0.008361841032265524.png ├── 82sE5b5pLXE_056a491afa534b17bac36f4f5898462a_1.689393931320027_-0.0037883068413356496.png ├── 8WUmhLawc2A_d21aae0b5d944f27a0074525c803fc9f_3.047458184407221_-0.04510889155759994.png ├── B6ByNegPMKs_e3a65955df26467581c32613c4e9f865_5.230794959607039_0.007265625492957138.png ├── b8cTxDM8gDG_f2944e0b66b9461994a7f757582f9bc3_0.0853092784395515_-0.007543204141144086.png ├── 2t7WUuJeko7_529f006f8293406da0b506defd2891a5_0.032985516949381344_-0.013788837143969411.png ├── 5q7pvUzZiYa_397403366d784caf804d741f32fd68b9_2.8746465006968234_-0.0007063598518199811.png └── ac26ZMwG7aT_efeef7cc82c84690addb0bf415f075ea_0.07434352566701552_-0.013447513736072197.png ├── src ├── lib │ ├── vertex.sh │ ├── fragment.sh │ └── Benchmark.cpp ├── test │ ├── python_test.py │ ├── python_vs_threejs_test.py │ └── rendertest_spec.json ├── driver │ ├── driver.py │ └── mattersim_main.cpp └── lib_python │ └── MatterSimPython.cpp ├── include ├── Benchmark.hpp ├── cbf.h └── NavGraph.hpp ├── download.sh ├── scripts ├── timer.py ├── downsize_skybox.py ├── fill_depth.py ├── precompute_img_features.py └── depth_to_skybox.py ├── connectivity ├── README.md ├── scans.txt ├── gZ6f7yhEvPG_connectivity.json ├── YmJkqBEsHnH_connectivity.json ├── GdvgFV5R1Z5_connectivity.json └── 8194nk5LbLH_connectivity.json ├── LICENSE ├── Dockerfile ├── CMakeLists.txt ├── README.md └── cmake └── Modules └── FindNumPy.cmake /sim_imgs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/agent/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/env/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/env/adj_dict/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | build 2 | data 3 | -------------------------------------------------------------------------------- /tasks/agent/pomdp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/data/load_weight/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/data/results/0/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/data/save_weight/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/env/img_features/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/env/nlp_features/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/env/r2r_dataset/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/agent/observation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/agent/observation/cv/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tasks/agent/observation/nlp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | app/R2Rdata 4 | app/connectivity 5 | app/data 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pybind11"] 2 | path = pybind11 3 | url = https://github.com/pybind/pybind11.git 4 | -------------------------------------------------------------------------------- /teaser.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/teaser.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | /data 3 | /build 4 | /doxygen 5 | /sim_imgs 6 | *.so 7 | *kdev4* 8 | *.caffemodel 9 | *.caffemodel.h5 10 | *.pyc 11 | *.out 12 | *.zip 13 | -------------------------------------------------------------------------------- /tasks/agent/observation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/tasks/agent/observation/.DS_Store -------------------------------------------------------------------------------- /webgl_imgs/5ZKStnWn8Zo_c76b52856e7c4f2a9a4419000c8e646a_4.13470589902238_-0.02922217527541366.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/5ZKStnWn8Zo_c76b52856e7c4f2a9a4419000c8e646a_4.13470589902238_-0.02922217527541366.png -------------------------------------------------------------------------------- /webgl_imgs/8194nk5LbLH_c9e8dc09263e4d0da77d16de0ecddd39_4.05504292862083_0.008533161479170466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/8194nk5LbLH_c9e8dc09263e4d0da77d16de0ecddd39_4.05504292862083_0.008533161479170466.png -------------------------------------------------------------------------------- /webgl_imgs/ARNzJeq3xxb_9a671e6915de4eb897f45fee8bf2031d_5.616355886953764_0.02583868533558965.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/ARNzJeq3xxb_9a671e6915de4eb897f45fee8bf2031d_5.616355886953764_0.02583868533558965.png -------------------------------------------------------------------------------- /webgl_imgs/cV4RVeZvu5T_1b321779a4374c2b952c51820daa9e6c_6.266463179566256_0.07914721704610106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/cV4RVeZvu5T_1b321779a4374c2b952c51820daa9e6c_6.266463179566256_0.07914721704610106.png -------------------------------------------------------------------------------- /webgl_imgs/17DRP5sb8fy_85c23efeaecd4d43a7dcd5b90137179e_2.551961945320492_0.008557380839564054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/17DRP5sb8fy_85c23efeaecd4d43a7dcd5b90137179e_2.551961945320492_0.008557380839564054.png -------------------------------------------------------------------------------- /webgl_imgs/1LXtFkjw3qL_187589bb7d4644f2943079fb949c0be9_1.8699330579409539_0.0004921836022802584.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/1LXtFkjw3qL_187589bb7d4644f2943079fb949c0be9_1.8699330579409539_0.0004921836022802584.png -------------------------------------------------------------------------------- /webgl_imgs/1pXnuDYAj8r_163d61ac7edb43fb958c5d9e69ae11ad_4.626331047551077_-0.02444352614304746.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/1pXnuDYAj8r_163d61ac7edb43fb958c5d9e69ae11ad_4.626331047551077_-0.02444352614304746.png -------------------------------------------------------------------------------- /webgl_imgs/29hnd4uzFmX_1576d62e7bbb45e8a5ef9e7bb37b1839_5.844119909926444_-0.0006838914039405167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/29hnd4uzFmX_1576d62e7bbb45e8a5ef9e7bb37b1839_5.844119909926444_-0.0006838914039405167.png -------------------------------------------------------------------------------- /webgl_imgs/2azQ1b91cZZ_3daad58ad53742038e50d62e91f84e7b_3.1736484087962933_0.016732869758208434.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/2azQ1b91cZZ_3daad58ad53742038e50d62e91f84e7b_3.1736484087962933_0.016732869758208434.png -------------------------------------------------------------------------------- /webgl_imgs/2n8kARJN3HM_94ac3cea52ec455993f8562f78da3be1_2.604601935142565_-0.0009188787844489273.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/2n8kARJN3HM_94ac3cea52ec455993f8562f78da3be1_2.604601935142565_-0.0009188787844489273.png -------------------------------------------------------------------------------- /webgl_imgs/5LpN3gDmAk7_bda8025f20404048a77381e9e0dc0ccf_5.325207878739601_-0.01083211073205187.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/5LpN3gDmAk7_bda8025f20404048a77381e9e0dc0ccf_5.325207878739601_-0.01083211073205187.png -------------------------------------------------------------------------------- /webgl_imgs/759xd9YjKW5_2343ef3bf04a4433af62f0d527d7512a_3.5451019786019264_-0.016938006310169448.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/759xd9YjKW5_2343ef3bf04a4433af62f0d527d7512a_3.5451019786019264_-0.016938006310169448.png -------------------------------------------------------------------------------- /webgl_imgs/7y3sRwLe3Va_9bbf903d50da4ffd9e5d1fb7c9f4d69b_1.7348660165523566_0.008361841032265524.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/7y3sRwLe3Va_9bbf903d50da4ffd9e5d1fb7c9f4d69b_1.7348660165523566_0.008361841032265524.png -------------------------------------------------------------------------------- /webgl_imgs/82sE5b5pLXE_056a491afa534b17bac36f4f5898462a_1.689393931320027_-0.0037883068413356496.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/82sE5b5pLXE_056a491afa534b17bac36f4f5898462a_1.689393931320027_-0.0037883068413356496.png -------------------------------------------------------------------------------- /webgl_imgs/8WUmhLawc2A_d21aae0b5d944f27a0074525c803fc9f_3.047458184407221_-0.04510889155759994.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/8WUmhLawc2A_d21aae0b5d944f27a0074525c803fc9f_3.047458184407221_-0.04510889155759994.png -------------------------------------------------------------------------------- /webgl_imgs/B6ByNegPMKs_e3a65955df26467581c32613c4e9f865_5.230794959607039_0.007265625492957138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/B6ByNegPMKs_e3a65955df26467581c32613c4e9f865_5.230794959607039_0.007265625492957138.png -------------------------------------------------------------------------------- /webgl_imgs/b8cTxDM8gDG_f2944e0b66b9461994a7f757582f9bc3_0.0853092784395515_-0.007543204141144086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/b8cTxDM8gDG_f2944e0b66b9461994a7f757582f9bc3_0.0853092784395515_-0.007543204141144086.png -------------------------------------------------------------------------------- /webgl_imgs/2t7WUuJeko7_529f006f8293406da0b506defd2891a5_0.032985516949381344_-0.013788837143969411.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/2t7WUuJeko7_529f006f8293406da0b506defd2891a5_0.032985516949381344_-0.013788837143969411.png -------------------------------------------------------------------------------- /webgl_imgs/5q7pvUzZiYa_397403366d784caf804d741f32fd68b9_2.8746465006968234_-0.0007063598518199811.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/5q7pvUzZiYa_397403366d784caf804d741f32fd68b9_2.8746465006968234_-0.0007063598518199811.png -------------------------------------------------------------------------------- /webgl_imgs/ac26ZMwG7aT_efeef7cc82c84690addb0bf415f075ea_0.07434352566701552_-0.013447513736072197.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYCU-MLLab/AVAST_Attentive_Variational_State_Tracker_for_Vision-and-Language-Navigation/HEAD/webgl_imgs/ac26ZMwG7aT_efeef7cc82c84690addb0bf415f075ea_0.07434352566701552_-0.013447513736072197.png -------------------------------------------------------------------------------- /src/lib/vertex.sh: -------------------------------------------------------------------------------- 1 | R""( 2 | #version 120 3 | 4 | attribute vec3 vertex; 5 | varying vec3 texCoord; 6 | varying vec4 camCoord; 7 | uniform mat4 ProjMat; 8 | uniform mat4 ModelViewMat; 9 | 10 | void main() { 11 | camCoord = ModelViewMat * vec4(vertex, 1.0); 12 | gl_Position = ProjMat * camCoord; 13 | texCoord = vertex; 14 | } 15 | )"" 16 | -------------------------------------------------------------------------------- /src/lib/fragment.sh: -------------------------------------------------------------------------------- 1 | R""( 2 | #version 120 3 | 4 | varying vec3 texCoord; 5 | varying vec4 camCoord; 6 | uniform samplerCube cubemap; 7 | const vec3 camlook = vec3( 0.0, 0.0, -1.0 ); 8 | uniform bool isDepth; 9 | 10 | void main (void) { 11 | vec4 color = textureCube(cubemap, texCoord); 12 | if (isDepth) { 13 | float scale = dot(camCoord.xyz, camlook) / length(camCoord.xyz); 14 | gl_FragColor = color*scale; 15 | } else { 16 | gl_FragColor = color; 17 | } 18 | } 19 | )"" 20 | -------------------------------------------------------------------------------- /web/app/js/RequestAnimationFrame.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides requestAnimationFrame in a cross browser way. 3 | * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 4 | */ 5 | 6 | if ( !window.requestAnimationFrame ) { 7 | 8 | window.requestAnimationFrame = ( function() { 9 | 10 | return window.webkitRequestAnimationFrame || 11 | window.mozRequestAnimationFrame || 12 | window.oRequestAnimationFrame || 13 | window.msRequestAnimationFrame || 14 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { 15 | 16 | window.setTimeout( callback, 1000 / 60 ); 17 | 18 | }; 19 | 20 | } )(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /include/Benchmark.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MATTERSIM_BENCHMARK 2 | #define MATTERSIM_BENCHMARK 3 | 4 | #include 5 | 6 | namespace mattersim { 7 | 8 | class Timer { 9 | public: 10 | Timer(); 11 | virtual void Start(); 12 | virtual void Stop(); 13 | virtual void Reset(); 14 | virtual float MilliSeconds(); 15 | virtual float MicroSeconds(); 16 | virtual float Seconds(); 17 | inline bool running() { return running_; } 18 | 19 | protected: 20 | bool running_; 21 | std::chrono::steady_clock::time_point start_; 22 | std::chrono::steady_clock::duration elapsed_; 23 | }; 24 | } 25 | 26 | #endif // MATTERSIM_BENCHMARK 27 | -------------------------------------------------------------------------------- /src/test/python_test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('build') 3 | 4 | from MatterSim import Simulator 5 | import math 6 | import cv2 7 | import json 8 | import numpy as np 9 | 10 | 11 | sim = Simulator() 12 | sim.setCameraResolution(500, 300) 13 | sim.setCameraVFOV(math.radians(60)) 14 | sim.setElevationLimits(math.radians(-40),math.radians(50)) 15 | sim.initialize() 16 | 17 | with open("src/test/rendertest_spec.json") as f: 18 | spec = json.load(f) 19 | for tc in spec[:1]: 20 | sim.newEpisode(tc["scanId"], tc["viewpointId"], tc["heading"], tc["elevation"]) 21 | state = sim.getState() 22 | im = np.array(state.rgb, copy=False) 23 | imgfile = tc["reference_image"] 24 | cv2.imwrite("sim_imgs/"+imgfile, im); 25 | cv2.imshow('rendering', im) 26 | cv2.waitKey(0) 27 | 28 | 29 | -------------------------------------------------------------------------------- /download.sh: -------------------------------------------------------------------------------- 1 | # r2r dataset 2 | wget https://www.dropbox.com/s/hh5qec8o5urcztn/R2R_train.json -P tasks/env/r2r_dataset/ 3 | wget https://www.dropbox.com/s/8ye4gqce7v8yzdm/R2R_val_seen.json -P tasks/env/r2r_dataset/ 4 | wget https://www.dropbox.com/s/p6hlckr70a07wka/R2R_val_unseen.json -P tasks/env/r2r_dataset/ 5 | wget https://www.dropbox.com/s/w4pnbwqamwzdwd1/R2R_test.json -P tasks/env/r2r_dataset/ 6 | pip3 install gdown 7 | gdown --id 1Wlhp87sjUyhUuVSarrH22VXw7zOVvCfw 8 | mv R2R_data_augmentation_paths.json tasks/env/r2r_dataset/R2R_train_aug.json 9 | 10 | # resnet 11 | wget https://www.dropbox.com/s/o57kxh2mn5rkx4o/ResNet-152-imagenet.zip -P tasks/env/img_features/ 12 | unzip tasks/env/img_features/ResNet-152-imagenet.zip -d tasks/env/img_features/ 13 | 14 | # glove 15 | wget https://nlp.stanford.edu/data/glove.6B.zip -P tasks/env/nlp_features/ 16 | unzip -j tasks/env/nlp_features/glove.6B.zip glove.6B.300d.txt -d tasks/env/nlp_features/ 17 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "version": "1.0.0", 4 | "description": "This directory contains Amazon Mechanical Turk interfaces for collecting and evaluating navigation instructions, plus code for visualizing and saving first-person trajectories and floorplans", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Peter Anderson", 10 | "license": "MIT", 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/peteanderson80/Matterport3DSimulator" 14 | }, 15 | "devDependencies": { 16 | "browser-sync": "^2.26.3", 17 | "gulp": "^3.9.1", 18 | "gulp-babel-minify": "^0.5.0", 19 | "gulp-cssnano": "^2.1.3", 20 | "gulp-if": "^2.0.2", 21 | "gulp-useref": "^3.1.5", 22 | "run-sequence": "^2.2.1" 23 | }, 24 | "dependencies": { 25 | "del": "^3.0.0", 26 | "gulp-cache": "^1.0.2" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /include/cbf.h: -------------------------------------------------------------------------------- 1 | // NYU Depth V2 Dataset Matlab Toolbox 2 | // Authors: Nathan Silberman, Pushmeet Kohli, Derek Hoiem, Rob Fergus 3 | 4 | #ifndef CBF_H_ 5 | #define CBF_H_ 6 | 7 | #include 8 | 9 | namespace cbf { 10 | 11 | // Filters the given depth image using a Cross Bilateral Filter. 12 | // 13 | // Args: 14 | // height - height of the images. 15 | // width - width of the images. 16 | // depth - HxW row-major ordered matrix. 17 | // intensity - HxW row-major ordered matrix. 18 | // mask - HxW row-major ordered matrix. 19 | // result - HxW row-major ordered matrix. 20 | // num_scales - the number of scales at which to perform the filtering. 21 | // sigma_s - the space sigma (in pixels) 22 | // sigma_r - the range sigma (in intensity values, 0-1) 23 | void cbf(int height, int width, uint8_t* depth, uint8_t* intensity, 24 | uint8_t* mask, uint8_t* result, unsigned num_scales, double* sigma_s, 25 | double* sigma_r); 26 | 27 | } // namespace 28 | 29 | #endif // CBF_H_ 30 | -------------------------------------------------------------------------------- /scripts/timer.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Fast R-CNN 3 | # Copyright (c) 2015 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Ross Girshick 6 | # -------------------------------------------------------- 7 | 8 | import time 9 | 10 | class Timer(object): 11 | """A simple timer.""" 12 | def __init__(self): 13 | self.total_time = 0. 14 | self.calls = 0 15 | self.start_time = 0. 16 | self.diff = 0. 17 | self.average_time = 0. 18 | 19 | def tic(self): 20 | # using time.time instead of time.clock because time time.clock 21 | # does not normalize for multithreading 22 | self.start_time = time.time() 23 | 24 | def toc(self, average=True): 25 | self.diff = time.time() - self.start_time 26 | self.total_time += self.diff 27 | self.calls += 1 28 | self.average_time = self.total_time / self.calls 29 | if average: 30 | return self.average_time 31 | else: 32 | return self.diff 33 | -------------------------------------------------------------------------------- /connectivity/README.md: -------------------------------------------------------------------------------- 1 | ## connectivity 2 | Connectivity graphs indicating the navigable paths between viewpoints in each scan. 3 | 4 | Each json file contains an array of annotations, one for each viewpoint in the scan. All annotations share the same basic structure as follows: 5 | 6 | ``` 7 | { 8 | "image_id": str, 9 | "pose": [float x 16], 10 | "included": boolean, 11 | "visible": [boolean x num_viewpoints], 12 | "unobstructed": [boolean x num_viewpoints], 13 | "height": float 14 | } 15 | ``` 16 | - `image_id`: matterport skybox prefix 17 | - `pose`: 4x4 matrix in row major order that transforms matterport skyboxes to global coordinates (z-up). Pose matrices are based on the assumption that the camera is facing skybox image 3. 18 | - `included`: whether viewpoint is included in the simulator. Some overlapping viewpoints are excluded. 19 | - `visible`: indicates other viewpoints that can be seen from this viewpoint. 20 | - `unobstructed`: indicates transitions to other viewpoints that are considered navigable for an agent. 21 | - `height`: estimated height of the viewpoint above the floor. Not required for the simulator. 22 | 23 | Units are in metres. 24 | 25 | `scans.txt` contains a list of all the scan ids in the dataset. 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Peter Anderson, Philip Roberts, Qi Wu, Damien Teney, Jake Bruce 4 | Mark Johnson, Niko Sunderhauf, Ian Reid, Stephen Gould, Anton van den Hengel 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/test/python_vs_threejs_test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('build') 3 | 4 | from MatterSim import Simulator 5 | import math 6 | import cv2 7 | import json 8 | import numpy as np 9 | 10 | from os import listdir 11 | from os.path import isfile, join 12 | 13 | # Download some images using web/app/trajectory.html, then recreate identical images with this script 14 | 15 | 16 | sim = Simulator() 17 | sim.setCameraResolution(1140, 650) 18 | sim.setCameraVFOV(math.radians(80)) 19 | sim.setElevationLimits(math.radians(-40),math.radians(50)) 20 | sim.initialize() 21 | 22 | 23 | download_path = '.' 24 | threejs_files = [f for f in listdir(download_path) if 'threejs' in f and isfile(join(download_path, f))] 25 | 26 | for f in threejs_files: 27 | print f 28 | s = f.split("_") 29 | scanId = s[1] 30 | viewpointId = s[2] 31 | heading = float(s[3]) 32 | elevation = float(s[4].replace('.png','')) 33 | sim.newEpisode([scanId], [viewpointId], [heading], [elevation]) 34 | state = sim.getState() 35 | pyim = np.array(state[0].rgb, copy=False) 36 | cv2.imwrite(f.replace('threejs','python-1'), pyim); 37 | jsim = cv2.imread(f) 38 | im = cv2.addWeighted(jsim, 0.5, pyim, 0.5, 0) 39 | 40 | cv2.imshow('ThreeJS', jsim) 41 | cv2.imshow('Python', pyim) 42 | cv2.imshow('Blend', im) 43 | cv2.waitKey(0) 44 | 45 | 46 | -------------------------------------------------------------------------------- /web/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Matterport3D Simulator Web Tools 7 | 8 | 9 | 12 | 13 | 14 | 15 |
16 |