diff --git a/docs/en/hub/inference-api.md b/docs/en/hub/inference-api.md index 0c79759b..b532e815 100644 --- a/docs/en/hub/inference-api.md +++ b/docs/en/hub/inference-api.md @@ -66,14 +66,14 @@ To access the [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API u ```python import requests -# API URL, use actual MODEL_ID -url = "https://api.ultralytics.com/v1/predict/MODEL_ID" +# API URL +url = "https://predict.ultralytics.com" # Headers, use actual API_KEY headers = {"x-api-key": "API_KEY"} -# Inference arguments (optional) -data = {"imgsz": 640, "conf": 0.25, "iou": 0.45} +# Inference arguments (use actual MODEL_ID) +data = {"model": "https://hub.ultralytics.com/models/MODEL_ID", "imgsz": 640, "conf": 0.25, "iou": 0.45} # Load image and send request with open("path/to/image.jpg", "rb") as image_file: @@ -94,8 +94,9 @@ print(response.json()) To access the [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API using cURL, use the following code: ```bash -curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \ - -H "x-api-key: API_KEY" \ +curl -X POST "https://predict.ultralytics.com" \ + -H "x-api-key: API_KEY" \ + -F "model=https://hub.ultralytics.com/models/MODEL_ID" \ -F "file=@/path/to/image.jpg" \ -F "imgsz=640" \ -F "conf=0.25" \ @@ -145,8 +146,9 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J === "cURL" ```bash - curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \ + curl -X POST "https://predict.ultralytics.com" \ -H "x-api-key: API_KEY" \ + -F "model=https://hub.ultralytics.com/models/MODEL_ID" \ -F "file=@/path/to/image.jpg" \ -F "imgsz=640" \ -F "conf=0.25" \ @@ -158,14 +160,14 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J ```python import requests - # API URL, use actual MODEL_ID - url = "https://api.ultralytics.com/v1/predict/MODEL_ID" + # API URL + url = "https://predict.ultralytics.com" # Headers, use actual API_KEY headers = {"x-api-key": "API_KEY"} - # Inference arguments (optional) - data = {"imgsz": 640, "conf": 0.25, "iou": 0.45} + # Inference arguments (use actual MODEL_ID) + data = {"model": "https://hub.ultralytics.com/models/MODEL_ID", "imgsz": 640, "conf": 0.25, "iou": 0.45} # Load image and send request with open("path/to/image.jpg", "rb") as image_file: @@ -225,8 +227,9 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J === "cURL" ```bash - curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \ + curl -X POST "https://predict.ultralytics.com" \ -H "x-api-key: API_KEY" \ + -F "model=https://hub.ultralytics.com/models/MODEL_ID" \ -F "file=@/path/to/image.jpg" \ -F "imgsz=640" \ -F "conf=0.25" \ @@ -238,14 +241,14 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J ```python import requests - # API URL, use actual MODEL_ID - url = "https://api.ultralytics.com/v1/predict/MODEL_ID" + # API URL + url = "https://predict.ultralytics.com" # Headers, use actual API_KEY headers = {"x-api-key": "API_KEY"} - # Inference arguments (optional) - data = {"imgsz": 640, "conf": 0.25, "iou": 0.45} + # Inference arguments (use actual MODEL_ID) + data = {"model": "https://hub.ultralytics.com/models/MODEL_ID", "imgsz": 640, "conf": 0.25, "iou": 0.45} # Load image and send request with open("path/to/image.jpg", "rb") as image_file: @@ -311,8 +314,9 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J === "cURL" ```bash - curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \ + curl -X POST "https://predict.ultralytics.com" \ -H "x-api-key: API_KEY" \ + -F "model=https://hub.ultralytics.com/models/MODEL_ID" \ -F "file=@/path/to/image.jpg" \ -F "imgsz=640" \ -F "conf=0.25" \ @@ -324,14 +328,14 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J ```python import requests - # API URL, use actual MODEL_ID - url = "https://api.ultralytics.com/v1/predict/MODEL_ID" + # API URL + url = "https://predict.ultralytics.com" # Headers, use actual API_KEY headers = {"x-api-key": "API_KEY"} - # Inference arguments (optional) - data = {"imgsz": 640, "conf": 0.25, "iou": 0.45} + # Inference arguments (use actual MODEL_ID) + data = {"model": "https://hub.ultralytics.com/models/MODEL_ID", "imgsz": 640, "conf": 0.25, "iou": 0.45} # Load image and send request with open("path/to/image.jpg", "rb") as image_file: @@ -401,8 +405,9 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J === "cURL" ```bash - curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \ + curl -X POST "https://predict.ultralytics.com" \ -H "x-api-key: API_KEY" \ + -F "model=https://hub.ultralytics.com/models/MODEL_ID" \ -F "file=@/path/to/image.jpg" \ -F "imgsz=640" \ -F "conf=0.25" \ @@ -414,14 +419,14 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J ```python import requests - # API URL, use actual MODEL_ID - url = "https://api.ultralytics.com/v1/predict/MODEL_ID" + # API URL + url = "https://predict.ultralytics.com" # Headers, use actual API_KEY headers = {"x-api-key": "API_KEY"} - # Inference arguments (optional) - data = {"imgsz": 640, "conf": 0.25, "iou": 0.45} + # Inference arguments (use actual MODEL_ID) + data = {"model": "https://hub.ultralytics.com/models/MODEL_ID", "imgsz": 640, "conf": 0.25, "iou": 0.45} # Load image and send request with open("path/to/image.jpg", "rb") as image_file: @@ -501,8 +506,9 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J === "cURL" ```bash - curl -X POST "https://api.ultralytics.com/v1/predict/MODEL_ID" \ + curl -X POST "https://predict.ultralytics.com" \ -H "x-api-key: API_KEY" \ + -F "model=https://hub.ultralytics.com/models/MODEL_ID" \ -F "file=@/path/to/image.jpg" \ -F "imgsz=640" \ -F "conf=0.25" \ @@ -514,14 +520,14 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J ```python import requests - # API URL, use actual MODEL_ID - url = "https://api.ultralytics.com/v1/predict/MODEL_ID" + # API URL + url = "https://predict.ultralytics.com" # Headers, use actual API_KEY headers = {"x-api-key": "API_KEY"} - # Inference arguments (optional) - data = {"imgsz": 640, "conf": 0.25, "iou": 0.45} + # Inference arguments (use actual MODEL_ID) + data = {"model": "https://hub.ultralytics.com/models/MODEL_ID", "imgsz": 640, "conf": 0.25, "iou": 0.45} # Load image and send request with open("path/to/image.jpg", "rb") as image_file: diff --git a/docs/mkdocs_github_authors.yaml b/docs/mkdocs_github_authors.yaml index 31526516..e76e6a2e 100644 --- a/docs/mkdocs_github_authors.yaml +++ b/docs/mkdocs_github_authors.yaml @@ -133,6 +133,9 @@ sometimesocrazy@gmail.com: stormsson@users.noreply.github.com: avatar: https://avatars.githubusercontent.com/u/1133032?v=4 username: stormsson +waxmann.sergiu@me.com: + avatar: https://avatars.githubusercontent.com/u/47978446?v=4 + username: sergiuwaxmann web@ultralytics.com: avatar: https://avatars.githubusercontent.com/u/135830346?v=4 username: UltralyticsAssistant