Exemple #1
0
 def compute_inv_depths(self, image, random_seed):
     """Computes inverse depth maps from single images"""
     # Randomly flip and estimate inverse depth maps
     flip_lr = random_seed < self.flip_lr_prob if self.training else False
     inv_depths = make_list(flip_model(self.depth_net, image, flip_lr))
     # If upsampling depth maps
     if self.upsample_depth_maps:
         inv_depths = interpolate_scales(
             inv_depths, mode='nearest', align_corners=None)
     # Return inverse depth maps
     return inv_depths
Exemple #2
0
    def compute_inv_depths_feedback(self, image, disp, random_seed):
        """Computes inverse depth maps from single images"""
        #concat image & disparity

        # Randomly flip and estimate inverse depth maps        
        flip_lr = random.random() < self.flip_lr_prob if self.training else False
        if flip_lr:
            image = torch.flip(image,[3])
        image = torch.cat([image, disp] , 1)
        output = self.depth_net2(image)
        inv_depths = make_list(output)        
        # If upsampling depth maps
        if self.upsample_depth_maps:
            inv_depths = interpolate_scales(
                inv_depths, mode='nearest', align_corners=None)
        # Return inverse depth maps
        return inv_depths