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

fix pytorch3d import error #67

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix pytorch3d import error
  • Loading branch information
Dominoer committed Sep 1, 2020
commit 4f7bcb40646b8d0cd5a3959a5d397d2f49bd1195
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