MCPcopy Index your code
hub / github.com/ActiveVisionLab/DFNet / load_exisiting_model

Function load_exisiting_model

script/dm/direct_pose_model.py:93–110  ·  view source on GitHub ↗

Load a pretrained DFNet model

(args, isFeatureNet=False)

Source from the content-addressed store, hash-verified

91 return pose_loss
92
93def load_exisiting_model(args, isFeatureNet=False):
94 ''' Load a pretrained DFNet model '''
95 if isFeatureNet==False: # load the Pose Estimator F
96 if args.DFNet_s:
97 model = PoseNet3()
98 model.load_state_dict(torch.load(args.pretrain_model_path))
99 else:
100 model = PoseNet()
101 model.load_state_dict(torch.load(args.pretrain_model_path))
102 return model
103 else:
104 if args.DFNet_s: # load the Feature Extractor G
105 model = FeatureNet3()
106 model.load_state_dict(torch.load(args.pretrain_featurenet_path))
107 else:
108 model=FeatureNet()
109 model.load_state_dict(torch.load(args.pretrain_featurenet_path))
110 return model
111
112def prepare_batch_render(args, pose, batch_size, target_, H, W, focal, half_res=True, rand=True):
113 ''' Break batch of images into rays '''

Callers 2

trainFunction · 0.85
evalFunction · 0.85

Calls 1

PoseNetClass · 0.85

Tested by

no test coverage detected