OLD | NEW |
(Empty) | |
| 1 syntax = "proto2"; |
| 2 |
| 3 option optimize_for = LITE_RUNTIME; |
| 4 |
| 5 package mri; |
| 6 |
| 7 // The output of the media analytics process. Implicitly tied to the |
| 8 // MediaPerception dictionary defined in Chromium source at |
| 9 // src/extensions/common/api/media_perception_private.idl for the |
| 10 // Chromium mediaPerceptionPrivate API. This .proto needs to be compatible |
| 11 // with the version used in the binary checked into the Chromebox For |
| 12 // Meetings private overlay. |
| 13 // |
| 14 // This message is packaged by the graph runner when a PerceptionSample |
| 15 // or array of PerceptionSamples comes out of the graph. |
| 16 message MediaPerception { |
| 17 // The timestamp attached when this data originated from the analysis process. |
| 18 optional uint64 timestamp = 1; // In milliseconds since Epoch. |
| 19 |
| 20 // A single FramePerception message or array of perceptions (if reporting the |
| 21 // results from multiple frames). |
| 22 repeated FramePerception frame_perception = 2; |
| 23 } |
| 24 |
| 25 // Used to transmit a history of image frames and their associated annotations. |
| 26 // This is accumulated over time by the graph runner. |
| 27 message Diagnostics { |
| 28 repeated PerceptionSample perception_sample = 1; |
| 29 } |
| 30 |
| 31 message State { |
| 32 enum Status { |
| 33 STATUS_UNSPECIFIED = 0; // Unused required default value for Proto enums. |
| 34 TIMEOUT = 1; // Unable to reach media analysis process. |
| 35 UNINITIALIZED = 2; // Media analytics working on loading configuration. |
| 36 STARTED = 3; // Analysis process running but not recieving frames. |
| 37 RUNNING = 4; // Analysis process running and injesting frames. |
| 38 SUSPENDED = 5; // Media analytics process waiting to be started. |
| 39 } |
| 40 |
| 41 // Note: RUNNING and SUSPENDED are the only two states which should be sent to |
| 42 // SetState. |
| 43 optional Status status = 1; |
| 44 |
| 45 // Device context so that the media analytics process can better select the |
| 46 // right video device to open. |
| 47 optional string device_context = 2; |
| 48 } |
| 49 |
| 50 // This is the output of the MediaPerceptionSinkCalculator. |
| 51 message PerceptionSample { |
| 52 optional FramePerception frame_perception = 1; |
| 53 // The image frame data associated with the frame perception. |
| 54 optional RawImageFrame raw_image_frame = 2; |
| 55 } |
| 56 |
| 57 // Note: this is a replica of image/content/flow/image/raw_image_data.proto |
| 58 // because this proto needs to be self-contained (to be checked in to Chromium |
| 59 // as well). |
| 60 message RawImageFrame { |
| 61 optional int32 width = 1; |
| 62 optional int32 height = 2; |
| 63 // colorspace is defined in the same way as SimpleImage::ColorSpace. |
| 64 optional int32 colorspace = 3; |
| 65 // By default, 1 channel means Grayscale, 2 channels meangs Grayscale + Alpha, |
| 66 // 3 channels means RGB, and 4 channels means RGBA. |
| 67 optional int32 channels = 4; |
| 68 // The raw pixel data as a string of uint8. |
| 69 // The size of pixel_data is height*width*channels. |
| 70 // Byte order is RGBARGBARGBA. |
| 71 // TODO(lasoren): Replace with compressed image format. |
| 72 optional bytes pixel_data = 5; |
| 73 } |
| 74 |
| 75 // The set of computer vision metadata for an image frame. |
| 76 message FramePerception { |
| 77 optional uint64 frame_id = 1; |
| 78 |
| 79 optional uint32 frame_width_in_px = 2; |
| 80 optional uint32 frame_height_in_px = 3; |
| 81 |
| 82 // The timestamp associated with the frame (when it enters the graph). |
| 83 optional uint64 timestamp = 4; |
| 84 |
| 85 // The list of entities detected for this frame. |
| 86 repeated Entity entity = 5; |
| 87 } |
| 88 |
| 89 message Entity { |
| 90 // A unique id associated with the detected entity, which can be used to track |
| 91 // the entity over time. |
| 92 optional uint32 id = 1; |
| 93 |
| 94 enum EntityType { |
| 95 UNSPECIFIED = 0; |
| 96 FACE = 1; |
| 97 PERSON = 2; |
| 98 } |
| 99 |
| 100 optional EntityType type = 2; |
| 101 |
| 102 // Minimum box, which captures entire detected entity. |
| 103 optional BoundingBox bounding_box = 3; |
| 104 |
| 105 // A value for the quality of this detection. |
| 106 optional float confidence = 4; |
| 107 } |
| 108 |
| 109 message BoundingBox { |
| 110 // The points that define the corners of a bounding box. |
| 111 optional Point top_left = 1; |
| 112 optional Point bottom_right = 2; |
| 113 // Indicates whether or not these coordinates are normalized to values between |
| 114 // 0 and 1. |
| 115 optional bool normalized = 3 [default = false]; |
| 116 } |
| 117 |
| 118 message Point { |
| 119 // x represents the horizontal distance from the top left corner of the image |
| 120 // to the point. |
| 121 optional float x = 1; |
| 122 // y represents the vertical distance from the top left corner of the image to |
| 123 // the point. |
| 124 optional float y = 2; |
| 125 } |
OLD | NEW |