Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed numpy dtype errors #167

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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 lib/ext_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __call__(self, tensor):

class MaskToTensor(object):
def __call__(self, img):
return torch.from_numpy(np.array(img, dtype=np.int32)).long()
return torch.from_numpy(np.array(img, dtype=int)).long()


class FreeScale(object):
Expand Down
2 changes: 1 addition & 1 deletion lib/mesh_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def eval_func(points):

# Finally we do marching cubes
try:
verts, faces, normals, values = measure.marching_cubes_lewiner(sdf, 0.5)
verts, faces, normals, values = measure.marching_cubes(sdf, 0.5)
# transform verts into world coordinate system
verts = np.matmul(mat[:3, :3], verts.T) + mat[:3, 3:4]
verts = verts.T
Expand Down
6 changes: 3 additions & 3 deletions lib/renderer/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@


def vec3(x, y, z):
return np.array([x, y, z], dtype=np.float32)
return np.array([x, y, z], dtype=float)


def radians(v):
return np.radians(v)


def identity():
return np.identity(4, dtype=np.float32)
return np.identity(4, dtype=float)


def empty():
return np.zeros([4, 4], dtype=np.float32)
return np.zeros([4, 4], dtype=float)


def magnitude(v):
Expand Down
4 changes: 2 additions & 2 deletions lib/sdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def eval_grid_octree(coords, eval_func,

sdf = np.zeros(resolution)

dirty = np.ones(resolution, dtype=np.bool)
grid_mask = np.zeros(resolution, dtype=np.bool)
dirty = np.ones(resolution, dtype=bool)
grid_mask = np.zeros(resolution, dtype=bool)

reso = resolution[0] // init_resolution

Expand Down