Giter VIP home page Giter VIP logo

google / stereo-magnification Goto Github PK

View Code? Open in Web Editor NEW
384.0 22.0 90.0 1.37 MB

Code accompanying the SIGGRAPH 2018 paper "Stereo Magnification: Learning View Synthesis using Multiplane Images"

Home Page: https://people.eecs.berkeley.edu/~tinghuiz/projects/mpi/

License: Apache License 2.0

Python 99.22% Shell 0.78%
view-synthesis deep-learning multiplane-images stereo-magnification computer-vision computer-graphics

stereo-magnification's Introduction

Stereo Magnification: Learning View Synthesis using Multiplane Images

This code accompanies the paper

Stereo Magnification: Learning View Synthesis using Multiplane Images
Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, Noah Snavely
SIGGRAPH 2018

Please note that this is not an officially supported Google product.

Training the MPI model

The entry python script for training is train.py. The input flags are specified in two places: 1) train.py and 2) stereomag/loader.py.

The input flag which_color_pred specifies how to predict the color image at each MPI plane:

bg [default] - Our default model. The network predicts: 1) weights for blending the background and foreground (reference source image) color images at each plane, 2) the alphas at each plane. 3) a background color image fgbg - Instead of using the reference source as the foreground image, the network predicts an extra foreground image for blending with the background alpha_only - No color image (or blending weights) is predicted by the network. The reference source image is used as the color image at each MPI plane. single - The network predicts a single color image shared for all MPI planes. all - The network directly outputs the color image at each MPI plane.

You can also specify which loss to use for training: pixel or vgg (i.e., the perceptual loss as measured by differences in VGG features). Note that when using the VGG loss, you will need to download the pre-trained VGG model imagenet-vgg-verydeep-19.mat available at

http://www.vlfeat.org/matconvnet/pretrained/#downloading-the-pre-trained-models

The path to this file can be set by the vgg_model_file flag in train.py.

Testing the MPI model

The entry python script for testing the models is test.py.

One could specify what to output to disk by concatenating one or more of the following (e.g. with '_'): src_images, ref_image, tgt_image, psv, fgbg, poses, intrinsics, blend_weights, rgba_layers.

psv - the plane sweep volume used as input to the network. fgbg - foreground and background color images (only valid when which_color_pred is either fgbg or bg) blend_weights - weights for blending foreground and backgroud color images (only valid when which_color_pred is either fgbg or bg)

Quantitative evaluation

evaluate.py contains sample code for evaluating the view synthesis performance based on the SSIM and PSNR metrics. It assumes that each scene result folder contains a ground-truth target image tgt_image_*.png and the synthesized image output_image_*.png. The script will output a text file summarizing the metrics inside the folder FLAGS.result_root.

Pre-trained models from SIGGRAPH'18 paper

Our pre-trained model can be downloaded into the models subdirectory by running the script bash scripts/download_model.sh.

Running the model on a single image pair

To run a trained model on a single image pair to generate an MPI, use mpi_from_images.py. This tool assumes images with the same orientation (as with a rectified stereo pair), but allows for specifying the (x, y, z) offset between the images.

You can find example input stereo pairs and command lines for generating results in the examples directory.

(You must first download the pretrained model or train your own model and place in the models/ subdirectory)

Reference examples and results

For reference, you can find additional example input stereo pairs, as well as corresponding output multi-plane images and view synthesis results used in the paper in this Google drive link (772 MB).

RealEstate10K dataset

We have released the RealEstate10K dataset suitable for training and testing the MPI model. Note that due to data restrictions, this is not the same version used in our SIGGRAPH'18 paper. However, we are working on updating the results using this public version.

stereo-magnification's People

Contributors

hi-zhengcheng avatar puneetkohli avatar snaves avatar tinghuiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stereo-magnification's Issues

about the random_seed

I download the pretrained model, and run test.py, but I got the same src_1 and tgt_image. This means that the ground truth(tgt_image) is the same as src_1 image (have the same timestamp). I think this may be a problem with random seeds.
My python is 2.7, tensorflow 1.10-gpu

AssertionError

Hello! thank you for the wonderfull work! I am trying to train StereoMag, but I met an assertion error. It's like tensorflow function tf.gfile.Glob Cannot read files that are in a folder considering of more than 4 files, and I tried to install "google-perftools". However I still receive errors .

Exception has occurred: AssertionError
File "/home/tuxiang/Documents/weijunyu/stereo-magnification/stereomag/loader.py", line 201, in create_from_flags
assert tf.gfile.Glob(cameras_glob)
File "/home/tuxiang/Documents/weijunyu/stereo-magnification/stereomag/sequence_data_loader.py", line 51, in init
map_function=map_function)
File "/home/tuxiang/Documents/weijunyu/stereo-magnification/train.py", line 81, in main
FLAGS.random_seed)
File "/home/tuxiang/Documents/weijunyu/stereo-magnification/train.py", line 94, in
tf.app.run()

