Commit
•
cb7cbf4
1
Parent(s):
1958857
Update app.py
Browse files
app.py
CHANGED
@@ -14,10 +14,14 @@ def query(filename):
|
|
14 |
response = requests.post(API_URL, headers=headers, data=data)
|
15 |
return response.json()
|
16 |
|
|
|
|
|
|
|
|
|
17 |
# train = os.listdir("./")
|
18 |
# print(train)
|
19 |
output = query("./09_truck.jpg")
|
20 |
|
21 |
-
|
22 |
-
demo = gr.Interface(fn=
|
23 |
demo.launch()
|
|
|
14 |
response = requests.post(API_URL, headers=headers, data=data)
|
15 |
return response.json()
|
16 |
|
17 |
+
def rb(data):
|
18 |
+
response = requests.post(API_URL, headers=headers, data=data.raw)
|
19 |
+
return response.json()
|
20 |
+
|
21 |
# train = os.listdir("./")
|
22 |
# print(train)
|
23 |
output = query("./09_truck.jpg")
|
24 |
|
25 |
+
inputs = gr.inputs.Image(type="pil", label="Upload an image", file_types = ['.png','.jpg','.jpeg'], live=True, file_count = "multiple")
|
26 |
+
demo = gr.Interface(fn=rb, inputs=inputs.raw, outputs="json")
|
27 |
demo.launch()
|