Request Example

  • The size of an inference image cannot exceed 30 MB.
  • The number of images for a single inference cannot exceed 10.
  • Request parameters must be set in strict accordance with the description. Otherwise, a parameter verification error will be returned.

Component Error/Missing/Reverse Detection

  • WithoutReg mode:
    Parameter description:
    • ExtraParams, ProductSN, and ProductCode are optional. Other parameters are mandatory and cannot be left empty.
    {
        "ProjectName": "project_ssd_resnet",
        "TaskName": "assm1-2",
        "ProductCode": "123",
        "ProductSN": "121",
        "TaskType": "WithoutReg",
        "CodeType": "JPG",
       "Files": [ {"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data "}]
    }
  • WithReg mode:
    Parameter description:
    • ROIs: Optional and can be null.
    • ExtraParams: Optional and can be null.
    • ProductSN: Optional and can be null.
    • ROIs: Optional and must be the list type.
    • ExtraParams: Optional and must be the dict type.
    • Patterns: (Mandatory) Registration template. If the value is an empty list, the foreign object detection mode is used.
    • RegisterMatrix: (Optional) It is a rotation offset matrix and its size must be 3 x 3. If this parameter is null or not passed, the registration function of the system is used (the number of bounding boxes and template boxes must be two or more). If this parameter is not null, the rotation offset matrix calculated by vision software or other tools is used.
    • MatchParams: Mandatory. The reg_params, global_thresh, and label_spec_thresh fields in MatchParams are optional.
    {
        "ProjectName": "project_ssd_resnet",
        "TaskName": "assm1-2",
        "TaskType": "WithReg",
        "MachineId": "123",    
        "ProductCode": "123",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "123",
        "ROIs": [{"X": 100, "Y": 100, "Width": 4000, "Height": 3000, "Type": "include/exclude"}],
        "CodeType": "jpg",
        "Patterns": [{"Height": 150, "Label": "Screw", "Width": 139, "X": 967, "Y": 2341, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3,"conf_thresh": 0.5},
                     {"Height": 156, "Label": "Screw", "Width": 144, "X": 1004, "Y": 814, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3, "conf_thresh": 0.5},
                     {"Height": 155, "Label": "Screw", "Width": 150, "X": 3578, "Y": 869, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3, "conf_thresh": 0.5},
                     {"Height": 148, "Label": "Screw", "Width": 135, "X": 3463, "Y": 2402, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3},
                     {"Height": 164, "Label": "Screw", "Width": 160, "X": 1978, "Y": 2107, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3},
                     {"Height": 147, "Label": "Screw", "Width": 144, "X": 1138, "Y": 1104, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3}
    ,                 {"Height": 85, "Label": "Screw", "Width": 83, "X": 1766, "Y": 1510, "detail_label": "", "num_match": 1, "overlap_metric": "IOU", "overlap_thresh": 0.3}],
        "Files": [ {"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data"}],
        "MatchParams": {"reg_params": {"iou_thre": 0.5,"transform_guess": [[0.6, -0.05, 103], [0.5, 0.3, 220], [0, 1, 1]],"search_angle_range": [0, 45, -45, 180, 90, -90, 135, -135],"transform_type": "rigid","extension_ratio": 1},
    "global_thresh": {"conf_thresh": 0.5, "overlap_thresh": 0.3, "overlap_metric": "IOU"},
                       "label_spec_thresh": [{"label": "Screw", "conf_thresh": 0.5, "overlap_thresh": 0.3, "overlap_metric": "IOU"}]},
        "RegisterMatrix": [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
    }

    The RegisterMatrix field is used to calculate the rotation offset matrix.

    • If the RegisterMatrix is passed, it must be a 3 x 3 digital matrix. This rotation offset matrix is used for registration.
    • If the RegisterMatrix is not passed, the system calculates an optimal rotation-translation matrix for registration based on the passed patterns and bounding boxes. Note that the number of detection objects must be greater than or equal to 2. If the RegisterMatrix parameter is not passed (the RegisterMatrix field does not exist, or RegisterMatrix is set to []), you need to adjust the parameters related to the registration algorithm provided by the system. For details about how to set the reg_params fields in the MatchParams, see Table 12.
  • det_det mode:
    Parameter description:
    • ExtraParams and ProductSN are optional. Other parameters are mandatory and cannot be left empty.
     {
        "ProjectName": "project_ssd_ssd",
        "TaskName": "assm1-2",
        "MachineId": "123",
        "ProductCode": "123",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "11",
        "CodeType": "jpg",
        "Files": [{"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data"}],
        "ExtraParams": {}
    }
  • Foreign object detection mode:
    Parameter description:
    • The value of TaskType must be WithReg.
    • The value of Patterns must be an empty list and cannot be None.
    • The value of MatchParams can be empty.
    • ProductSN is optional. Requirements for other fields are the same in the WithReg mode.
     {
        "ProjectName": "project_ssd",
        "TaskName": "assm1-2",
        "TaskType": "WithReg",
        "MachineId": "123",
        "ProductCode": "123",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "11",
        "CodeType": "jpg",
        "Files": [{"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data"}],
        "ROIs":[],
        "Patterns":[],
        "MatchParams":  {"global_thresh": {"conf_thresh": 0.5, "overlap_thresh": 0.3, "overlap_metric": "IOU"},
                       "label_spec_thresh": [{"label": "Screw", "conf_thresh": 0.5, "overlap_thresh": 0.3, "overlap_metric": "IOU"}]},
        "RegisterMatrix": [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
     }

Industrial OCR

  • CRNN
    • Parameter description:
      • ExtraParams and ProductSN are optional. Other parameters are mandatory and cannot be empty.
    {
        "ProjectName": "project_crnn",
        "TaskName": "assm1-2",
        "TaskType": "WithReg",
        "MachineId": "123",    
        "ProductCode": "123",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "123",
        "Files": [ {"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data "}],
        "CodeType": "JPG",
        "ExtraParams":{}
    }
  • CTPN_CRNN
    Parameter description:
    • ExtraParams and ProductSN are optional. Other parameters are mandatory and cannot be empty.
    {
        "ProjectName": "project_ctpn_crnn",
        "TaskName": "assm1-2",
        "TaskType": "WithReg",
        "MachineId": "123",
        "ProductCode": "2323",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "23",
        "Files": [ {"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data "}],
        "CodeType": "JPG",
        "ExtraParams":{}
    }
  • det_ocr mode:
    Parameter description:
    • ExtraParams and ProductSN are optional. Other parameters are mandatory and cannot be empty.
    { 
        "ProjectName":"project_ssd_crnn", 
        "TaskName":"assm1-2", 
        "MachineId": "123",  
        "ProductCode": "123",  
        "ProductSN": "121",
        "TableName": "AI_Test", 
        "CameraID": "11" 
        "CodeType":"jpg", 
        "Files":[{ "FileName":"infer_test.jpg", "ImageData":"Base64 encoded image data"}],
        "ExtraParams":{}
    }

Glue Detection

  • WithoutReg mode:
    Parameter description:
    • ExtraParams and ProductSN are optional. Other parameters are mandatory and cannot be empty.
    {
        "ProjectName": "project_unet++",
        "TaskName": "assm1-2",
        "TaskType": "WithoutReg",
        "CodeType": "JPG",
        "Files": [ {"FileName": "infer_test.jpg", "ImageData": "Base64 code of the image data"}],
        "ExtraParams": {}
    }
  • SetTemplate mode:
    Parameter description:
    • ProductSN is optional. Other parameters are mandatory and cannot be empty.
    {
        "ProjectName": "project_unet",
        "TaskName": "assm1-2",
        "TaskType": "SetTemplate",
        "MachineId": "123",
        "ProductCode": "123",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "123",
        "CodeType": "JPG",
        "Template": {
                     "CodeType": "JPG",
                     "BlobMask": "Base64-encoded image data",
                     "Blobs": [{"Area": 1873, "ID": 1, "Label": "battery"}, {"Area": 71, "ID": 2, "Label": "fan"}],
                     "SelectBlobs": [1, 2]
                    }
    }
  • WithReg mode:
    Parameter description:
    • ProductSN is optional, and other parameters are mandatory.
    • RegisterMatrix is a 3 x 3 rotation offset matrix.
    {
        "ProjectName": "project_unet",
        "TaskName": "assm1-2",
        "TaskType": "WithReg",
        "MachineId": "123",
        "ProductCode": "123",
        "ProductSN": "121",
        "TableName": "AI_Test",
        "CameraID": "123",
        "CodeType": "JPG",
        "Files":  {"FileName": "infer_test.jpg", "ImageData": "Base64-encoded image data"}],
        "RegisterMatrix": [[1, 0, 0], [0, 1, 0], [0, 0, 1]],
        "MatchParams": {"overlap_thresh": 0.5, "overlap_metric": "IOU"}
    }
  • det_seg mode:
    Parameter description:
    • ExtraParams and ProductSN are optional, and other parameters are mandatory.
    {
        "ProjectName":"project_ssd_unet",
        "TaskName":"assm1-2",
        "MachineId":"None",
        "ProductCode":"None",
        "TableName":"AI_Test",
        "ProductSN": "121",
        "CameraID":"1",
        "CodeType":"JPEG",
        "Files":[
            {
                "FileName":"test.jpg",
                "ImageData":"Base64-encoded image data"
            }
        ],
        "ExtraParams":{
            "extra_name":"extra_value",
            "extra_name2":"extra_name2"
        }
    }
  • In SetTemplate mode, the combination of the MachineId, CameraID, and ProductCode fields is used as the key storage template.
  • In WithReg mode, the glue detection with image registration is performed by a corresponding template based on the combination of MachineId, CameraID, and ProductCode.

Therefore, if you need to set multiple templates, ensure that the combinations of the three fields are different.

Tag Appearance Defect Detection

Parameter description:

ExtraParams and ProductSN are optional. Other parameters are mandatory and cannot be empty.
{
    "ProjectName" : "tag_paste",
    "TaskName" : "tag_paste",
    "MachineId" : "123",
    "ProductCode" : "2323",
    "ProductSN": "121",
    "TableName" : "AI_Test",
    "CameraID" : "23",
	"Files" : [{"FileName" : "infer_test", "ImageData" : "Base64-encoded image data"}],
    "CodeType" : "JPG",
    "ExtraParams":{}
}

Semiconductor Quality Inspection

{
    "ProjectName" : "project_wafer",
    "TaskName" : "assm1-2",
    "Files" : [
                   {
                      "FileName" : "wafer.jpg",
                   "ImageData" : "Base64-encoded image data",
                      "Content": {
                                     "x_img": '11926.4563382787',
                                     "y_img": '981.054314524084',
                                     "setup_id": 'Layer3',
                                     "device": '00002',
                                     "deviceshort": "H01FOI00002A",
                                     "station_name": 'station'
                       }
                  }
           ]
}