Update app.py
Browse files
app.py
CHANGED
|
@@ -559,7 +559,7 @@ def draw_mask(o, b, v, d, evt: gr.EventData):
|
|
| 559 |
|
| 560 |
|
| 561 |
load_model="""
|
| 562 |
-
async(c, o, p, d, n, m)=>{
|
| 563 |
var intv = setInterval(function(){
|
| 564 |
if (document.getElementById("model3D").getElementsByTagName("canvas")[0]) {
|
| 565 |
try {
|
|
@@ -664,10 +664,14 @@ async(c, o, p, d, n, m)=>{
|
|
| 664 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].rotation.y = coords[o_[j]].heading / 180 * Math.PI;
|
| 665 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].rotation.z = -coords[o_[j]].pitch / 180 * Math.PI;
|
| 666 |
}*/
|
| 667 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 668 |
window.videoDome = new BABYLON.VideoDome(
|
| 669 |
-
"videoDome",
|
| 670 |
-
[document.getElementById("output_video").getElementsByTagName("video")[0].src],
|
| 671 |
{
|
| 672 |
resolution: 16,
|
| 673 |
size: 512,
|
|
@@ -1367,7 +1371,7 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
| 1367 |
return output_video_path + (json.dumps(locations),)
|
| 1368 |
|
| 1369 |
submit.click(on_submit, inputs=[input_video, model_type, blur_in, boffset, bsize, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, depth_video, coords])
|
| 1370 |
-
render.click(None, inputs=[coords, mesh_order, output_frame, output_mask, selected, output_depth], outputs=None, js=load_model)
|
| 1371 |
render.click(partial(get_mesh), inputs=[output_frame, output_mask, blur_in, load_all], outputs=[result, mesh_order])
|
| 1372 |
|
| 1373 |
example_files = [["./examples/streetview.mp4", "vits", blurin, 1, 32, example_coords]]
|
|
|
|
| 559 |
|
| 560 |
|
| 561 |
load_model="""
|
| 562 |
+
async(c, o, p, d, n, m, s)=>{
|
| 563 |
var intv = setInterval(function(){
|
| 564 |
if (document.getElementById("model3D").getElementsByTagName("canvas")[0]) {
|
| 565 |
try {
|
|
|
|
| 664 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].rotation.y = coords[o_[j]].heading / 180 * Math.PI;
|
| 665 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].rotation.z = -coords[o_[j]].pitch / 180 * Math.PI;
|
| 666 |
}*/
|
| 667 |
+
|
| 668 |
+
if (s == false) {
|
| 669 |
+
v_url = document.getElementById("output_video").getElementsByTagName("video")[0].src;
|
| 670 |
+
} else {
|
| 671 |
+
v_url = document.getElementById("depth_video").getElementsByTagName("video")[0].src;
|
| 672 |
+
}
|
| 673 |
window.videoDome = new BABYLON.VideoDome(
|
| 674 |
+
"videoDome", [v_url],
|
|
|
|
| 675 |
{
|
| 676 |
resolution: 16,
|
| 677 |
size: 512,
|
|
|
|
| 1371 |
return output_video_path + (json.dumps(locations),)
|
| 1372 |
|
| 1373 |
submit.click(on_submit, inputs=[input_video, model_type, blur_in, boffset, bsize, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, depth_video, coords])
|
| 1374 |
+
render.click(None, inputs=[coords, mesh_order, output_frame, output_mask, selected, output_depth, output_switch], outputs=None, js=load_model)
|
| 1375 |
render.click(partial(get_mesh), inputs=[output_frame, output_mask, blur_in, load_all], outputs=[result, mesh_order])
|
| 1376 |
|
| 1377 |
example_files = [["./examples/streetview.mp4", "vits", blurin, 1, 32, example_coords]]
|