Comments (5)
@michele-arrival this is not because of the blend params but the rasterization settings. Currently your values are:
raster_settings = RasterizationSettings(
image_size=frame_size,
blur_radius=np.log(1.0 / 1e-4 - 1.0) * blend_params.sigma,
faces_per_pixel=2,
bin_size=1
)
There are two implementations of rasterization in pytorch3d and the approach that is used is determined by the value of the bin_size
setting.
The first naive approach (when bin_size = 0
) loops through all the faces in the mesh for each pixel. The second approach (when bin_size > 0) involves two steps the first of which is a coarse step where the image is split into a rough grid (or bins) and each face in the mesh is assigned to a grid cell (or bin). The second step loops through each pixel and only looks at the faces in the bin in which the pixel lies. Refer to the docs on the renderer for more details on this 'coarse-to-fine' approach: https://pytorch3d.org/docs/renderer. Also refer to the PyTorch3D API docs for the rasterizer here
For coarse-to-fine rasterization the bin_size
setting determines the number of bins and in this case you have set it to 1. There is an upper bound on the number of faces which can be allocated to each bin and as the error mentions Got 256; that's too many!
(for reference with, the error is from RasterizeMeshesCoarseCuda
to help you debug such issues in future).
If you want to enable the coarse-to-fine rasterization you can just leave the bin_size
empty and it will be set based on heuristics. If you want to use the naive rasterization approach you can set bin_size = 0
.
from pytorch3d.
Yes sorry of course I meant RasterizationSettings
.
Thanks for the explanation, I understand now.
I guess a clearer error message wouldn't be too bad though. For one thing it looks like a low level exception, not a user error, even thought it is. Also It's not immediately clear what *that*
in that's too many
is.
As a side note, when the image is big (> 1024) leaving bin_size
out of the settings means another kind of exception incompatible function arguments
later on.
see here where bin_size remains None
:
pytorch3d/pytorch3d/renderer/mesh/rasterize_meshes.py
Lines 93 to 121 in dbf06b5
Cheers!
from pytorch3d.
@michele-arrival, yes we could definitely make the error message clearer. Thanks for pointing out the error for when image size is > 1024. We assumed that most use cases involving batched rendering of meshes would require image sizes < 1024, but we can fix this so that rendering is enabled with any image size. Feel free to submit a PR if you would like to try and fix this yourself!
from pytorch3d.
from pytorch3d.
@michele-arrival your PR has been merged so I am closing this issue.
from pytorch3d.
Related Issues (20)
- Trouble installing pytorch3d on Windows 11 HOT 4
- Conda environment not buildable due to (wrong?) pytorch constraint
- PointClouds2Volumes got '_LinAlgError: linalg.inv:' error when setting grid_size = [440 500 1]
- Prebuilt wheels for python 3.10 ? HOT 2
- can't install pytorch3d HOT 2
- Marching Cubes CUDA implementation generates face indices out of bounds HOT 2
- Rendering depth map with Pytorch3D vs Open3D HOT 2
- No module named 'pytorch3d.structures' HOT 1
- get error: IndexError: tensors used as indices must be long, byte or bool tensors HOT 3
- Joining a Batch of Scenes HOT 1
- Size Mismatch between tensors when rendering SMPL model HOT 3
- Very slow rendering for large mesh HOT 8
- ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory HOT 7
- the use of the normals_packed() HOT 1
- pointcould render issue
- Trouble updating all pixels from texture that contribute to render HOT 1
- load_obj save_obj seems to modify the original obj (has anyone else seen this) HOT 3
- Could not build wheels for pytorch3d HOT 3
- ERROR: Could not build wheels for pytorch3d, which is required to install pyproject.toml-based projects | Suggested methods in Issue #1734 did not help HOT 5
- Potential IOU compute Bug in box3d_overlap HOT 9
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.