Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
faaf8be
1
Parent(s):
8fd2f97
update
Browse files
app.py
CHANGED
|
@@ -89,6 +89,7 @@ css = """
|
|
| 89 |
|
| 90 |
/* Previewer */
|
| 91 |
.previewer-container {
|
|
|
|
| 92 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
| 93 |
width: 100%;
|
| 94 |
height: 722px;
|
|
@@ -100,6 +101,44 @@ css = """
|
|
| 100 |
justify-content: center;
|
| 101 |
}
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
/* Row 1: Display Modes */
|
| 104 |
.previewer-container .mode-row {
|
| 105 |
width: 100%;
|
|
@@ -437,6 +476,14 @@ def image_to_3d(
|
|
| 437 |
# Assemble the full component
|
| 438 |
full_html = f"""
|
| 439 |
<div class="previewer-container">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
<!-- Row 1: Viewport containing 48 static <img> tags -->
|
| 441 |
<div class="display-row">
|
| 442 |
{images_html}
|
|
@@ -508,7 +555,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 508 |
gr.Markdown("""
|
| 509 |
## Image to 3D Asset with [TRELLIS.2](https://microsoft.github.io/trellis.2)
|
| 510 |
* Upload an image (preferably with an alpha-masked foreground object) and click Generate to create a 3D asset.
|
| 511 |
-
*
|
| 512 |
""")
|
| 513 |
|
| 514 |
with gr.Row():
|
|
|
|
| 89 |
|
| 90 |
/* Previewer */
|
| 91 |
.previewer-container {
|
| 92 |
+
position: relative;
|
| 93 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
| 94 |
width: 100%;
|
| 95 |
height: 722px;
|
|
|
|
| 101 |
justify-content: center;
|
| 102 |
}
|
| 103 |
|
| 104 |
+
.previewer-container .tips-icon {
|
| 105 |
+
position: absolute;
|
| 106 |
+
right: 10px;
|
| 107 |
+
top: 10px;
|
| 108 |
+
z-index: 10;
|
| 109 |
+
border-radius: 10px;
|
| 110 |
+
color: #fff;
|
| 111 |
+
background-color: var(--color-accent);
|
| 112 |
+
padding: 3px 6px;
|
| 113 |
+
user-select: none;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
.previewer-container .tips-text {
|
| 117 |
+
position: absolute;
|
| 118 |
+
right: 10px;
|
| 119 |
+
top: 50px;
|
| 120 |
+
color: #fff;
|
| 121 |
+
background-color: var(--color-accent);
|
| 122 |
+
border-radius: 10px;
|
| 123 |
+
padding: 6px;
|
| 124 |
+
text-align: left;
|
| 125 |
+
max-width: 300px;
|
| 126 |
+
z-index: 10;
|
| 127 |
+
transition: all 0.3s;
|
| 128 |
+
opacity: 0%;
|
| 129 |
+
user-select: none;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.previewer-container .tips-text p {
|
| 133 |
+
font-size: 14px;
|
| 134 |
+
line-height: 1.2;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
.tips-icon:hover + .tips-text {
|
| 138 |
+
display: block;
|
| 139 |
+
opacity: 100%;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
/* Row 1: Display Modes */
|
| 143 |
.previewer-container .mode-row {
|
| 144 |
width: 100%;
|
|
|
|
| 476 |
# Assemble the full component
|
| 477 |
full_html = f"""
|
| 478 |
<div class="previewer-container">
|
| 479 |
+
<div class="tips-wrapper">
|
| 480 |
+
<div class="tips-icon">💡Tips</div>
|
| 481 |
+
<div class="tips-text">
|
| 482 |
+
<p>● <b>Render Mode</b> - Click on the circular buttons to switch between different render modes.</p>
|
| 483 |
+
<p>● <b>View Angle</b> - Drag the slider to change the view angle.</p>
|
| 484 |
+
</div>
|
| 485 |
+
</div>
|
| 486 |
+
|
| 487 |
<!-- Row 1: Viewport containing 48 static <img> tags -->
|
| 488 |
<div class="display-row">
|
| 489 |
{images_html}
|
|
|
|
| 555 |
gr.Markdown("""
|
| 556 |
## Image to 3D Asset with [TRELLIS.2](https://microsoft.github.io/trellis.2)
|
| 557 |
* Upload an image (preferably with an alpha-masked foreground object) and click Generate to create a 3D asset.
|
| 558 |
+
* Click Extract GLB to export and download the generated GLB file if you're satisfied with the result. Otherwise, try another time.
|
| 559 |
""")
|
| 560 |
|
| 561 |
with gr.Row():
|