Spaces:
Running
Running
Clement Vachet
commited on
Commit
•
ae565a0
1
Parent(s):
ad1fd8c
Update API call
Browse files- inference_api.py +4 -2
inference_api.py
CHANGED
@@ -3,7 +3,7 @@ from PIL import Image
|
|
3 |
import matplotlib.pyplot as plt
|
4 |
|
5 |
# Parameters
|
6 |
-
Server_URL = "
|
7 |
Image_URL = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
8 |
|
9 |
# URL to client server (e.g. local server, docker container or AWS ECS)
|
@@ -12,7 +12,9 @@ client = Client(Server_URL)
|
|
12 |
# Call to API
|
13 |
result = client.predict(
|
14 |
image=handle_file(Image_URL),
|
15 |
-
|
|
|
|
|
16 |
)
|
17 |
|
18 |
# Result is an image.webp file
|
|
|
3 |
import matplotlib.pyplot as plt
|
4 |
|
5 |
# Parameters
|
6 |
+
Server_URL = "cvachet/object_detection_gradio"
|
7 |
Image_URL = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
8 |
|
9 |
# URL to client server (e.g. local server, docker container or AWS ECS)
|
|
|
12 |
# Call to API
|
13 |
result = client.predict(
|
14 |
image=handle_file(Image_URL),
|
15 |
+
model_id="hustvl/yolos-small",
|
16 |
+
threshold=0.9,
|
17 |
+
api_name="/detect"
|
18 |
)
|
19 |
|
20 |
# Result is an image.webp file
|