Aidge Resource
Try for freeWorkplace
  • LATEST ADVANCEMENTS
    • Introducing Marco-MT: Bringing Translation to the Next Level with LLM
  • GETTING STARTED
    • Quick Start
    • Account and Authentication
    • Your First API Request
    • Test Your API Requests
    • Service Level Agreement
    • FAQ
  • API REFERENCE
    • E-commerce Information Translation
      • Marco Translator
        • Marco Translator API Reference
      • Image Translation
        • Image Translation Pro Version API Synchronous Interface
        • Image Translation Pro Version API Reference
        • Image Translation Pro Version Result API Call Description
        • Image Translation Standard Version API Reference
    • E-commerce Image Editing
      • Image Background Removal
        • Image Background Removal API Reference
      • Image Upscaling
        • Image Upscaling API Reference
      • Image Cropping
        • Image Cropping API Reference
      • Image Elements Removal
        • Image Elements Removal API Reference
      • Image Elements Detection
        • Image Elements Detection API Reference
    • E-commerce Virtual Model
      • Virtual Model Alternation
        • Virtual Model Alternation Submit API Reference
        • Virtual Model Alternation Result Query API Reference
      • Virtual TryOn
        • Virtual Try-on Submit API Reference
        • Virtual Try-On Query API Reference
        • General Model Library Reference
      • Hands&Feet Repair
        • Hands&Feet Repair Submit API Reference
        • Hands&Feet Repair Query API Reference
    • Editor Documentation
      • AI Model Editor
      • AI Image Editor
        • Image Workbench
        • Background Removal
        • Elements Removal
        • Image Translation
  • Check API Quota API Reference
Powered by GitBook
On this page
  • Request Parameter
  • Sample Request
  • Response Parameters
  • Sample Response
  • Errors

Was this helpful?

  1. API REFERENCE
  2. E-commerce Information Translation
  3. Image Translation

Image Translation Pro Version API Synchronous Interface

PreviousImage TranslationNextImage Translation Pro Version API Reference

Last updated 3 days ago

Was this helpful?

lation Pro Version API Synchronous Interface

GET/POST/ai/image/translation_mllm

Product description

The Image Translation Pro product is specifically designed for e-commerce images, integrating multimodal large model technology to achieve a more accurate understanding of images. It significantly improves translation quality and continues to expand and optimize multilingual translation capabilities.

Request Parameter

Parameter

Type

Required

Description

imageUrl

String

Yes

Image requirements:No more than 4000x4000 pixel. Size up to 10MB. Supporting png, jpeg, jpgm, bmp, webp.

sourceLanguage

String

Yes

Source language code. Supporting languages as the appendix shows.

Sample: en

targetLanguage

String

Yes

Target language code. Supporting languages as the appendix shows.

Sample: ko

includingProductArea

Boolean

No

Choose whether to translate the text within the main subject of images; this allows you to preserve and avoid translating embedded information such as product names.

As shown in the example image, the text in the red box represents the text on the main subject, while the text in the blue box represents text not on the main subject.

useImageEditor

Boolean

No

Whether it return layout information such as the position, font, and color of the text. This is used to obtain data for secondary editing when integrating with the image editor.

Sample: false

translatingBrandInTheProduct

Boolean

No

Choose whether to translate brand names on the image. This can help you preserve brand name information and prevent it from being translated.

Default:false(This means not translating the brand name.)

As shown in the example imageļ¼Œā€œę‡’č§’č½ā€refers to a brand name

Sample Request

  • For other programming languages, please refer to .

IopClient client = new IopClientImpl(url, appkey, appSecret);
        IopRequest request = new IopRequest();
        request.setApiName("/ai/image/translation_mllm");
// If you have not purchased a formal quota, please add a trial flag; otherwise, you will receive a NoResource error code.
// request.addHeaderParameter("x-iop-trial","true");
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("imageUrl", "https://img.alicdn.com/imgextra/i1/1955749012/O1CN016P3Jas2GRY7vaevsK_!!1955749012.jpg");
        jsonObject.put("sourceLanguage", "zh");
        jsonObject.put("targetLanguage", "en");
        jsonObject.put("translatingBrandInTheProduct", "false");
        jsonObject.put("useImageEditor", "false");
        request.addApiParameter("paramJson", jsonObject.toString());
        IopResponse response = client.execute(request);
        System.out.println(response.getBody());
        Thread.sleep(10);

Response Parameters

Parameter

Type

Description

resCode

Number

Response code;200 indicates a successful call. For other response codes,please refer to the error code information.

data

Object

Result data that generated.

data.imageUrl

String

The URL of the image generated after the image translation results.

data.imageEditorId

String

Parameter required for image editor ''Protocol Query ID'' (the ID must be provided when the request parameter useImageEditor is set to true)

requestId

String

Request ID: Used to uniquely identify a single request call.

success

Boolean

Whether successfulļ¼›true is successful,false is unsuccessful.

resMessage

String

Error message,e.g. "content has sensitive data, please try other input".

Sample Response

