You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
368B

  1. # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
  2. """
  3. Perform test request
  4. """
  5. import pprint
  6. import requests
  7. DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s"
  8. IMAGE = "zidane.jpg"
  9. # Read image
  10. with open(IMAGE, "rb") as f:
  11. image_data = f.read()
  12. response = requests.post(DETECTION_URL, files={"image": image_data}).json()
  13. pprint.pprint(response)