README.md 5.06 KB
Newer Older
1
2
3
4
![No Maintenance Intended](https://img.shields.io/badge/No%20Maintenance%20Intended-%E2%9C%95-red.svg)
![TensorFlow Requirement: 1.x](https://img.shields.io/badge/TensorFlow%20Requirement-1.x-brightgreen)
![TensorFlow 2 Not Supported](https://img.shields.io/badge/TensorFlow%202%20Not%20Supported-%E2%9C%95-red.svg)

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Cognitive Mapping and Planning for Visual Navigation
**Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, Jitendra Malik**

**Computer Vision and Pattern Recognition (CVPR) 2017.**

**[ArXiv](https://arxiv.org/abs/1702.03920), 
[Project Website](https://sites.google.com/corp/view/cognitive-mapping-and-planning/)**

### Citing
If you find this code base and models useful in your research, please consider
citing the following paper:
  ```
  @inproceedings{gupta2017cognitive,
    title={Cognitive Mapping and Planning for Visual Navigation},
    author={Gupta, Saurabh and Davidson, James and Levine, Sergey and
      Sukthankar, Rahul and Malik, Jitendra},
    booktitle={CVPR},
    year={2017}
  }
  ```

### Contents
1.  [Requirements: software](#requirements-software)
2.  [Requirements: data](#requirements-data)
Saurabh Gupta's avatar
Saurabh Gupta committed
29
3.  [Test Pre-trained Models](#test-pre-trained-models)
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
4.  [Train your Own Models](#train-your-own-models)

### Requirements: software
1.  Python Virtual Env Setup: All code is implemented in Python but depends on a
    small number of python packages and a couple of C libraries. We recommend
    using virtual environment for installing these python packages and python
    bindings for these C libraries.
      ```Shell
      VENV_DIR=venv
      pip install virtualenv
      virtualenv $VENV_DIR
      source $VENV_DIR/bin/activate
      
      # You may need to upgrade pip for installing openv-python.
      pip install --upgrade pip
      # Install simple dependencies.
      pip install -r requirements.txt

      # Patch bugs in dependencies.
      sh patches/apply_patches.sh
      ```

2.  Install [Tensorflow](https://www.tensorflow.org/) inside this virtual
Saurabh Gupta's avatar
Saurabh Gupta committed
53
54
    environment. You will need to use one of the latest nightly builds 
    (see instructions [here](https://github.com/tensorflow/tensorflow#installation)).
55
56
57
58
59
60
61
62
63
64

3.  Swiftshader: We use
    [Swiftshader](https://github.com/google/swiftshader.git), a CPU based
    renderer to render the meshes.  It is possible to use other renderers,
    replace `SwiftshaderRenderer` in `render/swiftshader_renderer.py` with
    bindings to your renderer. 
    ```Shell
    mkdir -p deps
    git clone --recursive https://github.com/google/swiftshader.git deps/swiftshader-src
    cd deps/swiftshader-src && git checkout 91da6b00584afd7dcaed66da88e2b617429b3950
65
    git submodule update
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
    mkdir build && cd build && cmake .. && make -j 16 libEGL libGLESv2
    cd ../../../
    cp deps/swiftshader-src/build/libEGL* libEGL.so.1
    cp deps/swiftshader-src/build/libGLESv2* libGLESv2.so.2
    ```

4.  PyAssimp: We use [PyAssimp](https://github.com/assimp/assimp.git) to load
    meshes.  It is possible to use other libraries to load meshes, replace
    `Shape` `render/swiftshader_renderer.py` with bindings to your library for
    loading meshes. 
    ```Shell
    mkdir -p deps
    git clone https://github.com/assimp/assimp.git deps/assimp-src
    cd deps/assimp-src
    git checkout 2afeddd5cb63d14bc77b53740b38a54a97d94ee8
    cmake CMakeLists.txt -G 'Unix Makefiles' && make -j 16
    cd port/PyAssimp && python setup.py install
    cd ../../../..
    cp deps/assimp-src/lib/libassimp* .
    ```

5.  graph-tool: We use [graph-tool](https://git.skewed.de/count0/graph-tool)
    library for graph processing.
    ```Shell
    mkdir -p deps
    # If the following git clone command fails, you can also download the source
    # from https://downloads.skewed.de/graph-tool/graph-tool-2.2.44.tar.bz2
    git clone https://git.skewed.de/count0/graph-tool deps/graph-tool-src
    cd deps/graph-tool-src && git checkout 178add3a571feb6666f4f119027705d95d2951ab
    bash autogen.sh
    ./configure --disable-cairo --disable-sparsehash --prefix=$HOME/.local
    make -j 16
    make install
    cd ../../
    ```

### Requirements: data
Adnan's avatar
Adnan committed
103
1.  Download the Stanford 3D Indoor Spaces Dataset (S3DIS Dataset) and ImageNet
104
105
106
107
    Pre-trained models for initializing different models. Follow instructions in
    `data/README.md`

### Test Pre-trained Models
Saurabh Gupta's avatar
Saurabh Gupta committed
108
1.  Download pre-trained models. See `output/README.md`.
109
110
111
112
113

2.  Test models using `scripts/script_test_pretrained_models.sh`.

### Train Your Own Models
All models were trained asynchronously with 16 workers each worker using data
Junwei Pan's avatar
Junwei Pan committed
114
from a single floor. The default hyper-parameters correspond to this setting.
115
116
117
118
119
120
121
122
123
124
125
126
127
See [distributed training with
Tensorflow](https://www.tensorflow.org/deploy/distributed) for setting up
distributed training. Training with a single worker is possible with the current
code base but will require some minor changes to allow each worker to load all
training environments.

### Contact
For questions or issues open an issue on the tensorflow/models [issues
tracker](https://github.com/tensorflow/models/issues). Please assign issues to
@s-gupta.

### Credits
This code was written by Saurabh Gupta (@s-gupta).