From 1de1ebcac98b08e3bc19ec1817572d1b04ac5c54 Mon Sep 17 00:00:00 2001 From: Shunsuke Saito Date: Wed, 6 Feb 2019 09:09:37 -0800 Subject: [PATCH] bug fix (with batch_size > 1, z value keeps copying the first sample in batch) --- neural_renderer/rasterize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neural_renderer/rasterize.py b/neural_renderer/rasterize.py index 0a53bbb..595b849 100644 --- a/neural_renderer/rasterize.py +++ b/neural_renderer/rasterize.py @@ -386,7 +386,7 @@ def forward_texture_sampling(self): const int bn = i / (${image_size} * ${image_size}); const int nf = ${num_faces}; const int ts = ${texture_size}; - const float* face = (float*)&faces[face_index * 9]; + const float* face = (float*)&faces[(bn * nf + face_index) * 9]; const float* texture = (float*)&textures[(bn * nf + face_index) * ts * ts * ts * 3]; float* pixel = (float*)&rgb_map[i * 3]; const float* weight = (float*)&weight_map[i * 3];