LoginSignup
10
10

More than 5 years have passed since last update.

PlaneNetで画像から深度マップを推定する

Last updated at Posted at 2018-05-28

PlaneNetは、単一のRGB画像から区分平面深度マップを復元するディープニューラルネットワークです。

実行環境

Ubuntu 16.04.4

Python 2.7.12

opencv-python 3.4.1.15

tensorflow 1.8.0

ソースコード

https://github.com/art-programmer/PlaneNet

論文

https://arxiv.org/pdf/1804.06278.pdf

コンパイルから推定まで

ソースコードをクローンする。

git clone https://github.com/art-programmer/PlaneNet.git

crfasrnnをコンパイルする。

cd PlaneNet/crfasrnn
sh compile.sh
cd ..

モデルを学習する際に、損失関数を計算するためにnndistanceをコンパイルする必要がある。ただしmakefileに記述されたtensorflowのパスを、実際に使用するtensorflowのパスに書き換えておく必要がある。

cd nndistance
make
cd ..

今回はあらかじめ用意された学習済みデータを利用した。PlaneNetフォルダ下にcheckpointフォルダを作成し、checkpointフォルダにダウンロードした学習済みデータを置く。

my_imagesフォルダ下に深度推定したい任意の画像ファイルを置く。

python predict.py --customImageFolder=my_images/

PlaneNetフォルダ下のpredictフォルダに結果が出力される。

0_depth_pred_0.png
0_image.png
0_segmentation_pred_0.png
0_segmentation_pred_blended_0.png
index.html
results_0.npy

入力画像

0_image.png

平面セグメンテージョン

0_segmentation_pred_0.png

0_segmentation_pred_blended_0.png

深度マップ

0_depth_pred_0.png

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10