{
  "data": {
    "usage": 1,
    "result": {
      "data": {
        "message": [],
        "usageMap": "{\"usage\":1}",
        "structData": {
          "message": [
            {
              "edit_info": {
                "goodsRects": {
                  "top": 0,
                  "left": 0,
                  "width": 749,
                  "height": 872
                },
                "languages": [
                  "en"
                ],
                "resultImageIds": [
                  "34148e96-429f-11f0-8340-00163e1272a3"
                ],
                "textAreas": [
                  {
                    "horizontalLayout": "center",
                    "verticalLayout": "center",
                    "color": "#000000",
                    "texts": [
                      {
                        "valid": true,
                        "horizontalLayout": "center",
                        "verticalLayout": "center",
                        "color": "#070604",
                        "ovis_err_msg": "| ovis time: 1.481",
                        "imageRect": {
                          "top": 120,
                          "left": 33,
                          "width": 496,
                          "degree": 0,
                          "height": 82
                        },
                        "fontsize": 38,
                        "language": "en",
                        "value": "Hilton Hotel Soft Mattress",
                        "textRect": {
                          "top": 136,
                          "left": 44,
                          "width": 474,
                          "degree": 0,
                          "height": 50
                        },
                        "trans_model_name": "MarcoVL2-8B-PicTrans",
                        "lineCount": 1
                      }
                    ],
                    "fontsize": 50,
                    "content": "åøŒå°”é”æé…’åŗ—č½ÆåŗŠåž«",
                    "lineCount": 1
                  },
                  {
                    "horizontalLayout": "left",
                    "verticalLayout": "center",
                    "color": "#000000",
                    "texts": [
                      {
                        "valid": true,
                        "horizontalLayout": "center",
                        "verticalLayout": "center",
                        "color": "#504d48",
                        "ovis_err_msg": "| ovis time: 1.481",
                        "imageRect": {
                          "top": 205,
                          "left": 99,
                          "width": 331,
                          "degree": 0,
                          "height": 58
                        },
                        "fontsize": 28,
                        "language": "en",
                        "value": "Scientifically Blended Cotton Fabric",
                        "textRect": {
                          "top": 217,
                          "left": 23,
                          "width": 484,
                          "degree": 0,
                          "height": 34
                        },
                        "trans_model_name": "MarcoVL2-8B-PicTrans",
                        "lineCount": 1
                      }
                    ],
                    "fontsize": 35,
                    "content": "å…Øę£‰é¢ę–™ē§‘å­¦é…ęÆ”",
                    "lineCount": 1
                  }
                ],
                "repairedUrl": "https://aib-image.oss-ap-southeast-1.aliyuncs.com/tufan%2F333084ee-429f-11f0-b032-00163e1272a3.png?OSSAccessKeyId=LTAI5tSEGjGp5wixZgHLc3bV&Expires=4965863197&Signature=KWiuBsDlV89BgCPschjiKuZkEKY%3D",
                "font": [
                  "AlibabaSans-Regular"
                ]
              },
              "src_image": "https://img.alicdn.com/imgextra/i1/1955749012/O1CN016P3Jas2GRY7vaevsK_!!1955749012.jpg",
              "result_list": [
                {
                  "fileUrl": "https://aib-image.oss-ap-southeast-1.aliyuncs.com/tufan%2F342bd452-429f-11f0-8340-00163e1272a3.jpg?OSSAccessKeyId=LTAI5tSEGjGp5wixZgHLc3bV&Expires=4965863199&Signature=xVFKFzxbdNdOW1d9IaZziqpukGA%3D",
                  "language": "en"
                }
              ]
            }
          ],
          "usageMap": "{\"usage\": 1}"
        }
      },
      "success": true,
      "requestId": "2166434317491911949008870e0da8"
    }
  },
  "resCode": 200,
  "resMessage": "success",
  "code": "0",
  "request_id": "2151fa1917491911951054017",
  "_trace_id_": "2166434317491911949008870e0da8"
}

Errors

Error

Code

Error Message

Description

501

rate limit exceed

700

invalid input

The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements.

703

image size exceeds the limit

The image size in the request parameters exceeds the limit; the dimensions of the image must not exceed 4000x4000 pixels.

704

invalid image form

The image format in the request parameters is invalid.

705

image file size exceeds the

The image size in the request parameters exceeds the limit; the image size must not exceed 10MB.

801

model failed

900

tpp url error

1000

content has sensitive data, please try other input

Content has sensitive data, please try other input.

1001

content control failed, please retry

1002

content risk filter failed, please contact us

Sample:

Sample: false

Sample:"false"

The current interface has reached the current limit. Please contact us via or email us (aidgesales@alibaba-inc.com) to increase the current limit value.

Internal call exception,please contact us via or email us (aidgesales@alibaba-inc.com) for troubleshooting.

Internal call exception,please contact us via or email us (aidgesales@alibaba-inc.com) for troubleshooting.

Content control failed, please retry. If the error persists,please contact us via or email us (aidgesales@alibaba-inc.com).

Content risk filter failed. Please contact us via or email us (aidgesales@alibaba-inc.com).

Quick Start
http://example.jpg/
Discord
Discord
Discord
Discord
Discord