Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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)