Git Product home page Git Product logo

monodepth-cpp's Introduction

monodepth-cpp

Tensorflow C++ implementation for single image depth estimation

The original work is implemented in Python, click here to go to their repo. Please cite their work if your find it helpful.

It is using pointer-to-implementation technique, so that you can use it in your project without worrying the actual implementation. Refer to src/inference_monodepth.cpp for more information

The C++ version is about 28fps, in comparison with Python's 13fps, tested with i7 processor and NVidia 1070 graphics laptop.

Related repo

If you are looking for single-image relative depth prediction, feel free to check out my other repo, MiDaS-cpp, a PyTorch C++ implementation of MiDaS.

Personal projects that use monodepth-cpp

  1. CNN-SVO

  1. Reproducing Deep virtual stereo odometry

NOTE: Because DVSO uses both the left disparity and the right disparity outputs (for left-right consistency check), it requires some modifications in the source code to enable the disparities outputs.

Requirements

  1. You are required to build Tensorflow library from source, see here
  2. Freeze the Tensorflow graph (with known input and output names)

Configure CMake project

  • Make sure you have the compatible versions of Eigen, Protobuf, and Tensorflow (Mine: Eigen 3.3.4; Protobuf 2.6.1-1.3; Tensorflow 1.6)
  • You will also notice some hard-coded paths to include directories and libraries, modify them accordingly
    • CMakeLists.txt (local built Eigen library)
    • CMakeModules.cmake (path to '.so' file and 'include' directories; make sure your program source the library and header files)

Build (static/shared) library

mkdir build && mkdir install
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/monodepth-cpp/install ..
make && make install

You will be seeing 'include' and 'lib' folders in the 'install' folder, import them in your project

To test if Monodepth C++ is working properly,

cd build
./inference_monodepth

NOTE: Select either static or shared library in CMakeLists.txt, unless you want both of them

Use (static/shared) library

In your own CMakeLists.txt project, do the following:

set(monodepth_INCLUDE_DIRS /path/to/monodepth-cpp/install/include)
INCLUDE_DIRECTORIES(
  ...
  monodepth_INCLUDE_DIRS
  ...
)

TARGET_LINK_LIBRARIES(awesome_exe /path/to/tensorflow/library/libtensorflow_all.so) # Only if you are using the provided instructions
TARGET_LINK_LIBRARIES(awesome_exe /path/to/monodepth-cpp/install/lib/libmonodepth_static.a) # if you are using static library

monodepth-cpp's People

Contributors

yan99033 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.