Spaces:
Running
on
Zero
Running
on
Zero
重新编译custom_rasterizer
Browse files- custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl +2 -2
- gradio_app.py +2 -0
- hy3dgen/shapegen/__pycache__/__init__.cpython-310.pyc +0 -0
- hy3dgen/shapegen/__pycache__/pipelines.cpython-310.pyc +0 -0
- hy3dgen/shapegen/__pycache__/postprocessors.cpython-310.pyc +0 -0
- hy3dgen/shapegen/__pycache__/preprocessors.cpython-310.pyc +0 -0
- hy3dgen/shapegen/__pycache__/schedulers.cpython-310.pyc +0 -0
- hy3dgen/shapegen/__pycache__/utils.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/__pycache__/__init__.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/__pycache__/conditioner.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/autoencoders/__pycache__/__init__.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/autoencoders/__pycache__/attention_blocks.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/autoencoders/__pycache__/attention_processors.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/autoencoders/__pycache__/model.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/autoencoders/__pycache__/surface_extractors.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/autoencoders/__pycache__/volume_decoders.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/denoisers/__pycache__/__init__.cpython-310.pyc +0 -0
- hy3dgen/shapegen/models/denoisers/__pycache__/hunyuan3ddit.cpython-310.pyc +0 -0
- hy3dgen/texgen/custom_rasterizer/custom_rasterizer_installer.py +78 -0
- hy3dgen/texgen/utils/__pycache__/__init__.cpython-310.pyc +0 -0
- hy3dgen/texgen/utils/__pycache__/dehighlight_utils.cpython-310.pyc +0 -0
- hy3dgen/texgen/utils/__pycache__/imagesuper_utils.cpython-310.pyc +0 -0
- hy3dgen/texgen/utils/__pycache__/multiview_utils.cpython-310.pyc +0 -0
- hy3dgen/texgen/utils/__pycache__/uv_warp_utils.cpython-310.pyc +0 -0
custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fc2ebfeede9ed695279ed008b4bc2b69856e94df54ef6ac5570acecf3d87ddb3
|
3 |
+
size 4551972
|
gradio_app.py
CHANGED
@@ -13,6 +13,7 @@
|
|
13 |
# by Tencent in accordance with TENCENT HUNYUAN COMMUNITY LICENSE AGREEMENT.
|
14 |
|
15 |
import os
|
|
|
16 |
import random
|
17 |
import shutil
|
18 |
import time
|
@@ -27,6 +28,7 @@ from fastapi import FastAPI
|
|
27 |
from fastapi.staticfiles import StaticFiles
|
28 |
import uuid
|
29 |
|
|
|
30 |
from hy3dgen.shapegen.utils import logger
|
31 |
|
32 |
MAX_SEED = 1e7
|
|
|
13 |
# by Tencent in accordance with TENCENT HUNYUAN COMMUNITY LICENSE AGREEMENT.
|
14 |
|
15 |
import os
|
16 |
+
import subprocess
|
17 |
import random
|
18 |
import shutil
|
19 |
import time
|
|
|
28 |
from fastapi.staticfiles import StaticFiles
|
29 |
import uuid
|
30 |
|
31 |
+
|
32 |
from hy3dgen.shapegen.utils import logger
|
33 |
|
34 |
MAX_SEED = 1e7
|
hy3dgen/shapegen/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/__pycache__/__init__.cpython-310.pyc and b/hy3dgen/shapegen/__pycache__/__init__.cpython-310.pyc differ
|
|
hy3dgen/shapegen/__pycache__/pipelines.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/__pycache__/pipelines.cpython-310.pyc and b/hy3dgen/shapegen/__pycache__/pipelines.cpython-310.pyc differ
|
|
hy3dgen/shapegen/__pycache__/postprocessors.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/__pycache__/postprocessors.cpython-310.pyc and b/hy3dgen/shapegen/__pycache__/postprocessors.cpython-310.pyc differ
|
|
hy3dgen/shapegen/__pycache__/preprocessors.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/__pycache__/preprocessors.cpython-310.pyc and b/hy3dgen/shapegen/__pycache__/preprocessors.cpython-310.pyc differ
|
|
hy3dgen/shapegen/__pycache__/schedulers.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/__pycache__/schedulers.cpython-310.pyc and b/hy3dgen/shapegen/__pycache__/schedulers.cpython-310.pyc differ
|
|
hy3dgen/shapegen/__pycache__/utils.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/__pycache__/utils.cpython-310.pyc and b/hy3dgen/shapegen/__pycache__/utils.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/__pycache__/__init__.cpython-310.pyc and b/hy3dgen/shapegen/models/__pycache__/__init__.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/__pycache__/conditioner.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/__pycache__/conditioner.cpython-310.pyc and b/hy3dgen/shapegen/models/__pycache__/conditioner.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/autoencoders/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/autoencoders/__pycache__/__init__.cpython-310.pyc and b/hy3dgen/shapegen/models/autoencoders/__pycache__/__init__.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/autoencoders/__pycache__/attention_blocks.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/autoencoders/__pycache__/attention_blocks.cpython-310.pyc and b/hy3dgen/shapegen/models/autoencoders/__pycache__/attention_blocks.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/autoencoders/__pycache__/attention_processors.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/autoencoders/__pycache__/attention_processors.cpython-310.pyc and b/hy3dgen/shapegen/models/autoencoders/__pycache__/attention_processors.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/autoencoders/__pycache__/model.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/autoencoders/__pycache__/model.cpython-310.pyc and b/hy3dgen/shapegen/models/autoencoders/__pycache__/model.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/autoencoders/__pycache__/surface_extractors.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/autoencoders/__pycache__/surface_extractors.cpython-310.pyc and b/hy3dgen/shapegen/models/autoencoders/__pycache__/surface_extractors.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/autoencoders/__pycache__/volume_decoders.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/autoencoders/__pycache__/volume_decoders.cpython-310.pyc and b/hy3dgen/shapegen/models/autoencoders/__pycache__/volume_decoders.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/denoisers/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/denoisers/__pycache__/__init__.cpython-310.pyc and b/hy3dgen/shapegen/models/denoisers/__pycache__/__init__.cpython-310.pyc differ
|
|
hy3dgen/shapegen/models/denoisers/__pycache__/hunyuan3ddit.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/shapegen/models/denoisers/__pycache__/hunyuan3ddit.cpython-310.pyc and b/hy3dgen/shapegen/models/denoisers/__pycache__/hunyuan3ddit.cpython-310.pyc differ
|
|
hy3dgen/texgen/custom_rasterizer/custom_rasterizer_installer.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
def install_cuda_toolkit():
|
5 |
+
try:
|
6 |
+
print("正在安装 CUDA...")
|
7 |
+
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run"
|
8 |
+
CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
|
9 |
+
|
10 |
+
# 下载 CUDA 安装包并显示进度
|
11 |
+
print(f"下载 CUDA 安装包: {CUDA_TOOLKIT_URL}")
|
12 |
+
subprocess.run(["wget", "--progress=bar:force", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE], check=True)
|
13 |
+
|
14 |
+
# 给安装包添加执行权限并显示输出
|
15 |
+
print(f"为安装包添加执行权限: {CUDA_TOOLKIT_FILE}")
|
16 |
+
subprocess.run(["chmod", "+x", CUDA_TOOLKIT_FILE], check=True)
|
17 |
+
|
18 |
+
# 安装 CUDA 12.1,并显示安装过程的输出
|
19 |
+
print("正在安装 CUDA...")
|
20 |
+
subprocess.run([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
21 |
+
|
22 |
+
# 设置环境变量
|
23 |
+
os.environ["CUDA_HOME"] = "/usr/local/cuda"
|
24 |
+
os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
|
25 |
+
os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
|
26 |
+
os.environ["CUDA_HOME"],
|
27 |
+
"" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
|
28 |
+
)
|
29 |
+
|
30 |
+
# 设置 PyTorch 使用的 CUDA 架构
|
31 |
+
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6;9.0" # 可以根据需要调整
|
32 |
+
print("CUDA 12.1 安装并配置完成!")
|
33 |
+
|
34 |
+
except subprocess.CalledProcessError as e:
|
35 |
+
print(f"安装 CUDA 失败: {e}")
|
36 |
+
print(f"错误输出: {e.stderr}")
|
37 |
+
|
38 |
+
def install_custom_rasterizer():
|
39 |
+
try:
|
40 |
+
print("正在编译并安装 custom_rasterizer...")
|
41 |
+
# 假设 custom_rasterizer 代码目录在 /path/to/your/project/texgen/custom_rasterizer
|
42 |
+
custom_rasterizer_dir = "/home/user/app/hy3dgen/texgen/custom_rasterizer" # 替换为实际路径
|
43 |
+
|
44 |
+
# 进入 custom_rasterizer 目录
|
45 |
+
os.chdir(custom_rasterizer_dir)
|
46 |
+
|
47 |
+
# 编译并生成 .whl 文件,并显示输出
|
48 |
+
print("正在编译 custom_rasterizer...")
|
49 |
+
subprocess.run(["python3", "setup.py", "bdist_wheel"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
50 |
+
|
51 |
+
# 获取生成的 .whl 文件路径
|
52 |
+
whl_file_path = os.path.join(custom_rasterizer_dir, "dist", "custom_rasterizer-<version>-cp310-cp310-linux_x86_64.whl")
|
53 |
+
|
54 |
+
print(f"custom_rasterizer 的 .whl 文件已生成:{whl_file_path}")
|
55 |
+
return whl_file_path
|
56 |
+
|
57 |
+
except subprocess.CalledProcessError as e:
|
58 |
+
print(f"安装 custom_rasterizer 失败: {e}")
|
59 |
+
print(f"错误输出: {e.stderr}")
|
60 |
+
|
61 |
+
# 主程序
|
62 |
+
if __name__ == "__main__":
|
63 |
+
try:
|
64 |
+
print("正在安装 CUDA")
|
65 |
+
# 安装 CUDA 12.1
|
66 |
+
install_cuda_toolkit()
|
67 |
+
|
68 |
+
print("正在安装 custom_rasterizer")
|
69 |
+
# 编译并安装 custom_rasterizer
|
70 |
+
whl_file_path = install_custom_rasterizer()
|
71 |
+
|
72 |
+
if whl_file_path:
|
73 |
+
print(f"安装完成,路径是: {whl_file_path}")
|
74 |
+
else:
|
75 |
+
print("安装 custom_rasterizer 失败,未生成 .whl 文件")
|
76 |
+
|
77 |
+
except Exception as e:
|
78 |
+
print(f"程序执行过程中发生错误: {str(e)}")
|
hy3dgen/texgen/utils/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/texgen/utils/__pycache__/__init__.cpython-310.pyc and b/hy3dgen/texgen/utils/__pycache__/__init__.cpython-310.pyc differ
|
|
hy3dgen/texgen/utils/__pycache__/dehighlight_utils.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/texgen/utils/__pycache__/dehighlight_utils.cpython-310.pyc and b/hy3dgen/texgen/utils/__pycache__/dehighlight_utils.cpython-310.pyc differ
|
|
hy3dgen/texgen/utils/__pycache__/imagesuper_utils.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/texgen/utils/__pycache__/imagesuper_utils.cpython-310.pyc and b/hy3dgen/texgen/utils/__pycache__/imagesuper_utils.cpython-310.pyc differ
|
|
hy3dgen/texgen/utils/__pycache__/multiview_utils.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/texgen/utils/__pycache__/multiview_utils.cpython-310.pyc and b/hy3dgen/texgen/utils/__pycache__/multiview_utils.cpython-310.pyc differ
|
|
hy3dgen/texgen/utils/__pycache__/uv_warp_utils.cpython-310.pyc
CHANGED
Binary files a/hy3dgen/texgen/utils/__pycache__/uv_warp_utils.cpython-310.pyc and b/hy3dgen/texgen/utils/__pycache__/uv_warp_utils.cpython-310.pyc differ
|
|