/
githubmirror
/
yolov5
Обзор
Документация
Войти
/
githubmirror
/
yolov5
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
utils/flask_rest_api/example_request.py
18 строк
539 B
Glenn Jocher
Refresh docs and code fixes (#13785)
09 июн 2026, 18:51
Не верифицирован
09 июн 2026, 18:51
65a4947
Код
Авторство
О чём код?
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Perform test request.""" import pprint import requests DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s" IMAGE = "../../data/images/zidane.jpg" # Read image with open(IMAGE, "rb") as f: image_data = f.read() # Send the filename so the server can validate the extension (restapi.py checks ALLOWED_EXTENSIONS) response = requests.post(DETECTION_URL, files={"image": ("zidane.jpg", image_data, "image/jpeg")}).json() pprint.pprint(response)