Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import random
|
| 3 |
|
| 4 |
_TITLE = '''
|
| 5 |
# Direct3D-S2 Gigascale 3D Generation Made Easy with Spatial Sparse Attention
|
|
@@ -7,7 +6,6 @@ _TITLE = '''
|
|
| 7 |
|
| 8 |
_DESCRIPTION = '''
|
| 9 |
### [GitHub](https://github.com/DreamTechAI/Direct3D-S2) | [Arxiv](https://arxiv.org/pdf/2505.17412) | [Project Page](https://www.neural4d.com/research/direct3d-s2)
|
| 10 |
-
|
| 11 |
### Please switch to the [Backup Space](https://huggingface.co/spaces/wushuang98/Direct3D-S2-v1.0-demo-backup) if the queue becomes too long
|
| 12 |
'''
|
| 13 |
|
|
@@ -27,20 +25,35 @@ If you find our work useful for your research or applications, please cite using
|
|
| 27 |
If you have any questions, feel free to contact us at <b>wushuang9811@outlook.com</b>.
|
| 28 |
"""
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
with gr.Blocks() as demo:
|
| 33 |
gr.Markdown(_TITLE)
|
| 34 |
gr.Markdown(_DESCRIPTION)
|
| 35 |
-
gr.HTML(
|
| 36 |
-
<iframe
|
| 37 |
-
src="{random.choice(src_list)}"
|
| 38 |
-
width="100%"
|
| 39 |
-
height="1000"
|
| 40 |
-
frameborder="0"
|
| 41 |
-
allow="fullscreen"
|
| 42 |
-
></iframe>
|
| 43 |
-
""")
|
| 44 |
gr.Markdown(_CITE_)
|
| 45 |
|
| 46 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
_TITLE = '''
|
| 4 |
# Direct3D-S2 Gigascale 3D Generation Made Easy with Spatial Sparse Attention
|
|
|
|
| 6 |
|
| 7 |
_DESCRIPTION = '''
|
| 8 |
### [GitHub](https://github.com/DreamTechAI/Direct3D-S2) | [Arxiv](https://arxiv.org/pdf/2505.17412) | [Project Page](https://www.neural4d.com/research/direct3d-s2)
|
|
|
|
| 9 |
### Please switch to the [Backup Space](https://huggingface.co/spaces/wushuang98/Direct3D-S2-v1.0-demo-backup) if the queue becomes too long
|
| 10 |
'''
|
| 11 |
|
|
|
|
| 25 |
If you have any questions, feel free to contact us at <b>wushuang9811@outlook.com</b>.
|
| 26 |
"""
|
| 27 |
|
| 28 |
+
html = '''
|
| 29 |
+
<!DOCTYPE html>
|
| 30 |
+
<html>
|
| 31 |
+
<body>
|
| 32 |
+
<iframe id="myIframe" width="100%" height="1000" frameborder="0" allow="fullscreen"></iframe>
|
| 33 |
+
</body>
|
| 34 |
+
</html>
|
| 35 |
+
'''
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
script = '''
|
| 39 |
+
function createGradio() {
|
| 40 |
+
const urls = [
|
| 41 |
+
"https://api.zmkj.site/",
|
| 42 |
+
"https://api1.zmkj.site/",
|
| 43 |
+
"https://api2.zmkj.site/",
|
| 44 |
+
"https://api3.zmkj.site/",
|
| 45 |
+
"https://api4.zmkj.site/",
|
| 46 |
+
];
|
| 47 |
+
|
| 48 |
+
const randomIndex = Math.floor(Math.random() * urls.length);
|
| 49 |
+
document.getElementById("myIframe").src = urls[randomIndex];
|
| 50 |
+
}
|
| 51 |
+
'''
|
| 52 |
|
| 53 |
+
with gr.Blocks(js=script) as demo:
|
| 54 |
gr.Markdown(_TITLE)
|
| 55 |
gr.Markdown(_DESCRIPTION)
|
| 56 |
+
gr.HTML(html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
gr.Markdown(_CITE_)
|
| 58 |
|
| 59 |
demo.launch()
|