File size: 742 Bytes
1a20606
 
2a33ace
1a20606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2a33ace
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio as gr
import requests
from AuthVerification import auth_verification

inputs = [gr.Image(type='pil', label='TAKE A PICTURE OF THE TRAY')]
outputs = [gr.Textbox(label='Comments')]

title = "Minimalistic Scanner, by Proppos"

def instant_predict(pil_image):
    """
    Request
    """
    print('Sending image to Proppos ...')
    return 'nice'
    
def display_outputs(input_image: gr.Image):
    try:
        instant_predict(input_image)
        return "Image correctly sent to scann with Proppos"
    except Exception as e:
        return f"Error:{e}"

demo_app = gr.Interface(
    fn=display_outputs,
    inputs=inputs,
    outputs=outputs,
    title=title,
    theme='huggingface'
)


demo_app.launch(auth=auth_verification)