Implement multitexture obj high precision #1574
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request from Esri's AI Prototypes Team. Seeking to implement multitexture support for OBJ WITH point sampling direct from OBJ data structures AND WITH support for vertices in real-world projected spatial coordinates. This PR includes all features that exist in #1572 and in #1573. Each PR is split into its major components due to the orthogonal nature of each branch.
We leverage PyTorch3D quite a bit on our applied research in mesh segmentation and often use obj datasets that depict entire cities or entire regions. They mostly all require multiple texture files and we eventually need to subset meshes for nearly all stages of the pipeline. In addition, we are experimenting with feature extraction methods that generally involve using point cloud based techniques - such approaches require sampling at least one point per face and linking all sampled points to their origin faces. These features and more are implemented in this branch. Further, many of our input meshes have XYZ vertices that exist in real space. As a result, depending on the location on earth), the coordinates for vertices may be so high that they are rounded if the verts data struct is only fp.32. To accommodate verts in fp.64, we modified several data structures to include OBJ, Meshes, and Transforms3D.
We've written a story about the full scope of changes at GeoAI/PyTorch3D.
Key Excerpt from our article:
multitexture-obj-high-precision: Adds support to pytorch3d.io.obj_io and pytorch3d.ops.sample_points_from_obj by reading obj vertices with floating point precision 64, i.e., double tensors. Although PyTorch3D currently allows one to control the output of decimal place, if vertex coordinates of a mesh in an obj are based on real-world coordinates, there is a chance that vertex values lose significant numeric precision. In practice, this means that vertex coordinates of mesh faces could be offset by up to a meter or more. Linked to issue #1570.
Issues Addressed Include: #1570.