40 lines
829 B
Python
40 lines
829 B
Python
"""
|
|
Trainer to learn depth information on unlabeled data (raw images/videos)
|
|
|
|
Allows pluggable depth networks for differing performance (including fast-depth)
|
|
"""
|
|
|
|
import tensorflow as tf
|
|
import tensorflow.keras as keras
|
|
|
|
|
|
class SFMLearner(keras.Model):
|
|
|
|
def __init__(depth_model, pose_model):
|
|
pass
|
|
|
|
def train_step(self, data):
|
|
pass
|
|
|
|
|
|
def projective_inverse_warp(depth, pose, t_img, s_imgs, intrinsics):
|
|
'''
|
|
SFM Learner inverse warp step
|
|
ps ~ K.T(t->s).Dt(pt).K^-1.pt
|
|
|
|
projected source pixel
|
|
'''
|
|
pass
|
|
|
|
|
|
def bilinear_sample(projected_coords, s_img):
|
|
'''
|
|
Sample the 4 closest pixels in the source image via the projected coordinates
|
|
to get the source image warped to the target image
|
|
'''
|
|
pass
|
|
|
|
|
|
def make_sfm_learner_pose_net(input_shape=(224, 224, 3)):
|
|
pass
|