nsfwalex commited on
Commit
3c053c9
โ€ข
1 Parent(s): a534a1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -116,7 +116,7 @@ footer {display: none !important;}
116
  """
117
  js='''
118
  <script>
119
- window.postMessageToParent = function(event, source, value) {
120
  // Construct the message object with the provided parameters
121
  console.log("post start",event, source, value);
122
  const message = {
@@ -128,6 +128,7 @@ window.postMessageToParent = function(event, source, value) {
128
  // Post the message to the parent window
129
  window.parent.postMessage(message, '*');
130
  console.log("post finish");
 
131
  }
132
  </script>
133
  '''
@@ -146,6 +147,6 @@ with gr.Blocks(css=css, head=js) as demo:
146
  processed_img = inference(img)
147
  return processed_img
148
 
149
- process_button.click(update_status, inputs=image_input, outputs=image_input)#, js='''() => window.postMessageToParent("process_started", "deepnude_gan", "click_nude")'''
150
  demo.queue(max_size=10)
151
  demo.launch()
 
116
  """
117
  js='''
118
  <script>
119
+ window.postMessageToParent = function(img, event, source, value) {
120
  // Construct the message object with the provided parameters
121
  console.log("post start",event, source, value);
122
  const message = {
 
128
  // Post the message to the parent window
129
  window.parent.postMessage(message, '*');
130
  console.log("post finish");
131
+ return img;
132
  }
133
  </script>
134
  '''
 
147
  processed_img = inference(img)
148
  return processed_img
149
 
150
+ process_button.click(update_status, inputs=image_input, outputs=image_input)#, js='''(i) => window.postMessageToParent(i, "process_started", "deepnude_gan", "click_nude")'''
151
  demo.queue(max_size=10)
152
  demo.launch()