2022-04-05 18:54:25 +08:00
|
|
|
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
|
|
|
|
"""
|
|
|
|
Perform test request
|
|
|
|
"""
|
|
|
|
|
2021-04-15 19:26:08 +08:00
|
|
|
import pprint
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
|
|
DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s"
|
2022-04-05 18:54:25 +08:00
|
|
|
IMAGE = "zidane.jpg"
|
2021-04-15 19:26:08 +08:00
|
|
|
|
2022-04-05 18:54:25 +08:00
|
|
|
# Read image
|
|
|
|
with open(IMAGE, "rb") as f:
|
|
|
|
image_data = f.read()
|
2021-04-15 19:26:08 +08:00
|
|
|
|
|
|
|
response = requests.post(DETECTION_URL, files={"image": image_data}).json()
|
|
|
|
|
|
|
|
pprint.pprint(response)
|