File size: 806 Bytes
5e1b42b
 
 
9946ff0
5e1b42b
 
 
 
28bce37
5e1b42b
 
 
 
12a1043
 
 
 
 
5e1b42b
 
 
 
e2f2387
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os,json,sys
import gradio as gr
sys.path.insert(0,os.path.abspath(os.path.join(os.path.dirname(__file__),'..')))
from utils.basic_functions import get_image,gemini_identify_id,request_manager

def main():

    demo = gr.Interface(
        fn=request_manager,
        inputs=[
            gr.Textbox(label='Huggingface Model Name',placeholder='llava-hf/llava-1.5-7b-hf'),
            gr.Textbox(label="Image URL",placeholder="https://cumberland.isis.vanderbilt.edu/stefan/rvlcdip/test_advertisement_127238fe-8352-49ed-8c5f-11488a154dd2.jpg")
        ],
        outputs=[
            gr.Image(label="Image with ID bounding box"),
            gr.Textbox(label="Text Response")
        ],
        title="Huggingface LLM for ID Number Detection")

    demo.launch()

if __name__ == "__main__":
    main()