Segment AI
Easily get masks and corresponding information with the mask.
POST /v2/generate
Parameters
Name
Type
Description
image
string
Optional
URL of the input image. Encode your image url if url have special characters.
prompt
string
Required for segmentprompt
Prompt for the segment operation.
processing_url
string
Optional
Get process results with same endpoint, alternative to /results
endpoint usage.
Curl Example for segment
curl -X POST https://api.luw.ai/v2/generate \
-H "Authorization: Bearer LUW_API_TOKEN" \
-d "model=segment" \
-d "image=https://example.com/room.jpg"
Curl Example for segmentprompt
curl -X POST https://api.luw.ai/v2/generate \
-H "Authorization: Bearer LUW_API_TOKEN" \
-d "model=segmentprompt" \
-d "prompt=walls" \
-d "image=https://example.com/room.jpg"
Response Example
{
"status": true,
"progress": {
"started_at": "2024-01-04T12:00:00Z",
"state": "processing",
"percent": 45
},
"processing": true,
"processing_url": "abc_123..."
}
✨ Get results using the /results
endpoint.
/results
endpoint.Alternative legacy method: Add &processing_url={url}
to your request.
Segment AIs response will be like this (right now we do not provide score for the segmentation, in the future we are planning to add this functionality):
{
"status": true,
"output": [
{ "label": "wall", "mask": "iVBORw0KGgoAAAANSUhEUg...", "score": null },
{ "label": "floor", "mask": "iVBORw0KGgoAAAANSUhEUg...", "score": null },
{ "label": "ceiling", "mask": "iVBORw0KGgoAAAANSUhEUg...", "score": null },
{ "label": "bed", "mask": "iVBORw0KGgoAAAANSUhEUg...", "score": null },
...
]
}
Last updated