[ed159a]: / yolov5 / utils / flask_rest_api / example_request.py

Download this file

14 lines (8 with data), 299 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
"""Perform test request"""
import pprint
import requests
DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s"
TEST_IMAGE = "zidane.jpg"
image_data = open(TEST_IMAGE, "rb").read()
response = requests.post(DETECTION_URL, files={"image": image_data}).json()
pprint.pprint(response)