Skip to content

Commit

Permalink
fix pytorch3d import error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominoer committed Sep 1, 2020
1 parent 7303437 commit 4f7bcb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Binary file added .DS_Store
Binary file not shown.
11 changes: 6 additions & 5 deletions lib/colab_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from base64 import b64encode

# Data structures and functions for rendering
from pytorch3d.structures import Meshes, Textures
from pytorch3d.structures import Meshes
from pytorch3d.renderer import (
look_at_view_transform,
OpenGLOrthographicCameras,
Expand All @@ -25,8 +25,9 @@
RasterizationSettings,
MeshRenderer,
MeshRasterizer,
TexturedSoftPhongShader,
HardPhongShader
SoftPhongShader,
HardPhongShader,
TexturesVertex
)

def set_renderer():
Expand Down Expand Up @@ -81,8 +82,8 @@ def generate_video_from_obj(obj_path, video_path, renderer):
# Load obj file
verts_rgb_colors = get_verts_rgb_colors(obj_path)
verts_rgb_colors = torch.from_numpy(verts_rgb_colors).to(device)
textures = Textures(verts_rgb=verts_rgb_colors)
wo_textures = Textures(verts_rgb=torch.ones_like(verts_rgb_colors)*0.75)
textures = TexturesVertex(verts_features=verts_rgb_colors)
wo_textures = TexturesVertex(verts_features=torch.ones_like(verts_rgb_colors)*0.75)

# Load obj
mesh = load_objs_as_meshes([obj_path], device=device)
Expand Down

0 comments on commit 4f7bcb4

Please sign in to comment.