Jonas commited on
Commit
ad13c6f
1 Parent(s): ac5571e
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import predictLLaVa
3
+
4
+ image = gr.Image(sources=["upload", "webcam"], label="Image", type="pil")
5
+ inputText = gr.Textbox(lines=1, label="English Instruction:")
6
+ languageDropdown = gr.Dropdown(
7
+ choices=["en", "de", "fr", "es", "it", "nl", "ru"],
8
+ label="Output in:",
9
+ multiselect=False,
10
+ value="en"
11
+ )
12
+
13
+ gr.Interface(
14
+ fn=predictLLaVa.process_single_image,
15
+ inputs=[inputText, image, languageDropdown],
16
+ outputs=gr.Textbox(label="Generated Description"),
17
+ title="Fluffyvision",
18
+ description="Generate a text description of an image based on an instruction.",
19
+ allow_flagging="never"
20
+ ).launch(share=True, auth=predictLLaVa.check_auth, auth_message="Please enter your username and password.")