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

Fixed batching for look transformation #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neural_renderer/look.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def look(vertices, eye, direction=[0, 1, 0], up=None):
if direction.ndimension() == 1:
direction = direction[None, :]
if up.ndimension() == 1:
up = up[None, :]
up = up.repeat((direction.shape[0], 1))

# create new axes
z_axis = F.normalize(direction, eps=1e-5)
Expand Down
6 changes: 3 additions & 3 deletions neural_renderer/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, image_size=256, anti_aliasing=True, background_color=[0,0,0],
self.perspective = perspective
self.viewing_angle = viewing_angle
self.eye = [0, 0, -(1. / math.tan(math.radians(self.viewing_angle)) + 1)]
self.camera_direction = [0, 0, 1]
self.camera_direction = camera_direction
else:
raise ValueError('Camera mode has to be one of projection, look or look_at')

Expand All @@ -57,7 +57,7 @@ def __init__(self, image_size=256, anti_aliasing=True, background_color=[0,0,0],
self.light_intensity_directional = light_intensity_directional
self.light_color_ambient = light_color_ambient
self.light_color_directional = light_color_directional
self.light_direction = light_direction
self.light_direction = light_direction

# rasterization
self.rasterizer_eps = 1e-3
Expand All @@ -67,7 +67,7 @@ def forward(self, vertices, faces, textures=None, mode=None, K=None, R=None, t=N
Implementation of forward rendering method
The old API is preserved for back-compatibility with the Chainer implementation
'''

if mode is None:
return self.render(vertices, faces, textures, K, R, t, dist_coeffs, orig_size)
elif mode is 'rgb':
Expand Down