Spaces:
Running
Running
Update demo.py
Browse files30 unmodified lines313233343536378 unmodified lines4647484950515253541 unmodified line56575859606130 unmodified linesprintedCopy = process_results.get("printedCopy")# Check for "Spoof" conditionif screenReply < screenReplyThreshold or portraitReplace < portraitReplaceThreshold or printedCopy < printedCopyThreshold:process_results["status"] = "Spoof"else:process_results["status"] = "Real"8 unmodified lineswith 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 linewith gr.Column():json_output = gr.JSON()process_button.click(process_image, inputs=[image_input, screenReplyThreshold, printedCopyThreshold, portraitReplaceThreshold], outputs=[json_output])demo.launch(server_name="0.0.0.0", server_port=7860)30 unmodified lines313233343536378 unmodified lines4647484950511 unmodified line53545556575830 unmodified linesprintedCopy = process_results.get("printedCopy")# Check for "Spoof" conditionif screenReply < 0.5 or portraitReplace < 0.5 or printedCopy < 0.5:process_results["status"] = "Spoof"else:process_results["status"] = "Real"8 unmodified lineswith gr.Row():with gr.Column():image_input = gr.Image(type='pil')gr.Examples(['examples/1.jpg', 'examples/2.jpg', 'examples/3.jpg'],inputs=image_input)1 unmodified linewith gr.Column():json_output = gr.JSON()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