freealise commited on
Commit
efb3ffd
·
verified ·
1 Parent(s): c395977

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -76,7 +76,7 @@ def findNormals(gray_depth, format):
76
 
77
  load_svg="""
78
  async(img, dpt)=>{
79
- document.getElementById('inimage').outerHTML = '<image id="inimage" crossorigin="anonymous" href="' + img + '" x="0" y="0" height="100%" width="100%" style="filter: url(#displacementFilter)"/>';
80
  document.getElementById('feimage').outerHTML = '<feImage id="feimage" crossorigin="anonymous" width="100%" height="100%" x="0" y="0" result="10_MAP" href="' + dpt + '"/>';
81
  }
82
  """
@@ -154,7 +154,7 @@ with gr.Blocks(js=js, css=css) as demo:
154
  </svg>
155
  """)
156
  scale = gr.Slider(label="Scale", minimum="-128", maximum="128", value="0", step="1", elem_id="scale")
157
- gray_depth_file.change(fn=None, inputs=[original_image, gray_depth], outputs=None, js=load_svg)
158
  tmp_gray_depth = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
159
  gray_depth.save(tmp_gray_depth.name)
160
 
 
76
 
77
  load_svg="""
78
  async(img, dpt)=>{
79
+ document.getElementById('inimage').outerHTML = '<image id="inimage" crossorigin="anonymous" href="' + img['composite'] + '" x="0" y="0" height="100%" width="100%" style="filter: url(#displacementFilter)"/>';
80
  document.getElementById('feimage').outerHTML = '<feImage id="feimage" crossorigin="anonymous" width="100%" height="100%" x="0" y="0" result="10_MAP" href="' + dpt + '"/>';
81
  }
82
  """
 
154
  </svg>
155
  """)
156
  scale = gr.Slider(label="Scale", minimum="-128", maximum="128", value="0", step="1", elem_id="scale")
157
+ gray_depth_file.change(fn=None, inputs=[input_image, gray_depth_file], outputs=None, js=load_svg)
158
  tmp_gray_depth = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
159
  gray_depth.save(tmp_gray_depth.name)
160