added the predict_depth.r function