2023-02-11 15:20:10 +04:00
|
|
|
# YOLOv3 🚀 by Ultralytics, GPL-3.0 license
|
|
|
|
|
"""
|
|
|
|
|
Perform test request
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import pprint
|
|
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
2023-02-17 21:52:12 +01:00
|
|
|
DETECTION_URL = 'http://localhost:5000/v1/object-detection/yolov5s'
|
|
|
|
|
IMAGE = 'zidane.jpg'
|
2023-02-11 15:20:10 +04:00
|
|
|
|
|
|
|
|
# Read image
|
2023-02-17 21:52:12 +01:00
|
|
|
with open(IMAGE, 'rb') as f:
|
2023-02-11 15:20:10 +04:00
|
|
|
image_data = f.read()
|
|
|
|
|
|
2023-02-17 21:52:12 +01:00
|
|
|
response = requests.post(DETECTION_URL, files={'image': image_data}).json()
|
2023-02-11 15:20:10 +04:00
|
|
|
|
|
|
|
|
pprint.pprint(response)
|