This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install direct from our forked repository: https://github.com/Esri/pytorch3d/tree/multitexture-obj-high-precision | |
!pip install 'git+https://github.com/Esri/pytorch3d.git@multitexture-obj-high-precision' | |
from pytorch3d.ops import sample_points_from_obj | |
( | |
points, # points sampled proportional to face area | |
normals, # point normals based on mesh verts | |
textures, # point textures sampled from faces | |
mappers # an index to each points origin face |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install direct from our forked repository: https://github.com/Esri/pytorch3d/tree/multitexture-obj-high-precision | |
!pip install 'git+https://github.com/Esri/pytorch3d.git@multitexture-obj-high-precision' | |
from pytorch3d.io import subset_obj | |
faces_to_subset = <a torch tensor of face indices to subset> | |
# all obj objects are subset to the selected face indices | |
obj_subset = subset_obj( | |
obj=obj, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install direct from our forked repository: https://github.com/Esri/pytorch3d/tree/multitexture-obj-high-precision | |
!pip install 'git+https://github.com/Esri/pytorch3d.git@multitexture-obj-high-precision' | |
from pytorch3d.io import save_obj | |
# save_obj now allows for saving objs with multiple textures and control over the texture outputs | |
save_obj( | |
f=obj_filename, | |
verts=obj[0], | |
faces=obj[1].verts_idx, |
OlderNewer