hysts HF Staff commited on
Commit
f6b07bb
·
1 Parent(s): bdd6399
Files changed (2) hide show
  1. app.py +9 -8
  2. style.css +4 -0
app.py CHANGED
@@ -16,6 +16,13 @@ from trellis.pipelines import TrellisImageTo3DPipeline
16
  from trellis.representations import Gaussian, MeshExtractResult
17
  from trellis.utils import postprocessing_utils, render_utils
18
 
 
 
 
 
 
 
 
19
  MAX_SEED = np.iinfo(np.int32).max
20
  TEMP_DIR = gr.utils.get_upload_folder()
21
 
@@ -215,14 +222,8 @@ def extract_gaussian(state_path: str) -> str:
215
  return gaussian_file.name
216
 
217
 
218
- with gr.Blocks(delete_cache=(600, 600)) as demo:
219
- gr.Markdown("""
220
- ## Image to 3D Asset with [TRELLIS](https://trellis3d.github.io/)
221
- * Upload an image and click "Generate" to create a 3D asset. If the image has alpha channel, it be used as the mask. Otherwise, we use `rembg` to remove the background.
222
- * If you find the generated 3D asset satisfactory, click "Extract GLB" to extract the GLB file and download it.
223
-
224
- ✨New: 1) Experimental multi-image support. 2) Gaussian file extraction.
225
- """)
226
 
227
  with gr.Row():
228
  with gr.Column():
 
16
  from trellis.representations import Gaussian, MeshExtractResult
17
  from trellis.utils import postprocessing_utils, render_utils
18
 
19
+ DESCRIPTION = """\
20
+ # Image to 3D Asset with [TRELLIS](https://trellis3d.github.io/)
21
+
22
+ - Upload an image and click "Generate" to create a 3D asset. If the image has alpha channel, it be used as the mask. Otherwise, we use `rembg` to remove the background.
23
+ - If you find the generated 3D asset satisfactory, click "Extract GLB" to extract the GLB file and download it.
24
+ """
25
+
26
  MAX_SEED = np.iinfo(np.int32).max
27
  TEMP_DIR = gr.utils.get_upload_folder()
28
 
 
222
  return gaussian_file.name
223
 
224
 
225
+ with gr.Blocks(css_paths="style.css", delete_cache=(600, 600)) as demo:
226
+ gr.Markdown(DESCRIPTION)
 
 
 
 
 
 
227
 
228
  with gr.Row():
229
  with gr.Column():
style.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ h1 {
2
+ text-align: center;
3
+ display: block;
4
+ }