Skip to content
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

Why rasterization process is so low, how to speed it. #208

Open
y6216886 opened this issue May 4, 2023 · 2 comments
Open

Why rasterization process is so low, how to speed it. #208

y6216886 opened this issue May 4, 2023 · 2 comments

Comments

@y6216886
Copy link

y6216886 commented May 4, 2023

Thank you for your time!
I have tried to add some noise to the smplx model by setting noise_scale in the yaml file to [0.1, 0.1].
However, it requires to rasterize meshes based on the perturbed smplx model, which leads to running function rasterize_meshes() in line 353 in lib/dataset/mesh_util.py.
pix_to_face, zbuf, bary_coords, dists = rasterize_meshes( meshes_screen, image_size=raster_settings.image_size, blur_radius=raster_settings.blur_radius, faces_per_pixel= raster_settings.faces_per_pixel, bin_size=raster_settings.bin_size, max_faces_per_bin= raster_settings.max_faces_per_bin, perspective_correct=raster_settings.perspective_correct, cull_backfaces=raster_settings.cull_backfaces, )
This function runs very slow in my host (40 minutes for an iteration), any idea to speed this?

PS: I have tried setting parameters bin_size to none, or setting face_per_pixel to 1, but these operations cannot work.

Thanks.

@y6216886
Copy link
Author

y6216886 commented May 4, 2023

the reason seems to be the large value of the parameter "image_size" of the Pytorch3dRasterizer.
rasterizer = Pytorch3dRasterizer(image_size=2**12)
Also, the rasterization process is running on CPU mode, which further slows down the speed.

So, I try to set the parameter image_size from "2^12" to "2^9" and the rasterization process now get much faster,
But, will this operation hurt performance or is it a wrong operation?

@YuliangXiu
Copy link
Owner

I don't think this will hurt the performance a lot, you can visualize the pre-computed visibility value (https://github.com/YuliangXiu/ICON/blob/master/docs/dataset.md#generate-mode) on SMPL-X obj to check if it works well.

Also, please use GPU version, otherwise the speed is unacceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants