Skip to content

Commit

Permalink
added Python 2 support, resolves daniilidis-group#3
Browse files Browse the repository at this point in the history
  • Loading branch information
nkolot committed Jul 22, 2018
1 parent 3ece420 commit c888067
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 9 deletions.
Empty file.
1 change: 1 addition & 0 deletions neural_renderer/get_points_from_angles.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
import math

import torch
Expand Down
1 change: 1 addition & 0 deletions neural_renderer/load_obj.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
import os

import torch
Expand Down
2 changes: 1 addition & 1 deletion neural_renderer/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import neural_renderer as nr

class Mesh:
class Mesh(object):
'''
A simple class for creating and manipulating trimesh objects
'''
Expand Down
1 change: 1 addition & 0 deletions neural_renderer/perspective.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
import math

import torch
Expand Down
2 changes: 2 additions & 0 deletions neural_renderer/projection.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division

import torch


Expand Down
1 change: 1 addition & 0 deletions neural_renderer/renderer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
import math

import torch
Expand Down
1 change: 1 addition & 0 deletions neural_renderer/save_obj.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
import os

import torch
Expand Down
12 changes: 4 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from setuptools import setup, find_packages
import unittest

import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

CUDA_FLAGS = []
Expand All @@ -15,18 +14,15 @@ def test_all():
CUDAExtension('neural_renderer.cuda.load_textures', [
'neural_renderer/cuda/load_textures_cuda.cpp',
'neural_renderer/cuda/load_textures_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': CUDA_FLAGS}),
]),
CUDAExtension('neural_renderer.cuda.rasterize', [
'neural_renderer/cuda/rasterize_cuda.cpp',
'neural_renderer/cuda/rasterize_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': CUDA_FLAGS}),
]),
CUDAExtension('neural_renderer.cuda.create_texture_image', [
'neural_renderer/cuda/create_texture_image_cuda.cpp',
'neural_renderer/cuda/create_texture_image_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': CUDA_FLAGS}),
]),
]

INSTALL_REQUIREMENTS = ['numpy', 'torch', 'torchvision', 'scikit-image', 'tqdm', 'imageio']
Expand All @@ -39,7 +35,7 @@ def test_all():
version='1.1.3',
name='neural_renderer',
test_suite='setup.test_all',
packages=find_packages(),
packages=['neural_renderer', 'neural_renderer.cuda'],
install_requires=INSTALL_REQUIREMENTS,
ext_modules=ext_modules,
cmdclass = {'build_ext': BuildExtension}
Expand Down
Binary file removed tests/data/car.png
Binary file not shown.
Binary file removed tests/data/test_rasterize1.png
Binary file not shown.
Binary file removed tests/data/test_rasterize2.png
Binary file not shown.

0 comments on commit c888067

Please sign in to comment.