one issues

hi, i want to say one issues.

i try to run this program,
in stereomag/loader.py , 178 line ,
" sequences_with_images = sequence_with_images.map"
I suspect something is wrong here.

Is it "sequence_with_images" not miss written?

Your favorite fans! Looking forward to your reply.!

Problem running example

Hello, thanks for putting the code here on github. I have been trying to run the examples, however I have got the following error: Error reported to Coordinator: <type 'exceptions.ValueError'>, Can't load save_path when it is None. Traceback (most recent call last): File "./mpi_from_images.py", line 362, in <module> tf.app.run() File "/home/daniel/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/daniel/.local/lib/python2.7/site-packages/absl/app.py", line 300, in run _run_main(main, args) File "/home/daniel/.local/lib/python2.7/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "./mpi_from_images.py", line 282, in main saver.restore(sess, ckpt_file) File "/home/daniel/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1274, in restore raise ValueError("Can't load save_path when it is None.") ValueError: Can't load save_path when it is None.

About timestamps in RealEstate Dataset

Hi, I'm trying to retrieve frames from Youtube links on the first line of txt files. I downloaded videos and use opencv-python to read and match frame timestamps:
video = cv2.VideoCapture(path) video.set(cv2.CAP_PROP_POS_MSEC, 0) while video.isOpened(): frame_exists, curr_frame = video.read() video_timestamp = (int)(round(video.get(cv2.CAP_PROP_POS_MSEC)*1000))
Then I found that not all of the timestamps in txt files match with video timestamps. They sometimes have an error in the order of 100 microsecond or 1 millisecond. Am I doing something wrong?
Looking forward to your help. Thank you!

Distance between camera and each plane?

Thanks for sharing this great project!
Is there a way to print out the distance between each plane of the multiplane image and the camera?
For example, I'd like to know how far away from the camera mpi_rgb_12.png is. This would be really helpful for setting up all the planes in a compositing program like After Effects.

Dual Pair images to use

Hello, thanks for releasing this solution free of charge :)) . However, I have been running into problems in using your application. I read in your paper that you used the dual lens of an Iphone X, that has a telephoto lens and a wide-angle lens, and an app to crop the wide angle image automatically (from what I inferred from your paper). I ran in a quite similar setup, however i have been trying to manually crop the image. I ran into poor results when I ran your algorithm and I suspect that it could be because of problems in cropping. Which did you use to crop the images?

About input camera files

Hi, I have a question about the input camera files of train.py and test.py.
What does the program take as input camera files?
I am thinking that three 4x4 matrices should be provided for each training data, is that right?
Could you help me with that? Thank you very much.

Training stereo Magnification

Hello, thank you for the wonderfull work. I was trying to train the stereo magnification algorithm on my own using the train script. However, to do this it needs an image directory. I assumed that in your dataset(RealEstate10K) there would be the images, however, it only has the camera poses. How can I obtain the images so that I can try my model so that it reproduces the conditions of your paper?

Fail to train VGG loss

Hi,

I can sucessfully train the pixel loss but failed at VGG loss (output images are black). The command I used to train VGG loss is

