def setup_pose_net(config, prepared, **kwargs): """ Create a pose network Parameters ---------- config : CfgNode Network configuration prepared : bool True if the network has been prepared before kwargs : dict Extra parameters for the network Returns ------- pose_net : nn.Module Created pose network """ print0(pcolor('PoseNet: %s' % config.name, 'yellow')) pose_net = load_class_args_create( config.name, paths=[ 'fbnet.networks.pose', ], args={ **config, **kwargs }, ) if not prepared and config.checkpoint_path is not '': pose_net = load_network(pose_net, config.checkpoint_path, ['pose_net', 'pose_network']) return pose_net
def setup_depth_net2(config, prepared, **kwargs): """ Create a depth network Parameters ---------- config : CfgNode Network configuration prepared : bool True if the network has been prepared before kwargs : dict Extra parameters for the network Returns ------- depth_net : nn.Module Create depth network """ print0(pcolor('DepthNet2: %s' % config.name, 'yellow')) depth_net = load_class_args_create( config.name, paths=[ 'fbnet.networks.depth2', ], args={ **config, **kwargs }, ) if not prepared and config.checkpoint_path is not '': depth_net = load_network(depth_net, config.checkpoint_path, ['depth_net2', 'disp_network2']) return depth_net