-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup_softras.py
99 lines (94 loc) · 4.4 KB
/
setup_softras.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
CUDA_FLAGS = []
ext_modules=[
CUDAExtension('soft_renderer.cuda.load_textures', [
'soft_renderer/cuda/load_textures_cuda.cpp',
'soft_renderer/cuda/load_textures_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': [
'--generate-code=arch=compute_35,code=sm_35',
'--generate-code=arch=compute_37,code=sm_37',
'--generate-code=arch=compute_50,code=sm_50',
'--generate-code=arch=compute_52,code=sm_52',
'--generate-code=arch=compute_53,code=sm_53',
'--generate-code=arch=compute_60,code=sm_60',
'--generate-code=arch=compute_61,code=sm_61',
'--generate-code=arch=compute_62,code=sm_62',
'--generate-code=arch=compute_70,code=sm_70',
'--generate-code=arch=compute_72,code=sm_72',
'--generate-code=arch=compute_75,code=sm_75',
'--generate-code=arch=compute_86,code=sm_86',
]}
),
CUDAExtension('soft_renderer.cuda.create_texture_image', [
'soft_renderer/cuda/create_texture_image_cuda.cpp',
'soft_renderer/cuda/create_texture_image_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': [
'--generate-code=arch=compute_35,code=sm_35',
'--generate-code=arch=compute_37,code=sm_37',
'--generate-code=arch=compute_50,code=sm_50',
'--generate-code=arch=compute_52,code=sm_52',
'--generate-code=arch=compute_53,code=sm_53',
'--generate-code=arch=compute_60,code=sm_60',
'--generate-code=arch=compute_61,code=sm_61',
'--generate-code=arch=compute_62,code=sm_62',
'--generate-code=arch=compute_70,code=sm_70',
'--generate-code=arch=compute_72,code=sm_72',
'--generate-code=arch=compute_75,code=sm_75',
'--generate-code=arch=compute_86,code=sm_86',
]}
),
CUDAExtension('soft_renderer.cuda.soft_rasterize', [
'soft_renderer/cuda/soft_rasterize_cuda.cpp',
'soft_renderer/cuda/soft_rasterize_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': [
'--generate-code=arch=compute_35,code=sm_35',
'--generate-code=arch=compute_37,code=sm_37',
'--generate-code=arch=compute_50,code=sm_50',
'--generate-code=arch=compute_52,code=sm_52',
'--generate-code=arch=compute_53,code=sm_53',
'--generate-code=arch=compute_60,code=sm_60',
'--generate-code=arch=compute_61,code=sm_61',
'--generate-code=arch=compute_62,code=sm_62',
'--generate-code=arch=compute_70,code=sm_70',
'--generate-code=arch=compute_72,code=sm_72',
'--generate-code=arch=compute_75,code=sm_75',
'--generate-code=arch=compute_86,code=sm_86',
]}
),
CUDAExtension('soft_renderer.cuda.voxelization', [
'soft_renderer/cuda/voxelization_cuda.cpp',
'soft_renderer/cuda/voxelization_cuda_kernel.cu',
],
extra_compile_args={'cxx': [], 'nvcc': [
'--generate-code=arch=compute_35,code=sm_35',
'--generate-code=arch=compute_37,code=sm_37',
'--generate-code=arch=compute_50,code=sm_50',
'--generate-code=arch=compute_52,code=sm_52',
'--generate-code=arch=compute_53,code=sm_53',
'--generate-code=arch=compute_60,code=sm_60',
'--generate-code=arch=compute_61,code=sm_61',
'--generate-code=arch=compute_62,code=sm_62',
'--generate-code=arch=compute_70,code=sm_70',
'--generate-code=arch=compute_72,code=sm_72',
'--generate-code=arch=compute_75,code=sm_75',
'--generate-code=arch=compute_86,code=sm_86',
]}
),
]
INSTALL_REQUIREMENTS = ['numpy', 'torch', 'torchvision', 'scikit-image', 'tqdm', 'imageio']
setup(
description='PyTorch implementation of "Soft Rasterizer"',
author='Shichen Liu',
author_email='[email protected]',
license='MIT License',
version='1.0.0',
name='soft_renderer',
packages=['soft_renderer', 'soft_renderer.cuda', 'soft_renderer.functional'],
install_requires=INSTALL_REQUIREMENTS,
ext_modules=ext_modules,
cmdclass = {'build_ext': BuildExtension}
)