MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / get_error_in_q

Function get_error_in_q

script/feature/misc.py:117–131  ·  view source on GitHub ↗

Convert Rotation matrix to quaternion, then calculate the location errors. original from PoseNet Paper

(args, dl, model, sample_size, device, batch_size=1)

Source from the content-addressed store, hash-verified

115
116# # pytorch
117def get_error_in_q(args, dl, model, sample_size, device, batch_size=1):
118 ''' Convert Rotation matrix to quaternion, then calculate the location errors. original from PoseNet Paper '''
119 model.eval()
120
121 results = np.zeros((sample_size, 2))
122 results, vis_info = compute_error_in_q(args, dl, model, device, results, batch_size)
123 median_result = np.median(results,axis=0)
124 mean_result = np.mean(results,axis=0)
125
126 # standard log
127 print ('Median error {}m and {} degrees.'.format(median_result[0], median_result[1]))
128 print ('Mean error {}m and {} degrees.'.format(mean_result[0], mean_result[1]))
129
130 # visualize results
131 # vis_pose(vis_info)
132
133def get_render_error_in_q(args, model, sample_size, device, targets, rgbs, poses, batch_size=1):
134 ''' use nerf render imgs instead of use real imgs '''

Callers 2

evalFunction · 0.50
train_featureFunction · 0.50

Calls 1

compute_error_in_qFunction · 0.70

Tested by

no test coverage detected