API Reference
Zero-shot image classification
POST
/
v1
/
classifications
/
zero-shot
/
image
Zero-shot image classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/zero-shot/image \
--header 'Content-Type: application/json' \
--data '
{
"image": "<string>",
"candidate_labels": [
"<string>"
],
"hypothesis_template": "This is a photo of {}",
"timeout": 123
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/zero-shot/image"
payload = {
"image": "<string>",
"candidate_labels": ["<string>"],
"hypothesis_template": "This is a photo of {}",
"timeout": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"label": "<string>",
"score": 123
}
]Body
application/json
Zero-shot classification for images using a set of candidate labels.
Image or list of images to classify (base64, URL or binary). Required.
Candidate label list to evaluate for each image. Required.
Template used to form hypotheses using the candidate labels for scoring.
Timeout for fetching remote images in seconds; null means no timeout.
⌘I
Zero-shot image classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/zero-shot/image \
--header 'Content-Type: application/json' \
--data '
{
"image": "<string>",
"candidate_labels": [
"<string>"
],
"hypothesis_template": "This is a photo of {}",
"timeout": 123
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/zero-shot/image"
payload = {
"image": "<string>",
"candidate_labels": ["<string>"],
"hypothesis_template": "This is a photo of {}",
"timeout": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"label": "<string>",
"score": 123
}
]