freealise commited on
Commit
d398cda
1 Parent(s): da9fc1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -258,7 +258,7 @@ def pano_depth_to_world_points(depth):
258
 
259
  pts = np.stack([x, y, z], axis=1)
260
  uvs = np.stack([lon/np.pi/2, lat/np.pi], axis=1)
261
- nls = np.stack([-nx, -ny, -nz], axis=1)
262
 
263
  pts3d = np.concatenate((pts3d, pts), axis=0)
264
  uv = np.concatenate((uv, uvs), axis=0)
@@ -328,8 +328,8 @@ def get_mesh(image, depth, blur_data, loadall):
328
  mesh_n.append(str(fnum))
329
 
330
  triangles = create_triangles(rgba.shape[0], rgba.shape[1])
331
- rgba_pil = Image.fromarray(rgba.astype(np.uint8))
332
- material = trimesh.visual.texture.SimpleMaterial(image=rgba_pil, ambient=[0,0,0,0], diffuse=[0,0,0,0], specular=[1,1,1,1], glossiness=1.0)
333
  visuals = trimesh.visual.TextureVisuals(uv=uvs, image=rgba_pil, material=material)
334
  mesh.append(trimesh.Trimesh(vertices=verts, faces=triangles, vertex_normals=normals, visual=visuals, validate=True, process=False))
335
  #print('triangles - ok')
 
258
 
259
  pts = np.stack([x, y, z], axis=1)
260
  uvs = np.stack([lon/np.pi/2, lat/np.pi], axis=1)
261
+ nls = np.stack([nx, ny, nz], axis=1)
262
 
263
  pts3d = np.concatenate((pts3d, pts), axis=0)
264
  uv = np.concatenate((uv, uvs), axis=0)
 
328
  mesh_n.append(str(fnum))
329
 
330
  triangles = create_triangles(rgba.shape[0], rgba.shape[1])
331
+ rgba_pil = Image.fromarray((rgba*255).astype(np.uint16))
332
+ material = trimesh.visual.texture.SimpleMaterial(image=rgba_pil) #, ambient=[0,0,0,0], diffuse=[0,0,0,0], specular=[0,0,0,0], glossiness=1.0)
333
  visuals = trimesh.visual.TextureVisuals(uv=uvs, image=rgba_pil, material=material)
334
  mesh.append(trimesh.Trimesh(vertices=verts, faces=triangles, vertex_normals=normals, visual=visuals, validate=True, process=False))
335
  #print('triangles - ok')