Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- README.md +12 -0
- gradio_app.py +6 -8
- hy3dgen/shapegen/pipelines.py +1 -2
- hy3dgen/texgen/pipelines.py +1 -2
README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
[中文阅读](README_zh_cn.md)
|
| 2 |
|
| 3 |
<p align="center">
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Hunyuan3D-2.0
|
| 3 |
+
emoji: 😻
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 3.39.0
|
| 8 |
+
app_file: app_hg.py
|
| 9 |
+
pinned: false
|
| 10 |
+
short_description: Text-to-3D and Image-to-3D Generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
[中文阅读](README_zh_cn.md)
|
| 14 |
|
| 15 |
<p align="center">
|
gradio_app.py
CHANGED
|
@@ -7,6 +7,8 @@ from glob import glob
|
|
| 7 |
import gradio as gr
|
| 8 |
import torch
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def get_example_img_list():
|
| 12 |
print('Loading example img list ...')
|
|
@@ -77,7 +79,7 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
|
|
| 77 |
</div>
|
| 78 |
"""
|
| 79 |
|
| 80 |
-
|
| 81 |
def _gen_shape(
|
| 82 |
caption,
|
| 83 |
image,
|
|
@@ -134,7 +136,7 @@ def _gen_shape(
|
|
| 134 |
stats['time'] = time_meta
|
| 135 |
return mesh, save_folder
|
| 136 |
|
| 137 |
-
|
| 138 |
def generation_all(
|
| 139 |
caption,
|
| 140 |
image,
|
|
@@ -167,7 +169,7 @@ def generation_all(
|
|
| 167 |
model_viewer_html_textured,
|
| 168 |
)
|
| 169 |
|
| 170 |
-
|
| 171 |
def shape_generation(
|
| 172 |
caption,
|
| 173 |
image,
|
|
@@ -351,8 +353,4 @@ if __name__ == '__main__':
|
|
| 351 |
face_reduce_worker = FaceReducer()
|
| 352 |
|
| 353 |
demo = build_app()
|
| 354 |
-
demo.queue().launch(
|
| 355 |
-
server_name='0.0.0.0',
|
| 356 |
-
server_port=args.port,
|
| 357 |
-
allowed_paths=[SAVE_DIR],
|
| 358 |
-
)
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
import torch
|
| 9 |
|
| 10 |
+
import spaces
|
| 11 |
+
|
| 12 |
|
| 13 |
def get_example_img_list():
|
| 14 |
print('Loading example img list ...')
|
|
|
|
| 79 |
</div>
|
| 80 |
"""
|
| 81 |
|
| 82 |
+
@spaces.GPU()
|
| 83 |
def _gen_shape(
|
| 84 |
caption,
|
| 85 |
image,
|
|
|
|
| 136 |
stats['time'] = time_meta
|
| 137 |
return mesh, save_folder
|
| 138 |
|
| 139 |
+
@spaces.GPU()
|
| 140 |
def generation_all(
|
| 141 |
caption,
|
| 142 |
image,
|
|
|
|
| 169 |
model_viewer_html_textured,
|
| 170 |
)
|
| 171 |
|
| 172 |
+
@spaces.GPU()
|
| 173 |
def shape_generation(
|
| 174 |
caption,
|
| 175 |
image,
|
|
|
|
| 353 |
face_reduce_worker = FaceReducer()
|
| 354 |
|
| 355 |
demo = build_app()
|
| 356 |
+
demo.queue().launch()
|
|
|
|
|
|
|
|
|
|
|
|
hy3dgen/shapegen/pipelines.py
CHANGED
|
@@ -215,8 +215,7 @@ class Hunyuan3DDiTPipeline:
|
|
| 215 |
try:
|
| 216 |
import huggingface_hub
|
| 217 |
path = huggingface_hub.snapshot_download(
|
| 218 |
-
repo_id=
|
| 219 |
-
local_dir=base_dir,
|
| 220 |
resume_download=True
|
| 221 |
)
|
| 222 |
model_path = os.path.join(path, 'hunyuan3d-dit-v2-0')
|
|
|
|
| 215 |
try:
|
| 216 |
import huggingface_hub
|
| 217 |
path = huggingface_hub.snapshot_download(
|
| 218 |
+
repo_id=original_model_path,
|
|
|
|
| 219 |
resume_download=True
|
| 220 |
)
|
| 221 |
model_path = os.path.join(path, 'hunyuan3d-dit-v2-0')
|
hy3dgen/texgen/pipelines.py
CHANGED
|
@@ -71,8 +71,7 @@ class Hunyuan3DPaintPipeline:
|
|
| 71 |
try:
|
| 72 |
import huggingface_hub
|
| 73 |
path = huggingface_hub.snapshot_download(
|
| 74 |
-
repo_id=
|
| 75 |
-
local_dir=base_dir,
|
| 76 |
resume_download=True
|
| 77 |
)
|
| 78 |
delight_model_path = os.path.join(model_path, 'hunyuan3d-delight-v2-0')
|
|
|
|
| 71 |
try:
|
| 72 |
import huggingface_hub
|
| 73 |
path = huggingface_hub.snapshot_download(
|
| 74 |
+
repo_id=original_model_path,
|
|
|
|
| 75 |
resume_download=True
|
| 76 |
)
|
| 77 |
delight_model_path = os.path.join(model_path, 'hunyuan3d-delight-v2-0')
|