Spaces:
Sleeping
Sleeping
Commit
·
23921e7
1
Parent(s):
f72585e
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,12 @@ import requests
|
|
7 |
|
8 |
def classify_image(filepath) -> Dict[str, float]:
|
9 |
|
|
|
10 |
with open(filepath,'rb') as f:
|
11 |
# Make the API request
|
12 |
response = requests.post(
|
13 |
-
|
14 |
-
|
15 |
predictions = response.json()["predictions"]
|
16 |
print(predictions)
|
17 |
print(list(predictions.keys())[0])
|
|
|
7 |
|
8 |
def classify_image(filepath) -> Dict[str, float]:
|
9 |
|
10 |
+
url = 'http://18.220.109.92/predict'
|
11 |
with open(filepath,'rb') as f:
|
12 |
# Make the API request
|
13 |
response = requests.post(
|
14 |
+
url,
|
15 |
+
files={"file": f})
|
16 |
predictions = response.json()["predictions"]
|
17 |
print(predictions)
|
18 |
print(list(predictions.keys())[0])
|