nie-lang / Multi-Grid-Deep-Homography

TCSVT2021 - Multi-Grid Deep Homogarphy
87 stars 9 forks source link

Training depth image #6

Open FXY0117 opened 2 years ago

FXY0117 commented 2 years ago

Excuse me, how can I get the training depth image? It seems doesn't work when I training with my own dataset.

nie-lang commented 2 years ago

We adopt a pre-trained model [1] to predict the depth. You can use the same model to predict the depth of your own dataset. Be careful that the depth images we load are saved as grayscale images ranging from 0 to 255.

Or, you can set depth_num = 1 (line59 at https://github.com/nie-lang/Multi-Grid-Deep-Homography/blob/main/Codes/loss_functions.py) to train a model without depth awareness.

[1] K. Xian, J. Zhang, O. Wang, L. Mai, Z. Lin, and Z. Cao, “Structure-guided ranking loss for single image depth prediction,” in The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.

FXY0117 commented 2 years ago

Thank You! But When I training without depth assistance in my own dataset, another question occurs:

Traceback (most recent call last): File "/home/zbb/anaconda3/envs/tensor/lib/python3.6/site-packages/tensorflow/python/ops/script_ops.py", line 207, in call ret = func(*args) File "/home/zbb/anaconda3/envs/tensor/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 449, in generator_py_func values = next(generator_state.get_iterator(iterator_id)) File "/home/zbb/Multi-Grid-Deep-Homography-main/Codes/utils.py", line 50, in data_clip_generator data_clip.append(np_load_frame(data_info_list[2]['frame'][frame_id], self.height, self.width)) IndexError: list index out of range

Is there something wrong with my own dataset?

nie-lang commented 2 years ago

Please create the depth folder although you do not use it. For example, copy the 'input1' folder and rename it as "depth2".

FXY0117 commented 2 years ago

OK, It works. Thank you !