Outfit Captioning

Generate captions for outfits in plain text or JSON format. This AI can identify details like color, pattern, style, material, sleeve style, hemline, waistline, and neckline.

Upload outfit image

POST https://prod.server.tryonlabs.ai/api/v1/experiment_image/

Upload the outfit image before you create an experiment.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

image

binary(file)

outfit image

type

string

specify 'garment'

gender

string

specify gender e.g. male or female

preprocess

string

specify 'false'

Response

{
    "id": "xxxxxxxxxx",
    "image_url": "api/v1/ei/xxxxxxxxxx/d?token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
    "type": "garment",
    "gender": "female",
    "model_type": null,
    "garment_type": null,
    "garment_brand": "Unknown",
    "access": "private",
    "shopify_product_id": null,
    "shopify_product_handle": null,
    "preprocessing": "completed",
    "user": "xxxxxxxxxx"
}

Create an experiment

POST https://prod.server.tryonlabs.ai/api/v1/experiment/

Create an experiment to trigger the caption generation.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

action

caption_outfit

Please provide the experiment action. e.g. generate_outfit, virtual_try_on, etc.

params

{"output_format": "json"}

Pass the parameters to use for generation.

garment_id

xxxxxxxxxx

Provide the id of the garment uploaded in the last step

Response

{
    "status": "success",
    "experiment": {
        "id": "xxxxxxxxxx",
        "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
        "output": null,
        "params": "{\"output_format\": \"json\"}",
        "aimodel": "outfit_ai",
        "action": "caption_outfit",
        "status": "pending",
        "store": null,
        "access": "private",
        "user_feedback": null,
        "redirect_count": 0,
        "model": null,
        "garment": {
            "id": "xxxxxxxxxx",
            "image_url": "api/v1/ei/xxxxxxxxxx/d?token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
            "type": "garment",
            "gender": "female",
            "model_type": null,
            "garment_type": null,
            "garment_brand": "Unknown",
            "access": "private",
            "shopify_product_id": null,
            "shopify_product_handle": null,
            "preprocessing": "completed",
            "user": "xxxxxxxxxx"
        },
        "result": null,
        "user": "xxxxxxxxxx",
        "results": []
    }
}

Check experiment status

GET https://prod.server.tryonlabs.ai/api/v1/experiment/{id}/

Call this endpoint to fetch an experiment containing the status and other details.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
    "status": "success",
    "experiment": {
        "id": "xxxxxxxxxx",
        "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
        "output": null,
        "params": "{\"output_format\": \"json\"}",
        "aimodel": "outfit_ai",
        "action": "caption_outfit",
        "status": "completed",
        "store": null,
        "access": "private",
        "user_feedback": null,
        "redirect_count": 0,
        "model": null,
        "garment": {
            "id": "xxxxxxxxxx",
            "image_url": "api/v1/ei/xxxxxxxxxx/d?token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
            "type": "garment",
            "gender": "female",
            "model_type": null,
            "garment_type": null,
            "garment_brand": "Unknown",
            "access": "private",
            "shopify_product_id": null,
            "shopify_product_handle": null,
            "preprocessing": "completed",
            "user": "xxxxxxxxxx"
        },
        "result": null,
        "user": "xxxxxxxxxx",
        "results": []
    }
}

Fetch experiment to view the generated caption

GET https://prod.server.tryonlabs.ai/api/v1/experiment/{id}/

Call this endpoint to fetch an experiment containing the status and other details.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
    "status": "success",
    "experiment": {
        "id": "xxxxxxxxxx",
        "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
        "output": "{\"caption\": {\"color\": \"pink\", \"pattern\": \"solid\", \"style\": \"dress\", \"fit\": \"fitted\", \"type\": \"dress\", \"hemline\": \"A-line\", \"material\": \"cotton\", \"sleeve-length\": \"sleeveless\", \"fabric-elasticity\": \"stretchy\", \"neckline\": \"V-neck\", \"waistline\": \"fitted\"}}",
        "params": "{\"output_format\": \"json\"}",
        "aimodel": "outfit_ai",
        "action": "caption_outfit",
        "status": "completed",
        "store": null,
        "access": "private",
        "user_feedback": null,
        "redirect_count": 0,
        "model": null,
        "garment": {
            "id": "xxxxxxxxxx",
            "image_url": "api/v1/ei/xxxxxxxxxx/d?token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "created_on": "xxxx-xx-xxxxx:xx:xx.xxxxxxx",
            "type": "garment",
            "gender": "female",
            "model_type": null,
            "garment_type": null,
            "garment_brand": "Unknown",
            "access": "private",
            "shopify_product_id": null,
            "shopify_product_handle": null,
            "preprocessing": "completed",
            "user": "xxxxxxxxxx"
        },
        "result": null,
        "user": "xxxxxxxxxx",
        "results": []
    }
}

If the experiment status is 'completed', you'll see the caption output in JSON or text format. If the experiment fails, there won't be any output, and you might need to adjust some parameters to get the desired results.

Last updated