Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -433,6 +433,14 @@ def extract_glb(state, decimation_target, texture_size, req: gr.Request, progres
|
|
| 433 |
decimation_target=decimation_target, texture_size=texture_size,
|
| 434 |
remesh=True, remesh_band=1, remesh_project=0, use_tqdm=True,
|
| 435 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 436 |
now = datetime.now()
|
| 437 |
timestamp = now.strftime("%Y-%m-%dT%H%M%S") + f".{now.microsecond // 1000:03d}"
|
| 438 |
os.makedirs(user_dir, exist_ok=True)
|
|
@@ -490,7 +498,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 490 |
preview_output = gr.HTML(empty_html, label="3D Asset Preview", show_label=True, container=True)
|
| 491 |
extract_btn = gr.Button("Extract GLB")
|
| 492 |
with gr.Step("Extract", id=1):
|
| 493 |
-
glb_output = gr.Model3D(label="Extracted GLB", height=724, show_label=True, display_mode="solid", clear_color=(0.25, 0.25, 0.25, 1.0), camera_position=(90,
|
| 494 |
download_btn = gr.DownloadButton(label="Download GLB")
|
| 495 |
|
| 496 |
with gr.Column(scale=1, min_width=172):
|
|
|
|
| 433 |
decimation_target=decimation_target, texture_size=texture_size,
|
| 434 |
remesh=True, remesh_band=1, remesh_project=0, use_tqdm=True,
|
| 435 |
)
|
| 436 |
+
# Ry(180°) @ Rx(90°): (x,y,z) → (-x, -z, -y)
|
| 437 |
+
rot = np.array([
|
| 438 |
+
[-1, 0, 0, 0],
|
| 439 |
+
[ 0, 0, -1, 0],
|
| 440 |
+
[ 0, -1, 0, 0],
|
| 441 |
+
[ 0, 0, 0, 1],
|
| 442 |
+
], dtype=np.float64)
|
| 443 |
+
glb.apply_transform(rot)
|
| 444 |
now = datetime.now()
|
| 445 |
timestamp = now.strftime("%Y-%m-%dT%H%M%S") + f".{now.microsecond // 1000:03d}"
|
| 446 |
os.makedirs(user_dir, exist_ok=True)
|
|
|
|
| 498 |
preview_output = gr.HTML(empty_html, label="3D Asset Preview", show_label=True, container=True)
|
| 499 |
extract_btn = gr.Button("Extract GLB")
|
| 500 |
with gr.Step("Extract", id=1):
|
| 501 |
+
glb_output = gr.Model3D(label="Extracted GLB", height=724, show_label=True, display_mode="solid", clear_color=(0.25, 0.25, 0.25, 1.0), camera_position=(-90, 90, None))
|
| 502 |
download_btn = gr.DownloadButton(label="Download GLB")
|
| 503 |
|
| 504 |
with gr.Column(scale=1, min_width=172):
|