Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def deep_nude_process(inputpath):
|
|
26 |
watermark = cv2.resize(watermark, (w, h), interpolation=cv2.INTER_CUBIC)
|
27 |
return watermark
|
28 |
|
29 |
-
def inference(img
|
30 |
global index
|
31 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
32 |
inputpath = f"input_{index}.jpg"
|
@@ -234,7 +234,7 @@ 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:None, inputs=[], outputs=[gr.State([])], js='''()=>onDemoLoad()''')
|
240 |
demo.queue(max_size=10)
|
|
|
26 |
watermark = cv2.resize(watermark, (w, h), interpolation=cv2.INTER_CUBIC)
|
27 |
return watermark
|
28 |
|
29 |
+
def inference(img):
|
30 |
global index
|
31 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
32 |
inputpath = f"input_{index}.jpg"
|
|
|
234 |
processed_img = inference(img)
|
235 |
return processed_img
|
236 |
|
237 |
+
image_input.change(fn=lambda :None , 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:None, inputs=[], outputs=[gr.State([])], js='''()=>onDemoLoad()''')
|
240 |
demo.queue(max_size=10)
|