Update app.py
Browse files
app.py
CHANGED
|
@@ -639,6 +639,9 @@ async(c, o, p, d, n, m)=>{
|
|
| 639 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromDiffuseTexture = true;
|
| 640 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].applyDisplacementMap(m[o_[j]].url, 0, 255, function(m){try{alert(BABYLON.Engine.Version);}catch(e){alert(e);}}, null, null, true, function(e){alert(e);});
|
| 641 |
}
|
|
|
|
|
|
|
|
|
|
| 642 |
if (document.getElementById("model")) {
|
| 643 |
document.getElementById("model").appendChild(document.getElementById("model3D"));
|
| 644 |
toggleDisplay("model");
|
|
@@ -791,6 +794,11 @@ css = """
|
|
| 791 |
}
|
| 792 |
"""
|
| 793 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 794 |
title = "# Depth Anything V2 Video"
|
| 795 |
description = """**Depth Anything V2** on full video files, intended for Google Street View panorama slideshows.
|
| 796 |
Please refer to the [paper](https://arxiv.org/abs/2406.09414), [project page](https://depth-anything-v2.github.io), and [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
|
|
@@ -814,7 +822,7 @@ Please refer to the [paper](https://arxiv.org/abs/2406.09414), [project page](ht
|
|
| 814 |
# def predict_depth(model, image):
|
| 815 |
# return model(image)
|
| 816 |
|
| 817 |
-
with gr.Blocks(css=css, js=js) as demo:
|
| 818 |
gr.Markdown(title)
|
| 819 |
gr.Markdown(description)
|
| 820 |
gr.Markdown("### Video Depth Prediction demo")
|
|
|
|
| 639 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromDiffuseTexture = true;
|
| 640 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].applyDisplacementMap(m[o_[j]].url, 0, 255, function(m){try{alert(BABYLON.Engine.Version);}catch(e){alert(e);}}, null, null, true, function(e){alert(e);});
|
| 641 |
}
|
| 642 |
+
const editControl = new EditControl(BABYLON.Engine.LastCreatedScene.meshes[parseInt(document.getElementById("fnum").getElementsByTagName("input")[0].value)], BABYLON.Engine.LastCreatedScene.activeCamera, document.getElementById("model3D").getElementsByTagName("canvas")[0], 1.0, true, 0.02);
|
| 643 |
+
editControl.enableTranslation();
|
| 644 |
+
|
| 645 |
if (document.getElementById("model")) {
|
| 646 |
document.getElementById("model").appendChild(document.getElementById("model3D"));
|
| 647 |
toggleDisplay("model");
|
|
|
|
| 794 |
}
|
| 795 |
"""
|
| 796 |
|
| 797 |
+
head = """
|
| 798 |
+
<script src="https://code.jquery.com/pep/0.4.2/pep.js"></script>
|
| 799 |
+
<script src="EditControl.js"></script>
|
| 800 |
+
"""
|
| 801 |
+
|
| 802 |
title = "# Depth Anything V2 Video"
|
| 803 |
description = """**Depth Anything V2** on full video files, intended for Google Street View panorama slideshows.
|
| 804 |
Please refer to the [paper](https://arxiv.org/abs/2406.09414), [project page](https://depth-anything-v2.github.io), and [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
|
|
|
|
| 822 |
# def predict_depth(model, image):
|
| 823 |
# return model(image)
|
| 824 |
|
| 825 |
+
with gr.Blocks(css=css, js=js, head=head) as demo:
|
| 826 |
gr.Markdown(title)
|
| 827 |
gr.Markdown(description)
|
| 828 |
gr.Markdown("### Video Depth Prediction demo")
|