MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / subsample_to_nr_strands

Method subsample_to_nr_strands

data_loader/dataloader.py:54–62  ·  view source on GitHub ↗
(self, nr_strands_to_select)

Source from the content-addressed store, hash-verified

52
53
54 def subsample_to_nr_strands(self, nr_strands_to_select):
55 nr_strands_total = self.positions.shape[0]
56 indices_strands = np.random.randint(nr_strands_total, size=nr_strands_to_select)
57
58 #new positions
59 self.positions = self.positions[indices_strands,:,:]
60 self.root_normal = self.root_normal[indices_strands,:]
61 self.root_uv = self.root_uv[indices_strands,:]
62 self.root_position = self.root_position[indices_strands,:]
63
64
65 def compute_tbn(self, mesh_verts, mesh_uv, mesh_faces, mesh_v_tangents, mesh_v_bitangents, mesh_v_normals):

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected