-
Setup product catalog: https://docs.neurolabs.ai/docs/configuration/product-catalog
-
Configure the Detection Job: https://docs.neurolabs.ai/docs/configuration/detection-jobs
-
Obtain an API KEY: https://docs.neurolabs.ai/docs/apis/generate_api_key
- Post a list of urls of images, that needs to be processed to the
/v1/detection-jobs/{detection_job_uuid}/urls
endpoint:
bash example:
curl -X 'POST' \
"$BASE_API_URL/v1/detection-jobs/$DETECTION_JOB_UUID/urls" \
-H 'accept: application/json' \
-H "X-API-Key: $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg",
]
}'
python example:
import httpx
BASE_API_URL = ...
DETECTION_JOB_UUID = ...
API_KEY = ...
response = httpx.post(
f"{BASE_API_URL}/v1/detection-jobs/{DETECTION_JOB_UUID}/urls",
headers={"X-API-KEY": API_KEY},
json={"urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg",
]}
)
detection_job_prediction_uuid = response.json()["uuid"]
-
The response will contain
uuid
field. This is uuid of new detection job prediction -
Access the results of the processing via
/v1/detection-jobs/{detection_job_uuid}/predictions/{detection_job_prediction_uuid}
endpoint.
bash example:
curl "$BASE_API_URL/v1/detection-jobs/$DETECTION_JOB_UUID/predictions/$DETECTION_JOB_PREDICTION_UUID" \
-H 'accept: application/json' \
-H "X-API-Key: $API_KEY"
python example:
response = httpx.get(
f"{BASE_API_URL}/v1/detection-jobs/{DETECTION_JOB_UUID}/predictions/{detection_job_prediction_uuid}",
headers={"X-API-KEY": API_KEY},
)
results = response.json()["prediction"]
- You can specify callback url at
/v1/detection-jobs/{detection_job_uuid}/urls
endpoint:
bash example:
curl -X 'POST' \
"$BASE_API_URL/v1/detection-jobs/$DETECTION_JOB_UUID/urls" \
-H 'accept: application/json' \
-H "X-API-Key: $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg",
],
"callback": "http://example.com/my-callback-endpoint"
}'
python example:
import httpx
BASE_API_URL = ...
DETECTION_JOB_UUID = ...
API_KEY = ...
response = httpx.post(
f"{BASE_API_URL}/v1/detection-jobs/{DETECTION_JOB_UUID}/urls",
headers={"X-API-KEY": API_KEY},
json={
"urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg",
],
"callback": "http://example.com/my-callback-endpoint",
}
)
-
The response will be the same, you still can track the progress via
/v1/detection-jobs/{detection_job_uuid}/predictions/{detection_job_prediction_uuid}
endpoint. -
But additionally, after the image processing will be finished, HTTP POST will be executed to the specified callback with a detection job prediction as a payload.