Spaces:
Running
Running
Update demo.py
Browse files30 unmodified lines31323334343536378 unmodified lines4647484950514950511 unmodified line5354555956575830 unmodified lines printedCopy = process_results.get("printedCopy")
# Check for "Spoof" condition if screenReply < screenReplyThreshold or portraitReplace < portraitReplaceThreshold or printedCopy < printedCopyThreshold: if screenReply < 0.5 or portraitReplace < 0.5 or printedCopy < 0.5: process_results["status"] = "Spoof" else: process_results["status"] = "Real"8 unmodified lines with gr.Row(): with gr.Column(): image_input = gr.Image(type='pil') screenReplyThreshold = gr.Slider(minimum=0, maximum=1, value=0.5, label="Screen Reply Threshold") printedCopyThreshold = gr.Slider(minimum=0, maximum=1, value=0.5, label="Printed Copy Threshold") portraitReplaceThreshold = gr.Slider(minimum=0, maximum=1, value=0.5, label="Portrait Replace Threshold") gr.Examples(['examples/1.jpg', 'examples/2.jpg', 'examples/3.jpg'], inputs=image_input)1 unmodified line with gr.Column(): json_output = gr.JSON() process_button.click(process_image, inputs=[image_input, screenReplyThreshold, printedCopyThreshold, portraitReplaceThreshold], outputs=[json_output]) process_button.click(process_image, inputs=[image_input], outputs=[json_output])
demo.launch(server_name="0.0.0.0", server_port=7860)demo.py+2-5