MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / create_mc_lookup_table

Function create_mc_lookup_table

scripts/convert_shap_e_to_diffusers.py:830–854  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

828
829
830def create_mc_lookup_table():
831 cases = torch.zeros(256, 5, 3, dtype=torch.long)
832 masks = torch.zeros(256, 5, dtype=torch.bool)
833
834 edge_to_index = {
835 (0, 1): 0,
836 (2, 3): 1,
837 (4, 5): 2,
838 (6, 7): 3,
839 (0, 2): 4,
840 (1, 3): 5,
841 (4, 6): 6,
842 (5, 7): 7,
843 (0, 4): 8,
844 (1, 5): 9,
845 (2, 6): 10,
846 (3, 7): 11,
847 }
848
849 for i, case in enumerate(MC_TABLE):
850 for j, tri in enumerate(case):
851 for k, (c1, c2) in enumerate(zip(tri[::2], tri[1::2])):
852 cases[i, j, k] = edge_to_index[(c1, c2) if c1 < c2 else (c2, c1)]
853 masks[i, j] = True
854 return cases, masks
855
856
857RENDERER_CONFIG = {}

Calls

no outgoing calls

Tested by

no test coverage detected