CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hukaixuan19970627

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: hukaixuan19970627/yolov5_obb
Path: blob/master/utils/flask_rest_api/example_request.py
Views: 475
1
"""Perform test request"""
2
import pprint
3
4
import requests
5
6
DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s"
7
TEST_IMAGE = "zidane.jpg"
8
9
image_data = open(TEST_IMAGE, "rb").read()
10
11
response = requests.post(DETECTION_URL, files={"image": image_data}).json()
12
13
pprint.pprint(response)
14
15