Request
- URL:
https://www.ailabapi.com/api/cutout/general/apparel-background-removal - Method:
POST - Content-Type:
multipart/form-data
Image requirements
- Image format:
JPEGJPGBMPPNG - Image size: No more than 5 MB.
- Image resolution: Larger than 50x50px, smaller than 3000x3000px.
Headers
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
Body
| Field | Required | Type | Scope | Example | Default | Description |
|---|---|---|---|---|---|---|
image | YES | file | ||||
out_mode | NO | integer | 0, 1 | 0 | 0 | 0`: Default segmentation result of the main clothing.`, 1: Combined segmentation result based on the category specified by cloth_class. |
cloth_class | NO | string | tops, coat, skirt, pants, bag, shoes, hat | tops,coat | tops`: Tops.`, coat: Coat., skirt`: Skirt.`, pants: Pants., bag`: Bag.`, shoes: Shoes., “hat: Hat. | |
return_form | NO | string | mask, whiteBK | whiteBK`: Returns an image with a white background.`, mask: Returns a single-channel mask., If not specified, a four-channel PNG image will be returned. |
Response
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Description |
|---|---|---|
data | object | The content of the result data returned. |
+elements | array | Returns an array of elements. |
++0 | object | |
+++image_url | string | Returns the keying result image URL address. |
++1 | object | |
+++class_url | object | Return the URL corresponding to the clothing category based on the input cloth_class. |
++++tops | string | Tops URL. |
++++coat | string | Coat URL. |
++++skirt | string | Skirt URL. |
++++pants | string | Pants URL. |
++++bag | string | Bag URL. |
++++shoes | string | Shoes URL. |
++++hat | string | Hat URL. |
Response Example
Sample Code
Authorizations
API Key for authentication
Body
Specifies the type of segmentation result to return, which affects the content of the image_url field. <li>0: Default segmentation result of the main clothing.</li> <li>1: Combined segmentation result based on the category specified by cloth_class.</li>
Clothing categories. Multiple values can be submitted at once, separated by commas (,). <li>tops: Tops.</li> <li>coat: Coat.</li> <li>skirt: Skirt.</li> <li>pants: Pants.</li> <li>bag: Bag.</li> <li>shoes: Shoes.</li> <li>hat: Hat.</li>
Specify the desired image format for the output. <li>whiteBK: Returns an image with a white background.</li> <li>mask: Returns a single-channel mask.</li> <li>If not specified, a four-channel PNG image will be returned.</li>
Response
Success
The response is of type object.

