Update app.py
Browse files
app.py
CHANGED
@@ -640,23 +640,6 @@ async(c, o, p, d, n, m)=>{
|
|
640 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromDiffuseTexture = true;
|
641 |
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);});
|
642 |
}
|
643 |
-
loadEditControl();
|
644 |
-
const editControl = new EditControl(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1], BABYLON.Engine.LastCreatedScene.activeCamera, document.getElementById("model3D").getElementsByTagName("canvas")[0], 1.0, true, 0.02);
|
645 |
-
editControl.enableTranslation();
|
646 |
-
|
647 |
-
for (var j=0; j<o_.length; j++) {
|
648 |
-
const opt = document.createElement("option");
|
649 |
-
opt.value = j;
|
650 |
-
opt.innerText = j;
|
651 |
-
if (j==0) {
|
652 |
-
opt.selected = true;
|
653 |
-
}
|
654 |
-
document.getElementById("cnum").appendChild(opt);
|
655 |
-
}
|
656 |
-
document.getElementById("cnum").onchange = function(e) {
|
657 |
-
//editControl.switchTo(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1-parseInt(e.target.value)], true);
|
658 |
-
}
|
659 |
-
|
660 |
if (document.getElementById("model")) {
|
661 |
document.getElementById("model").appendChild(document.getElementById("model3D"));
|
662 |
toggleDisplay("model");
|
@@ -810,8 +793,6 @@ css = """
|
|
810 |
"""
|
811 |
|
812 |
head = """
|
813 |
-
<script src='https://code.jquery.com/pep/0.4.2/pep.js'></script>
|
814 |
-
<script src='https://huggingface.co/spaces/freealise/Depth-Anything-V2-Video/resolve/main/EditControl.js'></script>
|
815 |
"""
|
816 |
|
817 |
title = "# Depth Anything V2 Video"
|
@@ -987,39 +968,6 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
987 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = this.value;
|
988 |
this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure;
|
989 |
'/><span>1.0</span>""")
|
990 |
-
control = gr.HTML(value="""<select id='cnum' style='color:black;line-height:1em'></select>
|
991 |
-
mode<select id='c_mode' style='color:black;line-height:1em' onchange='
|
992 |
-
if (this.value == \"move\") {
|
993 |
-
editControl.show();
|
994 |
-
editControl.enableTranslation();
|
995 |
-
|
996 |
-
editControl.disableRotation();
|
997 |
-
editControl.disableScaling();
|
998 |
-
} else if (this.value == \"rotate\") {
|
999 |
-
editControl.show();
|
1000 |
-
editControl.enableRotation();
|
1001 |
-
editControl.setRotGuideFull(false) //This makes the rotation guides 360 degree(true) or 90 degree(false) .90 degree looks less cluttered.
|
1002 |
-
editControl.returnEuler(true); // Optional. This will return rotation in euler instead of quaternion. Quaternion is the default.
|
1003 |
-
editControl.disableTranslation();
|
1004 |
-
editControl.disableScaling();
|
1005 |
-
} else if (this.value == \"scale\") {
|
1006 |
-
editControl.show();
|
1007 |
-
editControl.enableScaling();
|
1008 |
-
|
1009 |
-
editControl.disableTranslation();
|
1010 |
-
editControl.disableRotation();
|
1011 |
-
} else {
|
1012 |
-
editControl.disableTranslation();
|
1013 |
-
editControl.disableRotation();
|
1014 |
-
editControl.disableScaling();
|
1015 |
-
editControl.hide();
|
1016 |
-
}'>
|
1017 |
-
<option selected value='move'>move</option>
|
1018 |
-
<option value='rotate'>rotate</option>
|
1019 |
-
<option value='scale'>scale</option>
|
1020 |
-
<option value='-'>-</option>
|
1021 |
-
</select>
|
1022 |
-
""")
|
1023 |
render = gr.Button("Render")
|
1024 |
input_json.input(show_json, inputs=[input_json], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
|
1025 |
|
|
|
640 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromDiffuseTexture = true;
|
641 |
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);});
|
642 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
if (document.getElementById("model")) {
|
644 |
document.getElementById("model").appendChild(document.getElementById("model3D"));
|
645 |
toggleDisplay("model");
|
|
|
793 |
"""
|
794 |
|
795 |
head = """
|
|
|
|
|
796 |
"""
|
797 |
|
798 |
title = "# Depth Anything V2 Video"
|
|
|
968 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = this.value;
|
969 |
this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure;
|
970 |
'/><span>1.0</span>""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
971 |
render = gr.Button("Render")
|
972 |
input_json.input(show_json, inputs=[input_json], outputs=[processed_video, processed_zip, output_frame, output_mask, output_depth, coords])
|
973 |
|