Comments (9)
Haven't tried this myself since I am working with RGB, but Line 37 of renderer.py exposes a fragment, which should have a zbuf object.
Also according to documentation here:
The PyTorch3d backward pass returns gradients for zbuf, dist and bary_coords
from pytorch3d.
Hi wangg12,
can I please ask whether you can share the rendering script?
More specifically, it is not obvious what is the position of the LM object in the world coordinates. Furthermore, the "R" matrix you are using does not seem to be a valid rotation, see below:
R = torch.tensor([[-0.5, 0.8, 0], [0, 0, -1], [-0.8, -0.5, 0]])
torch.det(R)
> tensor(0.8900) # instead of 1
In case the LM object should be centered around (0, 0, 0), I would suggest setting the camera to a trivial one with a non-zero z-component of the T
vector, e.g.:
R = torch.eye(3), T = torch.tensor([0., 0., 2.])
This would point the camera directly at the object center and render it from the distance of 2 world units.
from pytorch3d.
Sorry, R
was not the correct one. It was transformed from axis angle and should be correct. I shared my script here
from pytorch3d.
@wangg12 could you please share a small script to reproduce the error which we can run easily? For example load and render one mesh with the settings you have mentioned. This will enable us to help you much faster :)
from pytorch3d.
Finally I got the correct results with a modified OpenGL Real Perspective Camera.
The scripts are here.
BTW, @nikhilaravi How can I render the differentiable depth values?
from pytorch3d.
@wangg12 Glad you got it to work. I can take a look at your script later! For future, please try to share the minimum amount of code needed to explain the issue so we can review more quickly :)
Thanks @aluo-x for explaining the zbuf/fragments :) As mentioned, we expose the zbuffer as part of the fragments
object which is output from the rasterizer. It will be a N x H x W x K
dimensional tensor.
from pytorch3d.
@wangg12 Thanks for sharing your script. I am trying to do something similar using your script.
However the rendering is vertically stretched as shown below.
Ideally, it should look like this.
My image size is (960, 1280). I believe it has something to do with rasterizer since it only works for square image.
Can you guide me in the right direction here?
from pytorch3d.
@bhadresh74 yes the rasterizer currently only works for square images!
from pytorch3d.
Hi @bhadresh74
Since 57a22e7 we have updated the cameras and have added a note to explain the space and definitions here:
https://github.com/facebookresearch/pytorch3d/blob/master/docs/notes/cameras.md
Note that by default PyTorch3D cameras assume parameters in NDC space for rendering. We have updated cameras.py such that SfMPerspective and SfMOrthographic can now accept parameters in both NDC and screen space.
from pytorch3d.
Related Issues (20)
- get_full_projection_transform not functioning properly for batch sizes > 2 HOT 2
- How to save mesh as tetrahedron in pytorch3d? HOT 1
- Does PyTorch3D support AMD Radeon W7900? (gfx1100) HOT 1
- The picture I generated using pytorch3d has a slash in the middle of the picture, and I don't know why? HOT 8
- Some kind of offset in TexturesUV Map, leads to faulty texture on mesh HOT 6
- A valid wheel for the current colab? HOT 4
- Compatibility Issues with PyTorch3D, GCC, and CUDA on Red Hat Linux HOT 10
- Softras to Pytorch3d comparison rendering flow HOT 1
- How to use Pytorch3d to render a uv normal map for a given mesh? HOT 1
- How can I use OpenGL-related methods in PyTorch3D to render semi-transparent textures? HOT 2
- Differentiable rednering HOT 5
- How to use Pytorch3D to render objects from Objaverse? HOT 1
- Can't install Pytorch3D HOT 3
- Can't seem to install pytorch3d on Orin nx platform? HOT 1
- rotation matrix convention seems inconsistent HOT 1
- Issue while Installing pytorch3d on windows with cuda 12.6 HOT 6
- error HOT 1
- Rendering depth and converting them to the needed format HOT 1
- Support Pytorch2.4 HOT 4
- How to customize the output path for generated .obj files with ninja,because i have a bug with longer than 260 characters HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch3d.