supermachine--tomato-passio.../20240627test4/utils/flask_rest_api/example_request.py
TG 242bb9a71b feat:新增20240627test4为现场部署版本的测试版(包含传统方法、实例分割、目标检测、图像分类多个模型)
fix:修复在20240627test4中的classifier.py的analyze_tomato函数中white_defect的函数忘记传递两个阈值量的错误;修复analyze_tomato函数中的叶片实例分割存在的问题,解决由于变量污染引起的分割错误;
2024-07-21 22:17:46 +08:00

18 lines
365 B
Python

# Ultralytics YOLOv5 🚀, AGPL-3.0 license
"""Perform test request."""
import pprint
import requests
DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s"
IMAGE = "zidane.jpg"
# Read image
with open(IMAGE, "rb") as f:
image_data = f.read()
response = requests.post(DETECTION_URL, files={"image": image_data}).json()
pprint.pprint(response)