lampongyuen commited on
Commit
9a23331
·
1 Parent(s): 937b95c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -17
app.py CHANGED
@@ -1,22 +1,36 @@
1
  import gradio
2
  import cv2
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- def inference(img, in_bright):
6
- new_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
7
- in_bright=1
8
- return new_img
9
-
10
- # For information on Interfaces, head to https://gradio.app/docs/
11
- # For user guides, head to https://gradio.app/guides/
12
- # For Spaces usage, head to https://huggingface.co/docs/hub/spaces
13
- iface = gradio.Interface(
14
- fn=inference,
15
- inputs=['image',gradio.Slider(0,100)],
16
- outputs='image',
17
- title='Change Image',
18
- description='Interface!',
19
- examples=["llama.jpg"])
20
-
21
- iface.launch()
22
 
 
1
  import gradio
2
  import cv2
3
 
4
+ #def inference(img, in_bright):
5
+ # new_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
6
+ # in_bright=1
7
+ # return new_img
8
+
9
+ #iface = gradio.Interface(
10
+ # fn=inference,
11
+ # inputs=['image',gradio.Slider(0,100)],
12
+ # outputs='image',
13
+ # title='Change Image',
14
+ # description='Interface!',
15
+ # examples=["llama.jpg"])
16
+
17
+ #iface.launch()
18
+
19
+ import gradio as gr
20
+
21
+ def greet(image, name, is_morning, temperature):
22
+ salutation = "Good morning" if is_morning else "Good evening"
23
+ greeting = f"{salutation} {name}. It is {temperature} degrees today"
24
+ celsius = (temperature - 32) * 5 / 9
25
+ return greeting, round(celsius, 2)
26
+
27
+ demo = gr.Interface(
28
+ fn=greet,
29
+ inputs=['image',"text", "checkbox", gr.Slider(0, 100)],
30
+ outputs=['image',"text", "number"],
31
+ )
32
+ demo.launch()
33
+
34
+
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36