From 4f7bcb40646b8d0cd5a3959a5d397d2f49bd1195 Mon Sep 17 00:00:00 2001 From: guoqing Date: Tue, 1 Sep 2020 23:21:28 +0900 Subject: [PATCH 1/2] fix pytorch3d import error --- .DS_Store | Bin 0 -> 6148 bytes lib/colab_util.py | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..380aebb8e532d8bdfb1e8a758adb3d66efde2e86 GIT binary patch literal 6148 zcmeHKL2lDP6#df#>ZGcg1yZ~828l&frBG-kgyg2_A`&2k5i9_uc4IY`96Q8L(-4BP z;SRtJI0`4=ARGYRpP3@Z2@5s|q509w`!n<3Sbl#zlOZC}9Ci1IYD8qAFqW&RRv3?S zS+X_VvjG%5M>|T+{3!9!<_V1%1&jj!wgUX^mdT?5ere(Ry^pb5KcvZ*s8T>NT~LQo z>d`Lz0Zj^=F9pt)=7cn)1dP6HXJAj@M~iH+U0|0eqLBPT)Q8nk{x}`z-RG-6h{7~$ zG`@+oQu*5Tb<3(+)y?W_x0j6F%*#e;(;L3z))O!5`PzS$B+)P5^Ph*oxKq1voWz+I z#=%gM!)}0(S1-c2n~a;uDDI|m9#;)mR>i7xYCF^EVdHMyzP*1qtJ~9qgGSxnzjJRk zt61AN_a3xQ`;)iRceD4Oq_8BgeM;NXcmlVH_p#IeIvHgC0_wj_HIRlZ$$n zGP&Dx#<@cDz=Wa#6;El>Bd=&4XNW+-T4$#p!SBM^%`6D1@FqKi@uPX2p Db?(cJ literal 0 HcmV?d00001 diff --git a/lib/colab_util.py b/lib/colab_util.py index b663560cb..608227b22 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) From 7d99e62c949791898778ffb77a98c3fc206c2a58 Mon Sep 17 00:00:00 2001 From: guoqing Date: Tue, 1 Sep 2020 23:21:57 +0900 Subject: [PATCH 2/2] fix pytorch3d import error --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 380aebb8e532d8bdfb1e8a758adb3d66efde2e86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKL2lDP6#df#>ZGcg1yZ~828l&frBG-kgyg2_A`&2k5i9_uc4IY`96Q8L(-4BP z;SRtJI0`4=ARGYRpP3@Z2@5s|q509w`!n<3Sbl#zlOZC}9Ci1IYD8qAFqW&RRv3?S zS+X_VvjG%5M>|T+{3!9!<_V1%1&jj!wgUX^mdT?5ere(Ry^pb5KcvZ*s8T>NT~LQo z>d`Lz0Zj^=F9pt)=7cn)1dP6HXJAj@M~iH+U0|0eqLBPT)Q8nk{x}`z-RG-6h{7~$ zG`@+oQu*5Tb<3(+)y?W_x0j6F%*#e;(;L3z))O!5`PzS$B+)P5^Ph*oxKq1voWz+I z#=%gM!)}0(S1-c2n~a;uDDI|m9#;)mR>i7xYCF^EVdHMyzP*1qtJ~9qgGSxnzjJRk zt61AN_a3xQ`;)iRceD4Oq_8BgeM;NXcmlVH_p#IeIvHgC0_wj_HIRlZ$$n zGP&Dx#<@cDz=Wa#6;El>Bd=&4XNW+-T4$#p!SBM^%`6D1@FqKi@uPX2p Db?(cJ