Accepted Input Formats
Input formats accepted by a self-hosted Roboflow Inference server, and how to disable the less secure ones such as pickled numpy payloads and URL image fetching.
Why this matters
Deserialization of pickled numpy objects
import cv2
import pickle
import requests
image = cv2.imread("...")
img_str = pickle.dumps(image)
infer_payload = {
"model_id": "{project_id}/{model_version}",
"image": {
"type": "numpy",
"value": img_str,
},
"api_key": "YOUR_API_KEY",
}
res = requests.post(
"http://localhost:9001/infer/{task}",
json=infer_payload,
)Sending URLs to inference images
Last updated
Was this helpful?