推理元数据架构Inference metadata schema

无论使用基于 HTTP 的协定还是基于 gRPC 的协定,每个推理对象都采用本主题中所述的对象模型。Each Inference object regardless of using HTTP based contract or gRPC based contract follows the object model described in this topic.

对象模型Object model

对象模型

类型定义Type Definition 说明Description
标记Tag 与结果相关的标记或标签。通过标记,你甚至可获取与标记相关的可信度值。Tag or label associated with the result.Alng with tagging, you even get the confidence value associated with the tag.
特性Attribute 与结果相关的其他属性。Additional attributes associated with the result. 可添加从推理引擎收到的新属性以及可信度值。You can add new attributes that you receive from the inferencing engine along with the confidence value.
特性列表Attribute List 可选属性列表。List of Optional attributes.
RectangleRectangle 相对于图像左上角的矩形区域。Rectangular region relative to the image top left corner. 所需的属性为“长度”、“宽度”、“高度”和“上边缘与原点的距离”。The required properties will be "length", "width", height" and "top edge distance from the origin".
分类Classification 通常适用于整个示例的分类器的标签。Label of classifier often applicable to the whole sample. 借助于“标记”,可对结果进行分类。With the help of "tag" you can classify the result.
实体Entity 在示例中检测或识别到的实体。Entity detected or identified on the sample. 当推理引擎检测到实体时,该实体会获得一个“标记”,将返回推断出的其他属性以及发现的实体周围的矩形框坐标。When an entity is detected by the inferencing engine, it gets a "tag", additional attributes that were inferred and the co-ordinates of a rectangular box around the found found entity is returned.
事件Event 在示例上检测到的事件。Event detected on the sample. 在示例中检测到事件时,将返回该事件的名称和该事件特定的属性。When an event is detected in the sample, the name of the event and the event specific properties are returned.
移动Motion 在示例上检测到的运动。Motion detected on the sample. 在示例中检测到运动时,将返回检测到运动所在的矩形边界框的坐标。When motion is detected in the sample, the co-ordinates of a rectangular bounding box where motion is detected, is returned.
文本Text 返回与示例相关的文本以及该文本的开始和结束时间戳。Text associated with the sample along with the start and end timestamp of the text is returned.
其他Other 返回其他通用有效负载信息。Returns other generic payload information.

下面的示例包含单个事件和一些受支持的推理类型:The example below contains a single event with some supported inference types:

[ 
  // Light Detection 
  { 
    "type": "classification", 
    "subtype": "lightDetection", 
    "classification": { 
      "tag": { "value": "daylight", "confidence": 0.86 }, 
      "attributes": [ 
          { "name": "isBlackAndWhite", "value": "false", "confidence": 0.71 } 
      ] 
    } 
  }, 
 
  // Motion Detection 
  { 
    "type": "motion", 
    "subtype": "motionDetection", 
    "motion": 
    { 
      "box": { "l": 0.0, "t": 0.0, "w": 0.0, "h": 0.0 } 
    } 
  }, 
 
  // Yolo V3 
  { 
    "type": "entity", 
    "subtype": "objectDetection",     
    "entity": 
    { 
      "tag": { "value": "dog", "confidence": 0.97 }, 
      "box": { "l": 0.0, "t": 0.0, "w": 0.0, "h": 0.0 } 
    } 
  }, 
 
  // Vehicle Identification 
  { 
    "type": "entity", 
    "subtype": "vehicleIdentification",     
    "entity": 
    { 
      "tag": { "value": "007-SPY", "confidence": 0.82 }, 
      "attributes":[   
        { "name": "color", "value": "black", "confidence": 0.90 }, 
        { "name": "body", "value": "coupe", "confidence": 0.87 }, 
        { "name": "make", "value": "Aston Martin", "confidence": 0.35 }, 
        { "name": "model", "value": "DBS V12", "confidence": 0.33 } 
      ], 
      "box": { "l": 0.0, "t": 0.0, "w": 0.0, "h": 0.0 } 
    } 
  }, 
 
  // People Identification 
  { 
    "type": "entity", 
    "subtype": "peopleIdentification",     
    "entity": 
    { 
      "tag": { "value":"Erwin Schrödinger", "confidence": 0.50 }, 
      "attributes":[   
        { "name": "age", "value": "73", "confidence": 0.87 }, 
        { "name": "glasses", "value": "yes", "confidence": 0.94 } 
      ], 
      "box": { "l": 0.0, "t": 0.0, "w": 0.0, "h": 0.0 } 
    }, 
 
    // Open type coming from the gRPC Map 
    "extensions":  
    { 
      "vector": "e1xkaXNwbGF5c3R5bGUgaVxoYmFyIHtcZnJhYyB7ZH17ZHR9fVx2ZXJ0IFxQc2kgKHQpXHJhbmdsZSA9e1xoYXQge0h9fVx2ZXJ0IFxQc2kgKHQpXHJhbmdsZSB9KQ==", 
      "skeleton": "p1,p2,p3,p4" 
    } 
  }, 
 
  // Captions 
  {     
    "type": "text", 
    "subtype": "speechToText",   
    "text": 
    { 
      "value": "Humor 75%. Confirmed. Self-destruct sequence in T minus 10… 9…", 
      "language": "en-US", 
      "startTimestamp": 12000, 
      "endTimestamp": 13000 
    } 
]

后续步骤Next steps