Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/layers/mesh_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __pool_main(self, mesh_index):
# recycle = []
# last_queue_len = len(queue)
last_count = mesh.edges_count + 1
mask = np.ones(mesh.edges_count, dtype=np.bool)
mask = np.ones(mesh.edges_count, dtype=bool)
edge_groups = MeshUnion(mesh.edges_count, self.__fe.device)
while mesh.edges_count > self.__out_target:
value, edge_id = heappop(queue)
Expand Down
4 changes: 3 additions & 1 deletion models/layers/mesh_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ def fill_mesh(mesh2fill, file: str, opt):
mesh_data = np.load(load_path, encoding='latin1', allow_pickle=True)
else:
mesh_data = from_scratch(file, opt)

np.savez_compressed(load_path, gemm_edges=mesh_data.gemm_edges, vs=mesh_data.vs, edges=mesh_data.edges,
edges_count=mesh_data.edges_count, ve=mesh_data.ve, v_mask=mesh_data.v_mask,
edges_count=mesh_data.edges_count, ve=np.array(mesh_data.ve, dtype=object), v_mask=mesh_data.v_mask,
filename=mesh_data.filename, sides=mesh_data.sides,
edge_lengths=mesh_data.edge_lengths, edge_areas=mesh_data.edge_areas,
features=mesh_data.features)

mesh2fill.vs = mesh_data['vs']
mesh2fill.edges = mesh_data['edges']
mesh2fill.gemm_edges = mesh_data['gemm_edges']
Expand Down
12 changes: 6 additions & 6 deletions util/mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def init_plot():
ax = pl.figure().add_subplot(111, projection='3d')
# hide axis, thank to
# https://stackoverflow.com/questions/29041326/3d-plot-with-matplotlib-hide-axes-but-keep-axis-labels/
ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax.zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
# Get rid of the spines
ax.w_xaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
ax.w_yaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
ax.w_zaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
ax.xaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
ax.yaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
ax.zaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
# Get rid of the ticks
ax.set_xticks([])
ax.set_yticks([])
Expand Down
2 changes: 1 addition & 1 deletion util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ def myindexrowselect(groups, mask_index, device):
#Create new tensor
groups = torch.sparse_coo_tensor(indices=allNewIndices,
values=torch.ones(allNewIndices.shape[1], dtype=torch.float),
size=(len(mask_index), groups.shape[1]))
size=(len(mask_index), groups.shape[1]), device=device)

return groups