Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -438,9 +438,14 @@ def update():
|
|
438 |
return
|
439 |
|
440 |
|
441 |
-
|
442 |
async()=>{
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
444 |
}
|
445 |
"""
|
446 |
|
@@ -537,8 +542,7 @@ with gr.Blocks(css=css) as demo:
|
|
537 |
model_type = gr.Dropdown([("small", "vits"), ("base", "vitb"), ("large", "vitl")], type="value", value="vits", label='Model Type')
|
538 |
processed_video = gr.Video(label="Output Video", format="mp4")
|
539 |
processed_zip = gr.File(label="Output Archive")
|
540 |
-
result = gr.Model3D(label="3D Mesh", clear_color=[0.5, 0.5, 0.5, 0.0], camera_position=[0, 90, 0], interactive=True, elem_id="model3D")
|
541 |
-
result.change(update, inputs=None, outputs=None, js=on_load)
|
542 |
result_file = gr.File(label="3D file (.glb)")
|
543 |
svg_in = gr.HTML(value="""<svg id='svg_in' height='32' width='256' viewBox='0 0 256 32' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' style='touch-action:none;background-color:#808080;' onpointerdown='
|
544 |
try{
|
@@ -902,6 +906,7 @@ with gr.Blocks(css=css) as demo:
|
|
902 |
<canvas id='cnv_out'/>""")
|
903 |
load_all = gr.Checkbox(label="Load all")
|
904 |
render = gr.Button("Render")
|
|
|
905 |
|
906 |
def on_submit(uploaded_video,model_type,coordinates,blur):
|
907 |
global locations
|
|
|
438 |
return
|
439 |
|
440 |
|
441 |
+
on_click="""
|
442 |
async()=>{
|
443 |
+
var intv = setInterval(function(){
|
444 |
+
if (BABYLON) {
|
445 |
+
alert(BABYLON);
|
446 |
+
clearInterval(intv);
|
447 |
+
}
|
448 |
+
}, 40);
|
449 |
}
|
450 |
"""
|
451 |
|
|
|
542 |
model_type = gr.Dropdown([("small", "vits"), ("base", "vitb"), ("large", "vitl")], type="value", value="vits", label='Model Type')
|
543 |
processed_video = gr.Video(label="Output Video", format="mp4")
|
544 |
processed_zip = gr.File(label="Output Archive")
|
545 |
+
result = gr.Model3D(label="3D Mesh", clear_color=[0.5, 0.5, 0.5, 0.0], camera_position=[0, 90, 0], interactive=True, elem_id="model3D")
|
|
|
546 |
result_file = gr.File(label="3D file (.glb)")
|
547 |
svg_in = gr.HTML(value="""<svg id='svg_in' height='32' width='256' viewBox='0 0 256 32' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' style='touch-action:none;background-color:#808080;' onpointerdown='
|
548 |
try{
|
|
|
906 |
<canvas id='cnv_out'/>""")
|
907 |
load_all = gr.Checkbox(label="Load all")
|
908 |
render = gr.Button("Render")
|
909 |
+
render.click(update, inputs=None, outputs=None, js=on_click)
|
910 |
|
911 |
def on_submit(uploaded_video,model_type,coordinates,blur):
|
912 |
global locations
|