freealise commited on
Commit
3d63027
1 Parent(s): 92bcd31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -263,7 +263,7 @@ def pano_depth_to_world_points(depth):
263
  def rgb2gray(rgb):
264
  return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
265
 
266
- def get_mesh(image, depth, blur_data, loadall, dcolor):
267
  global frame_selected
268
  global mesh
269
  global mesh_n
@@ -546,12 +546,12 @@ async(f, c, o, b)=>{
546
  """
547
 
548
  on_click="""
549
- async(of, om, bi, la, bg)=>{
550
  var intv = setInterval(function(){
551
  if (document.getElementById("iframe3D")===null || typeof document.getElementById("iframe3D")==="undefined") {
552
  if (BABYLON && BABYLON.Engine.LastCreatedScene) {
553
  BABYLON.Engine.LastCreatedScene.onAfterRenderObservable.add(function() { //onDataLoadedObservable
554
- var bg = JSON.parse(bg);
555
  for (var i=0; i<bg.length; i++) {
556
  bg[i] /= 255;
557
  }
@@ -1107,7 +1107,7 @@ with gr.Blocks(css=css, js=js) as demo:
1107
  return output_video_path + (json.dumps(locations),)
1108
 
1109
  submit.click(on_submit, inputs=[input_video, model_type, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, coords])
1110
- render.click(partial(get_mesh), inputs=[output_frame, output_mask, blur_in, load_all, bgcolor], outputs=[result, result_file, mesh_order], js=on_click)
1111
 
1112
  example_files = os.listdir('examples')
1113
  example_files.sort()
 
263
  def rgb2gray(rgb):
264
  return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
265
 
266
+ def get_mesh(image, depth, blur_data, loadall):
267
  global frame_selected
268
  global mesh
269
  global mesh_n
 
546
  """
547
 
548
  on_click="""
549
+ async()=>{
550
  var intv = setInterval(function(){
551
  if (document.getElementById("iframe3D")===null || typeof document.getElementById("iframe3D")==="undefined") {
552
  if (BABYLON && BABYLON.Engine.LastCreatedScene) {
553
  BABYLON.Engine.LastCreatedScene.onAfterRenderObservable.add(function() { //onDataLoadedObservable
554
+ var bg = JSON.parse(document.getElementById("bgcolor").getElementsByTagName("textarea")[0].value);
555
  for (var i=0; i<bg.length; i++) {
556
  bg[i] /= 255;
557
  }
 
1107
  return output_video_path + (json.dumps(locations),)
1108
 
1109
  submit.click(on_submit, inputs=[input_video, model_type, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, coords])
1110
+ render.click(partial(get_mesh), inputs=[output_frame, output_mask, blur_in, load_all], outputs=[result, result_file, mesh_order], js=on_click)
1111
 
1112
  example_files = os.listdir('examples')
1113
  example_files.sort()