ShuweiShao / AF-SfMLearner

[MedIA2022 & ICRA2021] Self-Supervised Monocular Depth and Ego-Motion Estimation in Endoscopy: Appearance Flow to the Rescue
MIT License
101 stars 15 forks source link

Some problems about trainer_stage_two.py #49

Closed Weijun-Lin closed 10 months ago

Weijun-Lin commented 11 months ago

Firstly, I found that some variables are not used in trainer_stage_two.py.

  1. self.position_depth is used to get outputs[("position_depth", scale, frame_id)] , but outputs[("position_depth", scale, frame_id)] are not used. Ref. line 397.
  2. outputs[("occu_map_bidirection", scale, f_i)] is not used. Ref. line 319.
  3. The self.models["pose"] takes two images as input and returns the pose (axisangleand translation ) between them. The dimensions of axisangle and translation are [6, 2, 1, 3]. The dimension of 2 can be understood as representing the relative pose between the two images. However, the code only used the first dimension. Ref. line 341. If only need the first dimension, why num_frames_to_predict_for in PoseDecoder is set to 2. Ref. line 83.

Secondly, the function compute_losses_val in line 513 is same as trainer_stage_one.py. I think there's something wrong here.

Lastly, thank you for your valuable contribution.

ShuweiShao commented 10 months ago

Sorry for the late reply! 1 and 2 are some of my trys and I dot not delete them when releasing the code. For 3, we directly use the code of monodepth2. Besides, the function compute_losses_val here is only used to indicate the possible trend and you can modify it by yourself.

Weijun-Lin commented 10 months ago

I see. Thank you very much for your kindly reply!