Segment Anything
In order to deploy the model you can use the identifier below:
- Segment Anything:
segment-anything
The Segment Anything Model (SAM) produces high quality object masks from input prompts such as points or boxes, and it can be used to generate masks for all objects in an image. It has been trained on a dataset of 11 million images and 1.1 billion masks, and has strong zero-shot performance on a variety of segmentation tasks.
You can follow this example of how to call the deployed endpoint:
Request Parameters
curl --location --request POST 'https://run.cerebrium.ai/segment-anything-webhook/predict' \
--header 'Authorization: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"image": <BASE_64_STRING>,
"file_url": "https://your-url.com",
"cursor": [400,300],
"webhook_endpoint": "https://your-url.com"
}'
This is the Cerebrium API key used to authenticate your request. You can get it from your Cerebrium dashboard.
A base64 encoded string of the image you would like to upscale.
A publicly accessible url of a image you would like to upscale
Two coordinates of the object on the image you would like to select
The url endpoint you would like us to send the image results to once it has finished generating
{
"run_id": "<UUID_STRING>",
"message": "Successfully generated image",
"result": [<BASE_64_STRING>]
}
Response Parameters
A unique identifier for the run that you can use to associate prompts with webhook endpoints.
Whether of not the response was successful
An array of base64 encoded strings of the image that you can convert into an image
curl --location --request POST 'https://run.cerebrium.ai/segment-anything-webhook/predict' \
--header 'Authorization: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"image": <BASE_64_STRING>,
"file_url": "https://your-url.com",
"cursor": [400,300],
"webhook_endpoint": "https://your-url.com"
}'
{
"run_id": "<UUID_STRING>",
"message": "Successfully generated image",
"result": [<BASE_64_STRING>]
}