python train.py --cameras_glob=RealEstate10K/sample_dataset/camera_params/train/*txt \
--image_dir=RealEstate10K/sample_dataset/train --experiment_name=debug_vgg_loss --which_loss=vgg --batch_size=4 \
--vgg_model_file=imagenet-vgg-verydeep-19.mat --learning_rate=5e-5

The loss seems to descent normally. During the training process, most output images visualized by tensorboard are black while some are normal. I have tried to adjust different learning rates (1e-4, 5e-5, etc.) but it is still not working. Is there any special guideline to train the vgg loss? Thanks.

Units for x/y/z offset

Hi,

I'm not able to generate the expected output from sample images I have. I suspect my camera offsets are incorrect. May I know:

  1. What are the units, are they in meters?
  2. Is there any limitation (max/min) for the x offset?

Thanks!

MPI without camera parameters?

If we do not have the Camera parameters, and just a rectified stereo pair (no knowledge of where the stereo pair came from) -- what would the best values be to use for fx and fy?

Or is there a modification to the network/model we can make that assumes the cameras are rectified.

Shifting image2 to image1

Hello guys, I just start reading the code of this repo and I can see that the first processing step is to shift source image(img2) to reference image(image1) by xshift and yshift. My question is: why we have to do that ? I have tried to find the reason on the paper but I found no explanation.

Also, do you shift img2 during training or is this just for the testing/evaluation ?

How to train with a small subset of data

Hello,
I am trying to train StereoMag on a small subset of data. After reading some issues, I manually copy images into the 'images' folder and the pose txt files into the 'train' folder. However I still receive errors about not finding the image.

/home/phong/anaconda3/envs/tf/bin/python /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:95: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:73: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

W0625 16:59:12.527784 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:73: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:73: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

W0625 16:59:12.527893 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:73: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:74: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.

W0625 16:59:12.527972 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:74: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:76: The name tf.gfile.IsDirectory is deprecated. Please use tf.io.gfile.isdir instead.

W0625 16:59:12.528266 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/train.py:76: The name tf.gfile.IsDirectory is deprecated. Please use tf.io.gfile.isdir instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:199: The name tf.gfile.ListDirectory is deprecated. Please use tf.io.gfile.listdir instead.

W0625 16:59:12.528413 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:199: The name tf.gfile.ListDirectory is deprecated. Please use tf.io.gfile.listdir instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:202: The name tf.gfile.Glob is deprecated. Please use tf.io.gfile.glob instead.

W0625 16:59:12.528539 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:202: The name tf.gfile.Glob is deprecated. Please use tf.io.gfile.glob instead.

WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

W0625 16:59:12.560676 139863278913344 lazy_loader.py:50] 
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:221: substr_deprecated (from tensorflow.python.ops.string_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.strings.substr` instead of `tf.substr`.
W0625 16:59:12.625285 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:221: substr_deprecated (from tensorflow.python.ops.string_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.strings.substr` instead of `tf.substr`.
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:225: get_single_element (from tensorflow.contrib.data.python.ops.get_single_element) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.data.experimental.get_single_element(...)`.
W0625 16:59:12.630602 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:225: get_single_element (from tensorflow.contrib.data.python.ops.get_single_element) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.data.experimental.get_single_element(...)`.
WARNING:tensorflow:From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.decode_csv is deprecated. Please use tf.io.decode_csv instead.

W0625 16:59:12.668069 139863278913344 module_wrapper.py:139] From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.decode_csv is deprecated. Please use tf.io.decode_csv instead.

WARNING:tensorflow:From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.assert_equal is deprecated. Please use tf.compat.v1.assert_equal instead.

W0625 16:59:12.668372 139863278913344 module_wrapper.py:139] From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.assert_equal is deprecated. Please use tf.compat.v1.assert_equal instead.

WARNING:tensorflow:From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/data/util/random_seed.py:58: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0625 16:59:12.865559 139863278913344 deprecation.py:323] From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/data/util/random_seed.py:58: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
WARNING:tensorflow:From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0625 16:59:12.970447 139863278913344 module_wrapper.py:139] From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

/home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:127: UserWarning: Seed 8964 from outer graph might be getting used by function Dataset_map_<lambda>, if the random op has not been provided any seed. Explicitly set the seed in the function if this is not the intended behavior.
  lambda sequence: sequence.random_subsequence(sequence_length, min_stride, max_stride)
/home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:129: UserWarning: Seed 8964 from outer graph might be getting used by function Dataset_map_<lambda>, if the random op has not been provided any seed. Explicitly set the seed in the function if this is not the intended behavior.
  return subsequences.map(lambda sequence: sequence.random_reverse())
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:282: The name tf.read_file is deprecated. Please use tf.io.read_file instead.

W0625 16:59:13.434669 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:282: The name tf.read_file is deprecated. Please use tf.io.read_file instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:288: The name tf.image.resize_area is deprecated. Please use tf.compat.v1.image.resize_area instead.

W0625 16:59:13.462152 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:288: The name tf.image.resize_area is deprecated. Please use tf.compat.v1.image.resize_area instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:294: to_int64 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
W0625 16:59:13.468448 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:294: to_int64 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:186: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
W0625 16:59:13.666573 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:186: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:188: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
W0625 16:59:13.669369 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/datasets.py:188: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.cast` instead.
/home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:175: UserWarning: Seed 8964 from outer graph might be getting used by function Dataset_map_<lambda>, if the random op has not been provided any seed. Explicitly set the seed in the function if this is not the intended behavior.
  lambda sequence: sequence.random_scale_and_crop(
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:158: DatasetV1.output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
W0625 16:59:13.818846 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/loader.py:158: DatasetV1.output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
WARNING:tensorflow:From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.random_shuffle is deprecated. Please use tf.random.shuffle instead.

W0625 16:59:14.240071 139863278913344 module_wrapper.py:139] From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/autograph/converters/directives.py:119: The name tf.random_shuffle is deprecated. Please use tf.random.shuffle instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/sequence_data_loader.py:80: DatasetV1.make_one_shot_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_one_shot_iterator(dataset)`.
W0625 16:59:14.633376 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/sequence_data_loader.py:80: DatasetV1.make_one_shot_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_one_shot_iterator(dataset)`.
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:382: The name tf.matrix_inverse is deprecated. Please use tf.linalg.inv instead.

W0625 16:59:14.661119 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:382: The name tf.matrix_inverse is deprecated. Please use tf.linalg.inv instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/nets.py:35: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

W0625 16:59:15.526187 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/nets.py:35: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

WARNING:tensorflow:From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/contrib/layers/python/layers/layers.py:1057: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `layer.__call__` method instead.
W0625 16:59:15.527205 139863278913344 deprecation.py:323] From /home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/contrib/layers/python/layers/layers.py:1057: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `layer.__call__` method instead.
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/geometry/homography.py:50: The name tf.matrix_transpose is deprecated. Please use tf.linalg.matrix_transpose instead.

W0625 16:59:16.116310 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/geometry/homography.py:50: The name tf.matrix_transpose is deprecated. Please use tf.linalg.matrix_transpose instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:282: The name tf.trainable_variables is deprecated. Please use tf.compat.v1.trainable_variables instead.

W0625 16:59:16.317534 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:282: The name tf.trainable_variables is deprecated. Please use tf.compat.v1.trainable_variables instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:283: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.

W0625 16:59:16.317699 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:283: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:288: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.

W0625 16:59:18.578681 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:288: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:292: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.

W0625 16:59:18.580846 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:292: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:324: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead.

W0625 16:59:18.685431 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:324: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:325: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

W0625 16:59:18.686625 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:325: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:326: The name tf.model_variables is deprecated. Please use tf.compat.v1.model_variables instead.

W0625 16:59:18.686724 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:326: The name tf.model_variables is deprecated. Please use tf.compat.v1.model_variables instead.

WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:328: Supervisor.__init__ (from tensorflow.python.training.supervisor) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.MonitoredTrainingSession
W0625 16:59:18.718864 139863278913344 deprecation.py:323] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:328: Supervisor.__init__ (from tensorflow.python.training.supervisor) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.MonitoredTrainingSession
WARNING:tensorflow:Issue encountered when serializing global_step.
Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore.
'Tensor' object has no attribute 'to_proto'
W0625 16:59:19.144609 139863278913344 meta_graph.py:448] Issue encountered when serializing global_step.
Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore.
'Tensor' object has no attribute 'to_proto'
INFO:tensorflow:Running local_init_op.
I0625 16:59:20.314348 139863278913344 session_manager.py:500] Running local_init_op.
INFO:tensorflow:Done running local_init_op.
I0625 16:59:20.446702 139863278913344 session_manager.py:502] Done running local_init_op.
INFO:tensorflow:Starting standard services.
I0625 16:59:22.881247 139863278913344 supervisor.py:737] Starting standard services.
INFO:tensorflow:Starting queue runners.
I0625 16:59:22.986669 139863278913344 supervisor.py:743] Starting queue runners.
WARNING:tensorflow:From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:331: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.

W0625 16:59:22.986908 139863278913344 module_wrapper.py:139] From /home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py:331: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.

INFO:tensorflow:Trainable variables: 
I0625 16:59:22.986973 139863278913344 mpi.py:331] Trainable variables: 
INFO:tensorflow:net/conv1_1/weights:0
I0625 16:59:22.987037 139863278913344 mpi.py:333] net/conv1_1/weights:0
INFO:tensorflow:net/conv1_1/LayerNorm/beta:0
I0625 16:59:22.987086 139863278913344 mpi.py:333] net/conv1_1/LayerNorm/beta:0
INFO:tensorflow:net/conv1_1/LayerNorm/gamma:0
I0625 16:59:22.987126 139863278913344 mpi.py:333] net/conv1_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv1_2/weights:0
I0625 16:59:22.987163 139863278913344 mpi.py:333] net/conv1_2/weights:0
INFO:tensorflow:net/conv1_2/LayerNorm/beta:0
I0625 16:59:22.987200 139863278913344 mpi.py:333] net/conv1_2/LayerNorm/beta:0
INFO:tensorflow:net/conv1_2/LayerNorm/gamma:0
I0625 16:59:22.987236 139863278913344 mpi.py:333] net/conv1_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv2_1/weights:0
I0625 16:59:22.987272 139863278913344 mpi.py:333] net/conv2_1/weights:0
INFO:tensorflow:net/conv2_1/LayerNorm/beta:0
I0625 16:59:22.987308 139863278913344 mpi.py:333] net/conv2_1/LayerNorm/beta:0
INFO:tensorflow:net/conv2_1/LayerNorm/gamma:0
I0625 16:59:22.987345 139863278913344 mpi.py:333] net/conv2_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv2_2/weights:0
I0625 16:59:22.987381 139863278913344 mpi.py:333] net/conv2_2/weights:0
INFO:tensorflow:net/conv2_2/LayerNorm/beta:0
I0625 16:59:22.987417 139863278913344 mpi.py:333] net/conv2_2/LayerNorm/beta:0
INFO:tensorflow:net/conv2_2/LayerNorm/gamma:0
I0625 16:59:22.987453 139863278913344 mpi.py:333] net/conv2_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv3_1/weights:0
I0625 16:59:22.987488 139863278913344 mpi.py:333] net/conv3_1/weights:0
INFO:tensorflow:net/conv3_1/LayerNorm/beta:0
I0625 16:59:22.987525 139863278913344 mpi.py:333] net/conv3_1/LayerNorm/beta:0
INFO:tensorflow:net/conv3_1/LayerNorm/gamma:0
I0625 16:59:22.987561 139863278913344 mpi.py:333] net/conv3_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv3_2/weights:0
I0625 16:59:22.987598 139863278913344 mpi.py:333] net/conv3_2/weights:0
INFO:tensorflow:net/conv3_2/LayerNorm/beta:0
I0625 16:59:22.987634 139863278913344 mpi.py:333] net/conv3_2/LayerNorm/beta:0
INFO:tensorflow:net/conv3_2/LayerNorm/gamma:0
I0625 16:59:22.987669 139863278913344 mpi.py:333] net/conv3_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv3_3/weights:0
I0625 16:59:22.987706 139863278913344 mpi.py:333] net/conv3_3/weights:0
INFO:tensorflow:net/conv3_3/LayerNorm/beta:0
I0625 16:59:22.987742 139863278913344 mpi.py:333] net/conv3_3/LayerNorm/beta:0
INFO:tensorflow:net/conv3_3/LayerNorm/gamma:0
I0625 16:59:22.987778 139863278913344 mpi.py:333] net/conv3_3/LayerNorm/gamma:0
INFO:tensorflow:net/conv4_1/weights:0
I0625 16:59:22.987814 139863278913344 mpi.py:333] net/conv4_1/weights:0
INFO:tensorflow:net/conv4_1/LayerNorm/beta:0
I0625 16:59:22.987850 139863278913344 mpi.py:333] net/conv4_1/LayerNorm/beta:0
INFO:tensorflow:net/conv4_1/LayerNorm/gamma:0
I0625 16:59:22.987886 139863278913344 mpi.py:333] net/conv4_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv4_2/weights:0
I0625 16:59:22.987923 139863278913344 mpi.py:333] net/conv4_2/weights:0
INFO:tensorflow:net/conv4_2/LayerNorm/beta:0
I0625 16:59:22.987959 139863278913344 mpi.py:333] net/conv4_2/LayerNorm/beta:0
INFO:tensorflow:net/conv4_2/LayerNorm/gamma:0
I0625 16:59:22.987995 139863278913344 mpi.py:333] net/conv4_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv4_3/weights:0
I0625 16:59:22.988032 139863278913344 mpi.py:333] net/conv4_3/weights:0
INFO:tensorflow:net/conv4_3/LayerNorm/beta:0
I0625 16:59:22.988068 139863278913344 mpi.py:333] net/conv4_3/LayerNorm/beta:0
INFO:tensorflow:net/conv4_3/LayerNorm/gamma:0
I0625 16:59:22.988104 139863278913344 mpi.py:333] net/conv4_3/LayerNorm/gamma:0
INFO:tensorflow:net/conv6_1/weights:0
I0625 16:59:22.988140 139863278913344 mpi.py:333] net/conv6_1/weights:0
INFO:tensorflow:net/conv6_1/LayerNorm/beta:0
I0625 16:59:22.988176 139863278913344 mpi.py:333] net/conv6_1/LayerNorm/beta:0
INFO:tensorflow:net/conv6_1/LayerNorm/gamma:0
I0625 16:59:22.988212 139863278913344 mpi.py:333] net/conv6_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv6_2/weights:0
I0625 16:59:22.988248 139863278913344 mpi.py:333] net/conv6_2/weights:0
INFO:tensorflow:net/conv6_2/LayerNorm/beta:0
I0625 16:59:22.988284 139863278913344 mpi.py:333] net/conv6_2/LayerNorm/beta:0
INFO:tensorflow:net/conv6_2/LayerNorm/gamma:0
I0625 16:59:22.988320 139863278913344 mpi.py:333] net/conv6_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv6_3/weights:0
I0625 16:59:22.988356 139863278913344 mpi.py:333] net/conv6_3/weights:0
INFO:tensorflow:net/conv6_3/LayerNorm/beta:0
I0625 16:59:22.988392 139863278913344 mpi.py:333] net/conv6_3/LayerNorm/beta:0
INFO:tensorflow:net/conv6_3/LayerNorm/gamma:0
I0625 16:59:22.988428 139863278913344 mpi.py:333] net/conv6_3/LayerNorm/gamma:0
INFO:tensorflow:net/conv7_1/weights:0
I0625 16:59:22.988464 139863278913344 mpi.py:333] net/conv7_1/weights:0
INFO:tensorflow:net/conv7_1/LayerNorm/beta:0
I0625 16:59:22.988500 139863278913344 mpi.py:333] net/conv7_1/LayerNorm/beta:0
INFO:tensorflow:net/conv7_1/LayerNorm/gamma:0
I0625 16:59:22.988536 139863278913344 mpi.py:333] net/conv7_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv7_2/weights:0
I0625 16:59:22.988572 139863278913344 mpi.py:333] net/conv7_2/weights:0
INFO:tensorflow:net/conv7_2/LayerNorm/beta:0
I0625 16:59:22.988608 139863278913344 mpi.py:333] net/conv7_2/LayerNorm/beta:0
INFO:tensorflow:net/conv7_2/LayerNorm/gamma:0
I0625 16:59:22.988644 139863278913344 mpi.py:333] net/conv7_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv8_1/weights:0
I0625 16:59:22.988680 139863278913344 mpi.py:333] net/conv8_1/weights:0
INFO:tensorflow:net/conv8_1/LayerNorm/beta:0
I0625 16:59:22.988716 139863278913344 mpi.py:333] net/conv8_1/LayerNorm/beta:0
INFO:tensorflow:net/conv8_1/LayerNorm/gamma:0
I0625 16:59:22.988752 139863278913344 mpi.py:333] net/conv8_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv8_2/weights:0
I0625 16:59:22.988788 139863278913344 mpi.py:333] net/conv8_2/weights:0
INFO:tensorflow:net/conv8_2/LayerNorm/beta:0
I0625 16:59:22.988825 139863278913344 mpi.py:333] net/conv8_2/LayerNorm/beta:0
INFO:tensorflow:net/conv8_2/LayerNorm/gamma:0
I0625 16:59:22.988861 139863278913344 mpi.py:333] net/conv8_2/LayerNorm/gamma:0
INFO:tensorflow:net/color_pred/weights:0
I0625 16:59:22.988897 139863278913344 mpi.py:333] net/color_pred/weights:0
INFO:tensorflow:net/color_pred/biases:0
I0625 16:59:22.988933 139863278913344 mpi.py:333] net/color_pred/biases:0
INFO:tensorflow:parameter_count = 16892227
I0625 16:59:23.095938 139863278913344 mpi.py:334] parameter_count = 16892227
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.NotFoundError'>, 2 root error(s) found.
  (0) Not found:   images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
	 [[IteratorGetNext/_337]]
  (1) Not found:   images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
0 successful operations.
0 derived errors ignored.
I0625 16:59:28.644667 139863278913344 coordinator.py:224] Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.NotFoundError'>, 2 root error(s) found.
  (0) Not found:   images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
	 [[IteratorGetNext/_337]]
  (1) Not found:   images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
0 successful operations.
0 derived errors ignored.
Traceback (most recent call last):
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: 2 root error(s) found.
  (0) Not found: {{function_node __inference_Dataset_map_mapper_434}} {{function_node __inference_Dataset_map_load_single_image_417}} images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
	 [[IteratorGetNext/_337]]
  (1) Not found: {{function_node __inference_Dataset_map_mapper_434}} {{function_node __inference_Dataset_map_load_single_image_417}} images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/phong/data/Work/Paper3/Code/stereo-magnification/train.py", line 95, in <module>
    tf.app.run()
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/absl/app.py", line 299, in run
    _run_main(main, args)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "/home/phong/data/Work/Paper3/Code/stereo-magnification/train.py", line 91, in main
    FLAGS.summary_freq, FLAGS.save_latest_freq, FLAGS.max_steps)
  File "/home/phong/data/Work/Paper3/Code/stereo-magnification/stereomag/mpi.py", line 350, in train
    results = sess.run(fetches)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 956, in run
    run_metadata_ptr)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
    run_metadata)
  File "/home/phong/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: 2 root error(s) found.
  (0) Not found:   images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
	 [[IteratorGetNext/_337]]
  (1) Not found:   images//YQT_uu1UsRI/YQT_uu1UsRI_328027700.jpg; No such file or directory
	 [[{{node ReadFile}}]]
	 [[DatasetToSingleElement]]
	 [[IteratorGetNext]]
0 successful operations.
0 derived errors ignored.

How to set parameters for light field data?

I used the following commands to test the trained model on HCI old dataset:
python ./mpi_from_images.py
--image1=examples/HCI_old/buddha/view_3_4.png
--image2=examples/HCI_old/buddha/view_5_4.png
--output_dir=examples/HCI_old/buddha/results
--yshift=45
--fx=9.3750
--fy=9.3750
--yoffset=0.125
--render_multiples=-1,-0.5,0,0.5,1,1.5,2
--render

where yshift = 2shift, fx=fy=focalLength, yoffset=2b, and shift, focalLength and b are provided by the lf.h5 file.

The results are quite undesirable. Does anyone help me?

Understanding camera parameters used in code

I'm interested in running the this model on a set of stereo images we have with us and synthesize multiple views outside the original camera baseline.

Our stereo images are taken from a camera with similar parameters to the iPhone X, i.e. baseline = 1.35cm and focal = 28mm (in 35mm terms).

(For reference, the iPhone X camera is 1.14cm baseline with focal of 28mm in 35mm terms)

Thankfully you included iPhone examples as a part of the project page. Below is the example we used as a reference.

mpi_from_images.py \
  --image1=paper_examples/iphone/bikes/bikes_left.jpg \
  --image2=paper_examples/iphone/bikes/bikes_right.jpg \
  --output_dir=paper_examples/iphone/bikes/results \
  --fx=1.7233965400390623 \
  --fy=2.2978620533854164 \
  --xoffset=0.0082 \
  --render \
  --render_multiples="-2,-1.5,-1,-0.5,0,0.5,1,1.5,2"

In our case, we passed in the same parameters to obtain reasonable results (given that the cameras are very similar). But I noticed for certain images, objects closer than approximately 1 meter do not converge in the output render.

In order to debug this, I tried playing around with the parameters but am still unclear on how the parameters in the example relate to the actual camera parameters.

I would greatly appreciate it if you could help provide with some sort of formulation to go from "camera focal" to "fx/fy" and "camera baseline" to "xoffset".

In summary,

  • Could you please provide an explanation (or mathematical formulation), to go from 'camera focal length' to 'fx' and 'fy' parameters
  • Could you please provide an explanation (or mathematical formulation), to go from 'camera baseline' to 'xoffset' parameter.

If it helps, I am attaching one of the stereo pairs I have tried to get the MPI representation of, and a generated GIF (using the same parameters as highlighted above).
Camera baseline = 1.35cm
fx/fy = 28 in 35mm terms
Image w/h = 640x360

Thank you for your help.

mpi_render_example (1)
mpi_left
mpi_right

Derivation of formula (2), inverse homography

Can anyone help explain the derivation of formula (2) in the paper?
Screen Shot 2019-08-05 at 5 35 46 PM
I understand the equation (13.2) from [Hartley and Zisserman 2003]:
image
However, I still find it hard to understand what's in the parentheses of formula (2), especially the denominator.
Can anyone help? Many thanks in advance.

Training code seems to get stuck even for a very small set of input images

Thanks very much for sharing the code.

To do a quick test of the training code, I downloaded a few of the youtube clips from the RealEstate 10K dataset, and placed the extracted frames in stereo-magnification\images directory. The corresponding camera files are in stereo-magnification\train directory.

However, when I try to execute the train.py the program doesn't proceed any further than session.run() function (I think). I'm copy-pasting the log below (please note that I've removed some of the warning messages related to some deprecated functions). I don't see any progress following the line INFO:tensorflow:parameter_count = 16892227 even after waiting for several (over 10) hours. Since I placed just a few (around 25) low-resolution images in the images directory, I was expecting the training to finish within a few hours.

INFO:tensorflow:Running local_init_op.
INFO:tensorflow:Done running local_init_op.
INFO:tensorflow:Starting standard services.
INFO:tensorflow:Starting queue runners.
INFO:tensorflow:Trainable variables: 
INFO:tensorflow:net/conv1_1/weights:0
INFO:tensorflow:net/conv1_1/LayerNorm/beta:0
INFO:tensorflow:net/conv1_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv1_2/weights:0
INFO:tensorflow:net/conv1_2/LayerNorm/beta:0
INFO:tensorflow:net/conv1_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv2_1/weights:0
INFO:tensorflow:net/conv2_1/LayerNorm/beta:0
INFO:tensorflow:net/conv2_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv2_2/weights:0
INFO:tensorflow:net/conv2_2/LayerNorm/beta:0
INFO:tensorflow:net/conv2_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv3_1/weights:0
INFO:tensorflow:net/conv3_1/LayerNorm/beta:0
INFO:tensorflow:net/conv3_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv3_2/weights:0
INFO:tensorflow:net/conv3_2/LayerNorm/beta:0
INFO:tensorflow:net/conv3_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv3_3/weights:0
INFO:tensorflow:net/conv3_3/LayerNorm/beta:0
INFO:tensorflow:net/conv3_3/LayerNorm/gamma:0
INFO:tensorflow:net/conv4_1/weights:0
INFO:tensorflow:net/conv4_1/LayerNorm/beta:0
INFO:tensorflow:net/conv4_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv4_2/weights:0
INFO:tensorflow:net/conv4_2/LayerNorm/beta:0
INFO:tensorflow:net/conv4_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv4_3/weights:0
INFO:tensorflow:net/conv4_3/LayerNorm/beta:0
INFO:tensorflow:net/conv4_3/LayerNorm/gamma:0
INFO:tensorflow:net/conv6_1/weights:0
INFO:tensorflow:net/conv6_1/LayerNorm/beta:0
INFO:tensorflow:net/conv6_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv6_2/weights:0
INFO:tensorflow:net/conv6_2/LayerNorm/beta:0
INFO:tensorflow:net/conv6_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv6_3/weights:0
INFO:tensorflow:net/conv6_3/LayerNorm/beta:0
INFO:tensorflow:net/conv6_3/LayerNorm/gamma:0
INFO:tensorflow:net/conv7_1/weights:0
INFO:tensorflow:net/conv7_1/LayerNorm/beta:0
INFO:tensorflow:net/conv7_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv7_2/weights:0
INFO:tensorflow:net/conv7_2/LayerNorm/beta:0
INFO:tensorflow:net/conv7_2/LayerNorm/gamma:0
INFO:tensorflow:net/conv8_1/weights:0
INFO:tensorflow:net/conv8_1/LayerNorm/beta:0
INFO:tensorflow:net/conv8_1/LayerNorm/gamma:0
INFO:tensorflow:net/conv8_2/weights:0
INFO:tensorflow:net/conv8_2/LayerNorm/beta:0
INFO:tensorflow:net/conv8_2/LayerNorm/gamma:0
INFO:tensorflow:net/color_pred/weights:0
INFO:tensorflow:net/color_pred/biases:0
INFO:tensorflow:parameter_count = 16892227

My system's configuration are provided below:
OS: Ubuntu 19.04
Python: 2.7
Tensorflow version: 1.13.1
GPU information:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.50       Driver Version: 430.50       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro RTX 4000     Off  | 00000000:02:00.0  On |                  N/A |
| 30%   39C    P8    12W / 125W |   7678MiB /  7977MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Quadro P4000        Off  | 00000000:03:00.0 Off |                  N/A |
| 46%   33C    P8     5W / 105W |     91MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     17066      G   /usr/lib/xorg/Xorg                           313MiB |
|    0     31117      C   python                                      7353MiB |
|    1     31117      C   python                                        79MiB |
+-----------------------------------------------------------------------------+

It would be great if you could provide some insight for solving this issue.

Thank you very much.

train detail

  Hello!thank you for the wonderfull work!  I'm very interested in your project ! I'm training this model for about one day and one night on GPU, but the loss seems to be still sometimes very big and sometimes very small ,and how long did you take for the loss to converge during the training?  
  ps. i  set the batchsize to 8,with learning rate= 0.0002,β1 = 0.9,β2 = 0.999

how to run the model on a single image pair?

I type the command on the terminal, as follows “python mpi_from_images.py image1=./XXX image2=./XXXX” , but it is error.
Could you please help me. Also I can't use any other code....

Color Layer Prediction

Hi,
I was curious to see the results with the other options of 'which_color_pred' in mpi_from_images.py script, but values other than 'bg' give me error:
"tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [128] rhs shape= [67]"

Wondering if anyone is able to get other prediction methods to work?

Thanks!

Output depth maps?

Thank you for letting us try out your fantastic work! Is there a way to output the depth maps for the input L and R images? That would be very helpful. Also, do you know of a google colab notebook that's available anywhere to try this out? Thanks in advance!

Dependencies???

What dependencies do I need to install. I didn't see anything about that in the readme. I'm getting one error after another about "no module named..."
Thanks for your help.

X-offset

Hi guys, thanks for the wonderful work thus published. How can I discover the x--offset between 2 camera images?

Rendering issue

Hi, friend!
Am I getting it right that the "render" flag's purpose is to allow output of rendered extrapolated stereopair images? No matter of the "render_multiples" values, the rendering result is the cropped reference image. Here's an example of the command I use to launch the tool:
python mpi_from_images.py --image1=/path/to/left.png --image2=/path/to/right.png --output_dir=./output/ --render_multiples=10 --render=True
Thanks in advance!

Question about training

Hello, I have a question about stereo-magnification Neural Network. When I see mpi.py source code, you allocate first D(D = 32) layers to blending weights, second D(D = 32) layers to Alpha images, and last three layers for Background color image.
Could you tell me why divide layers like this order? Can I change this order? Thank you.

A problem about running examples

CUDA_VISIBLE_DEVICES=6,7 python ./mpi_from_images.py \ --image1=examples/twain/twain_left.jpg \ --image2=examples/twain/twain_right.jpg \ --output_dir=examples/twain/results \ --fx=1.722207943 \ --fy=2.296277257 \ --xoffset 0.0082 \ --render_multiples -2,-1.5,-1,-0.5,0,0.5 \ --render
There was a problem with the above input:
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3078, in _as_graph_def raise ValueError("GraphDef cannot be larger than 2GB.") ValueError: GraphDef cannot be larger than 2GB.
Can you help me out?

Sample images for mpi_from_images.py

Hello,
I was wondering if you could provide sample images and commandline for this script. I am running on my own images and I'm not sure if the output is as expected or if there is an error in commandline. I think this would be really helpful, thanks in advance!

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.