Huiwenshi commited on
Commit
002ae29
·
verified ·
1 Parent(s): 2922df3

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -41,3 +41,4 @@ assets/images/teaser.jpg filter=lfs diff=lfs merge=lfs -text
41
  gradio_cache/0/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
42
  gradio_cache/3/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
43
  gradio_cache/4/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
 
 
41
  gradio_cache/0/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
42
  gradio_cache/3/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
43
  gradio_cache/4/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
44
+ gradio_cache/5/textured_mesh.glb filter=lfs diff=lfs merge=lfs -text
gradio_cache/5/input.png ADDED
gradio_cache/5/rembg.png ADDED
gradio_cache/5/textured_mesh.glb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acc1b80df3fa7ab7b865660a34b6f57db16c1e9e1806a8cbb766d7a75bab125b
3
+ size 2230664
gradio_cache/5/textured_mesh.html ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <!-- Import the component -->
6
+ <script src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.1.1/model-viewer.min.js" type="module"></script>
7
+
8
+ <style>
9
+ body {
10
+ margin: 0;
11
+ font-family: Arial, sans-serif;
12
+ }
13
+
14
+ .centered-container {
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ border-radius: 8px;
19
+ border-color: #e5e7eb;
20
+ border-style: solid;
21
+ border-width: 1px;
22
+ }
23
+ </style>
24
+ </head>
25
+
26
+ <body>
27
+ <div class="centered-container">
28
+
29
+ <div class="column is-mobile is-centered">
30
+ <model-viewer style="height: 586px; width: 700px;" rotation-per-second="10deg" id="modelViewer"
31
+ src="./textured_mesh.glb/" disable-tap
32
+ environment-image="neutral" auto-rotate camera-target="0m 0m 0m" orientation="0deg 0deg 170deg" shadow-intensity=".9"
33
+ ar auto-rotate camera-controls>
34
+ </model-viewer>
35
+ </div>
36
+
37
+ </div>
38
+ </body>
39
+
40
+ </html>
gradio_cache/5/white_mesh.glb ADDED
Binary file (721 kB). View file
 
gradio_cache/5/white_mesh.html ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <!-- Import the component -->
6
+ <script src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.1.1/model-viewer.min.js" type="module"></script>
7
+
8
+ <script>
9
+ document.addEventListener('DOMContentLoaded', () => {
10
+ const modelViewers = document.querySelectorAll('model-viewer');
11
+
12
+ modelViewers.forEach(modelViewer => {
13
+ modelViewer.addEventListener('load', (event) => {
14
+ const [material] = modelViewer.model.materials;
15
+ let color = [43, 44, 46, 255];
16
+ color = color.map(x => x / 255);
17
+ material.pbrMetallicRoughness.setMetallicFactor(0.1); // 完全金属
18
+ material.pbrMetallicRoughness.setRoughnessFactor(0.7); // 低粗糙度
19
+ material.pbrMetallicRoughness.setBaseColorFactor(color); // CornflowerBlue in RGB
20
+ });
21
+ });
22
+ });
23
+ </script>
24
+
25
+ <style>
26
+ body {
27
+ margin: 0;
28
+ font-family: Arial, sans-serif;
29
+ }
30
+
31
+ .centered-container {
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ border-radius: 8px;
36
+ border-color: #e5e7eb;
37
+ border-style: solid;
38
+ border-width: 1px;
39
+ }
40
+ </style>
41
+ </head>
42
+
43
+ <body>
44
+ <div class="centered-container">
45
+
46
+ <div class="column is-mobile is-centered">
47
+ <model-viewer style="height: 586px; width: 700px;" rotation-per-second="10deg" id="modelViewer"
48
+ src="./white_mesh.glb/" disable-tap
49
+ environment-image="neutral" auto-rotate camera-target="0m 0m 0m" orientation="0deg 0deg 170deg" shadow-intensity=".9"
50
+ ar auto-rotate camera-controls>
51
+ </model-viewer>
52
+ </div>
53
+
54
+ </div>
55
+ </body>
56
+
57
+ </html>
hg_app.py CHANGED
@@ -6,49 +6,10 @@ if True:
6
  import sys
7
  import shlex
8
 
9
- def install_package(package_path):
10
- # 确保 package_path 是绝对路径
11
- package_path = os.path.abspath(package_path)
12
-
13
- # 设置环境变量
14
- env = os.environ.copy() # 复制当前环境变量
15
- env['CUDA_HOME'] = '/usr/local/cuda'
16
- env['FORCE_CUDA'] = '1'
17
- env['TORCH_CUDA_ARCH_LIST'] = '8.0;8.6;8.9;9.0'
18
-
19
- # 使用 subprocess 调用 setup.py
20
- try:
21
- subprocess.check_call([sys.executable, os.path.join(package_path, 'setup.py'), 'install'], env=env)
22
- print(f"Package installed from {package_path}")
23
- except subprocess.CalledProcessError as e:
24
- print(f"Failed to install package from {package_path}: {e}")
25
-
26
- def install_cuda_toolkit():
27
- # CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
28
- CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
29
- CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
30
- subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
31
- subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
32
- subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
33
-
34
- os.environ["CUDA_HOME"] = "/usr/local/cuda"
35
- os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
36
- os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
37
- os.environ["CUDA_HOME"],
38
- "" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
39
- )
40
- # Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
41
- os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
42
-
43
- # install_cuda_toolkit()
44
  print("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
45
  os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
46
- # print("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && python3 -m pip install .")
47
- # os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && python3 -m pip install .")
48
  print('install custom')
49
- # install_package("/home/user/app/hy3dgen/texgen/custom_rasterizer")
50
  subprocess.run(shlex.split("pip install . --no-build-isolation"), cwd="/home/user/app/hy3dgen/texgen/custom_rasterizer/", check=True)
51
- # os.system("cd /home/user/app/hy3dgen/texgen/custom_rasterizer && CUDA_HOME=/usr/local/cuda FORCE_CUDA=1 TORCH_CUDA_ARCH_LIST='8.0;8.6;8.9;9.0' python setup.py install")
52
 
53
  IP = "0.0.0.0"
54
  PORT = 7860
@@ -457,6 +418,6 @@ if __name__ == '__main__':
457
  app.mount("/static", StaticFiles(directory=static_dir), name="static")
458
 
459
  demo = build_app()
460
- demo.queue(max_size=2)
461
  app = gr.mount_gradio_app(app, demo, path="/")
462
  uvicorn.run(app, host=IP, port=PORT)
 
6
  import sys
7
  import shlex
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  print("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
10
  os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
 
 
11
  print('install custom')
 
12
  subprocess.run(shlex.split("pip install . --no-build-isolation"), cwd="/home/user/app/hy3dgen/texgen/custom_rasterizer/", check=True)
 
13
 
14
  IP = "0.0.0.0"
15
  PORT = 7860
 
418
  app.mount("/static", StaticFiles(directory=static_dir), name="static")
419
 
420
  demo = build_app()
421
+ demo.queue(max_size=1)
422
  app = gr.mount_gradio_app(app, demo, path="/")
423
  uvicorn.run(app, host=IP, port=PORT)