diff --git a/lib/colab_util.py b/lib/colab_util.py index b663560c..608227b2 100644 --- a/lib/colab_util.py +++ b/lib/colab_util.py @@ -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, @@ -25,8 +25,9 @@ RasterizationSettings, MeshRenderer, MeshRasterizer, - TexturedSoftPhongShader, - HardPhongShader + SoftPhongShader, + HardPhongShader, + TexturesVertex ) def set_renderer(): @@ -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)