This topic describes the details of the product recognition model, including the model features, input format, output format, and test data.

  • Overview

    The product recognition model adopts the YoloV5 structure. This model can recognize products in images and return the categories and positions of the recognized products. For example, you can use this model to recognize the following products in images: tops, dresses, bottoms, suitcases and bags, shoes, accessories, snacks, cosmetics, bottled drinks, furniture, toys, underwear, and digital products.

  • Input format
    The input data must be in the JSON format. It contains the image field. The value of this field is the image content that is encoded in the Base64 format.
      "image": "Base64-encoded image content"
  • Output format
    The output data is in the JSON format. The following table describes the fields in the output data.
    Field Description Shape Type
    detection_boxes The bounding boxes that mark the recognized products. The coordinates of each bounding box [y1, x1, y2, x2] are specified in the [top, left, bottom, right] order. [num_detections, 4] FLOAT
    detection_scores The probabilities that the products are recognized. num_detections FLOAT
    detection_classes The IDs of the categories to which the recognized products belong. The IDs in the value are the serial numbers of the categories in the detection_class_names field. All categories are numbered from 0.

    For example, detection_classes=[0, 4, 4, 2] indicates that tops, shoes, shoes, and bottoms are recognized in the bounding boxes.

    num_detections INT
    detection_class_names The names of the categories to which the recognized products belong. The value is an array, which can contain the following elements: top, dress, bottom, bags, shoes, accessories, snacks, beauty, drink, furniture, toys, underwear, 3c, clothes, and others. num_detections STRING
    request_id The unique ID of the request. [] STRING
    success Indicates whether the request is successful. Valid values:
    • true: indicates that the request succeeded.
    • false: indicates that the request failed.
    [] BOOL
    error_code The error code that is returned if the request failed. [] INT
    error_msg The error message that is returned if the request failed. [] STRING
    The following code provides an example of the output data:
        "request_id": "701e10cc-8031-49d5-98e2-767fb91e****",
        "success": true,
        "detection_boxes": [[303.1582946777344, 116.68634033203125, 469.31536865234375, 323.48870849609375], [459.77313232421875, 687.7918701171875, 540.4406127929688, 798.2620239257812], [294.84521484375, 693.1432495117188, 389.1251220703125, 798.4052124023438], [304.1402893066406, 285.03729248046875, 487.53369140625, 434.85955810546875]],
        "detection_scores": [0.8764256834983826, 0.8597352504730225, 0.8521379232406616, 0.7506827712059021],
        "detection_classes": [0, 4, 4, 2],
        "detection_class_names": ["top", "shoes", "shoes", "bottom"]