-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when creating a TextureAtlas #751
Comments
Hi @iahmedmaher apologies for the late response. Are you setting |
@nikhilaravi Here is my code snippet. This is the same snippet shared here. I have tried all texture_wrap options and different texture_atlas_size sizes, but none of them worked. verts, faces, aux = load_obj( mesh = Meshes( |
@nikhilaravi If you can tell me whether this is an issue with Pytorch3D or not, I would be really grateful. |
@iahmedmaher the device side assert is due to the UV values being out of bounds for the image during indexing. We have to convert the UV coordinates to integers in order to index into the texture map. Can you try replacing this line with pytorch3d/pytorch3d/io/mtl_io.py Line 302 in 44d2a9b
If this works I will update the original implementation to use this grid sample version. |
@nikhilaravi That did the trick! Thanks a lot for your time. I am leaving the issue as opened since you said this will require changing the original implementation. |
@iahmedmaher great!! I will update the original implementation! |
Summary: Fixes GitHub issue #751. The vectorized implementation of bilinear interpolation didn't properly handle the edge cases in the same way as the `grid_sample` method in PyTorch. Reviewed By: bottler Differential Revision: D30684208 fbshipit-source-id: edf241ecbd72d46b94ad340a4e601e26c83db88e
This has now been fixed in fc156b5. |
Hello,
When I try to load a multi-textured object using the instructions here, an exception is thrown while loading with these messages as seen in the attached image below:
I tried to look into the mtl_io.py file and found that some values of x1 are out of the image's range by 1. Setting those to the max possible index loads and renders the image correctly for a human, but I don't know if some faces have wrong textures or not especially that I don't fully understand uv texturing in general. I checked how x1 gets its values and it seems weird to me that it is x0 + 1 while x0 have values (H - 1) as seen below:
Environment
I am using the environment setup in one of the tutorial notebooks, so the latest stable version of Pytorch3D as of the time of writing this issue.
I am using Google Colab, so it's on Linux.
The issue is present when using a GPU. When using a CPU instead, the notebook crashes.
The texture images have size of 4096x4096. I am not authorized to share them or the obj files, sorry.
The text was updated successfully, but these errors were encountered: