theFisher86 commited on
Commit
39efdd8
1 Parent(s): 26d2e03

Update app.py

Browse files

add some interface stuff

Files changed (1) hide show
  1. app.py +29 -2
app.py CHANGED
@@ -1,7 +1,34 @@
1
  import gradio as gr
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import requests
3
 
4
+
5
+
6
+ url = "https://api.prodia.com/v1/faceswap"
7
+
8
+ payload = {
9
+ "sourceUrl": "body.png",
10
+ "targetUrl": "face.png"
11
+ }
12
+ headers = {
13
+ "accept": "application/json",
14
+ "content-type": "application/json"
15
+ }
16
+
17
+ response = requests.post(url, json=payload, headers=headers)
18
+
19
+ print(response.text)
20
+
21
+
22
+ # Gradio Stuff
23
  def greet(name):
24
  return "Hello " + name + "!!"
25
 
26
+ gr.Interface(
27
+ predict,
28
+ inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
29
+ outputs=gr.outputs.Label(num_top_classes=2),
30
+ title="Hot Dog? Or Not?",
31
+ fileUploadBody=gr.inputs.Image(label="Upload Body Picture", type="filepath"),
32
+ fileUploadFace=gr.inputs.Image(label="Upload Face Picture", type="filepath"),
33
+ allow_flagging="manual"
34
+ ).launch()