Spaces:
Running
on
T4
Running
on
T4
Upload gradio_app.py
Browse files- gradio_app.py +9 -14
gradio_app.py
CHANGED
@@ -157,13 +157,13 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
|
|
157 |
f'Find html file {mesh_file_path}, {os.path.exists(mesh_file_path)}')
|
158 |
|
159 |
html = f"""
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
"""
|
168 |
|
169 |
return html
|
@@ -421,12 +421,7 @@ def build_app():
|
|
421 |
|
422 |
"""
|
423 |
|
424 |
-
|
425 |
-
<script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
|
426 |
-
"""
|
427 |
-
|
428 |
-
|
429 |
-
with gr.Blocks(theme=gr.themes.Base(), title='Hunyuan-3D-2.0', analytics_enabled=False, css=custom_css, js=custom_js) as demo:
|
430 |
gr.HTML(title_html)
|
431 |
|
432 |
with gr.Row():
|
@@ -668,7 +663,7 @@ if __name__ == '__main__':
|
|
668 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
669 |
|
670 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
671 |
-
MV_MODE =
|
672 |
TURBO_MODE = 'turbo' in args.subfolder
|
673 |
|
674 |
HTML_HEIGHT = 690 if MV_MODE else 650
|
|
|
157 |
f'Find html file {mesh_file_path}, {os.path.exists(mesh_file_path)}')
|
158 |
|
159 |
html = f"""
|
160 |
+
<script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
|
161 |
+
<model-viewer src="{mesh_file_path}"
|
162 |
+
alt="3D Model"
|
163 |
+
camera-controls
|
164 |
+
auto-rotate
|
165 |
+
style="height: 690px; width: 500px;">
|
166 |
+
</model-viewer>
|
167 |
"""
|
168 |
|
169 |
return html
|
|
|
421 |
|
422 |
"""
|
423 |
|
424 |
+
with gr.Blocks(theme=gr.themes.Base(), title='Hunyuan-3D-2.0', analytics_enabled=False, css=custom_css) as demo:
|
|
|
|
|
|
|
|
|
|
|
425 |
gr.HTML(title_html)
|
426 |
|
427 |
with gr.Row():
|
|
|
663 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
664 |
|
665 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
666 |
+
MV_MODE = True
|
667 |
TURBO_MODE = 'turbo' in args.subfolder
|
668 |
|
669 |
HTML_HEIGHT = 690 if MV_MODE else 650
|