Last active
June 22, 2023 03:50
-
-
Save justinhchae/7c6a717c570b1ed0a0f46c921bc70a0d to your computer and use it in GitHub Desktop.
Example Usage to Subset an Obj with PyTorch3D
This file contains 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, | |
faces_to_subset=faces_to_subset, | |
device=torch.device("cpu") # specify cpu as the target device to subset and return obj sebset | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment