Update app.py
Browse files
app.py
CHANGED
|
@@ -1260,6 +1260,27 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
| 1260 |
load_all = gr.Checkbox(label="Load all")
|
| 1261 |
|
| 1262 |
with gr.Group():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1263 |
html = gr.HTML(value="""<span style='max-width:50%;float:right'><label for='zoom' style='width:8em'>Zoom</label><input id='zoom' type='range' style='width:128px;height:1em;' value='0.8' min='0.157' max='1.57' step='0.001' oninput='
|
| 1264 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
| 1265 |
var evt = document.createEvent(\"Event\");
|
|
@@ -1289,27 +1310,6 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
| 1289 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = this.value;
|
| 1290 |
this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure;
|
| 1291 |
'/> <span>1.0</span></span>""")
|
| 1292 |
-
camera = gr.HTML(value="""<div style='width:128px;height:128px;border:1px dotted gray;padding:0;margin:0;float:left;' id='seek'></div>
|
| 1293 |
-
<a href='#' id='reset_cam' style='width:12em;float:left;color:white' onclick='
|
| 1294 |
-
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
| 1295 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
|
| 1296 |
-
screenshot: true,
|
| 1297 |
-
pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera])
|
| 1298 |
-
}
|
| 1299 |
-
}
|
| 1300 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.radius = 0;
|
| 1301 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.alpha = 0;
|
| 1302 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.beta = Math.PI / 2;
|
| 1303 |
-
|
| 1304 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.samples = 4;
|
| 1305 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.fov = document.getElementById(\"zoom\").value;
|
| 1306 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.contrast = document.getElementById(\"contrast\").value;
|
| 1307 |
-
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = document.getElementById(\"exposure\").value;
|
| 1308 |
-
|
| 1309 |
-
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + Math.ceil(Math.log2(Math.PI/document.getElementById(\"zoom\").value))/2.0*Math.sqrt(2.0) + \"px)\";
|
| 1310 |
-
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].oncontextmenu = function(e){e.preventDefault();}
|
| 1311 |
-
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].ondrag = function(e){e.preventDefault();}
|
| 1312 |
-
'>Reset camera</a>""")
|
| 1313 |
snapshot = gr.HTML(value="""<span style='max-width:50%;float:right'>
|
| 1314 |
<a href='#' onclick='snapshot();'>Screenshot</a>
|
| 1315 |
<a href='#' onclick='record_video();'>Record</a>
|
|
|
|
| 1260 |
load_all = gr.Checkbox(label="Load all")
|
| 1261 |
|
| 1262 |
with gr.Group():
|
| 1263 |
+
camera = gr.HTML(value="""<div style='width:128px;height:128px;border:1px dotted gray;padding:0;margin:0;float:left;' id='seek'></div><br/>
|
| 1264 |
+
<a href='#' id='reset_cam' style='width:12em;float:left;color:white' onclick='
|
| 1265 |
+
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
| 1266 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
|
| 1267 |
+
screenshot: true,
|
| 1268 |
+
pipeline: new BABYLON.DefaultRenderingPipeline(\"default\", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera])
|
| 1269 |
+
}
|
| 1270 |
+
}
|
| 1271 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.radius = 0;
|
| 1272 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.alpha = 0;
|
| 1273 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.beta = Math.PI / 2;
|
| 1274 |
+
|
| 1275 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.samples = 4;
|
| 1276 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.fov = document.getElementById(\"zoom\").value;
|
| 1277 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.contrast = document.getElementById(\"contrast\").value;
|
| 1278 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = document.getElementById(\"exposure\").value;
|
| 1279 |
+
|
| 1280 |
+
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + Math.ceil(Math.log2(Math.PI/document.getElementById(\"zoom\").value))/2.0*Math.sqrt(2.0) + \"px)\";
|
| 1281 |
+
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].oncontextmenu = function(e){e.preventDefault();}
|
| 1282 |
+
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].ondrag = function(e){e.preventDefault();}
|
| 1283 |
+
'>Reset camera</a>""")
|
| 1284 |
html = gr.HTML(value="""<span style='max-width:50%;float:right'><label for='zoom' style='width:8em'>Zoom</label><input id='zoom' type='range' style='width:128px;height:1em;' value='0.8' min='0.157' max='1.57' step='0.001' oninput='
|
| 1285 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
| 1286 |
var evt = document.createEvent(\"Event\");
|
|
|
|
| 1310 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure = this.value;
|
| 1311 |
this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.imageProcessing.exposure;
|
| 1312 |
'/> <span>1.0</span></span>""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1313 |
snapshot = gr.HTML(value="""<span style='max-width:50%;float:right'>
|
| 1314 |
<a href='#' onclick='snapshot();'>Screenshot</a>
|
| 1315 |
<a href='#' onclick='record_video();'>Record</a>
|