MCPcopy Create free account
hub / github.com/Robotics-STAR-Lab/H2-Mapping / eval_points

Function eval_points

mapping/src/functions/render_helpers.py:217–233  ·  view source on GitHub ↗
(sdf_network, sampled_xyz)

Source from the content-addressed store, hash-verified

215
216@torch.no_grad()
217def eval_points(sdf_network, sampled_xyz):
218 def get_scores_once(sampled_xyz):
219 sampled_xyz = sampled_xyz.reshape(-1, 3)
220
221 if sampled_xyz.shape[0] == 0:
222 return
223 color = sdf_network.get_color(sampled_xyz)
224 return color.detach().cpu()
225
226 chunk_size = 3200
227
228 results = []
229 for i in range(0, sampled_xyz.size(0), chunk_size):
230 score_once = get_scores_once(sampled_xyz[i: i + chunk_size].cuda())
231 results.append(score_once)
232 results = torch.cat(results, dim=0)
233 return results
234
235
236# convert sdf to weight

Callers 1

create_meshMethod · 0.90

Calls 2

get_scores_onceFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected