Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -195,7 +195,7 @@ function uploadImage(image, event, source, value) {
|
|
195 |
}
|
196 |
return;
|
197 |
}
|
198 |
-
function onDemoLoad(){
|
199 |
let envInfo = getEnvInfo();
|
200 |
console.log(envInfo);
|
201 |
if (isValidEnv()){
|
@@ -234,8 +234,8 @@ with gr.Blocks(css=css, head=js) as demo:
|
|
234 |
processed_img = inference(img)
|
235 |
return processed_img
|
236 |
|
237 |
-
image_input.change(fn=lambda :
|
238 |
process_button.click(update_status, inputs=image_input, outputs=image_input, js='''(i) => window.postMessageToParent(i, "process_started", "demo_hf_deepnude_gan_card", "click_nude")''')
|
239 |
-
demo.load(fn=lambda:
|
240 |
demo.queue(max_size=10)
|
241 |
demo.launch()
|
|
|
195 |
}
|
196 |
return;
|
197 |
}
|
198 |
+
function onDemoLoad(x){
|
199 |
let envInfo = getEnvInfo();
|
200 |
console.log(envInfo);
|
201 |
if (isValidEnv()){
|
|
|
234 |
processed_img = inference(img)
|
235 |
return processed_img
|
236 |
|
237 |
+
image_input.change(fn=lambda x:x , inputs=[image_input], outputs=[gr.State([])], js='''(img)=>window.uploadImage(img,"process_finished","demo_hf_deepnude_gan_card", "")''')
|
238 |
process_button.click(update_status, inputs=image_input, outputs=image_input, js='''(i) => window.postMessageToParent(i, "process_started", "demo_hf_deepnude_gan_card", "click_nude")''')
|
239 |
+
demo.load(fn=lambda x:x, inputs=[gr.State([])], outputs=[gr.State([])], js='''(x)=>onDemoLoad(x)''')
|
240 |
demo.queue(max_size=10)
|
241 |
demo.launch()
|