From 1b2142db8654dff32431d2fe3afce4eb9ccb9bc0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 11:01:44 -0700 Subject: [PATCH] feat!: field ObjectTrackingAnnotation.segment moved into oneof, added track_id (#704) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: field ObjectTrackingAnnotation.segment moved into oneof, added track_id PiperOrigin-RevId: 445061085 Source-Link: https://github.com/googleapis/googleapis/commit/0506e19aba65157d6e725c4f075e36bae2dba91f Source-Link: https://github.com/googleapis/googleapis-gen/commit/5796d5155df9a378c0fd8d97c06f7d7170765670 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTc5NmQ1MTU1ZGY5YTM3OGMwZmQ4ZDk3YzA2ZjdkNzE3MDc2NTY3MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1p2beta1/video_intelligence.proto | 19 +++- .../protos/protos.d.ts | 19 +++- .../protos/protos.js | 96 +++++++++++++++---- .../protos/protos.json | 20 +++- 4 files changed, 123 insertions(+), 31 deletions(-) diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto index 3b1d51cd775..c185c0aa99b 100644 --- a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto @@ -405,6 +405,22 @@ message ObjectTrackingFrame { // Annotations corresponding to one tracked object. message ObjectTrackingAnnotation { + // Different representation of tracking info in non-streaming batch + // and streaming modes. + oneof track_info { + // Non-streaming batch mode ONLY. + // Each object track corresponds to one video segment where it appears. + VideoSegment segment = 3; + + // Streaming mode ONLY. + // In streaming mode, we do not know the end time of a tracked object + // before it is completed. Hence, there is no VideoSegment info returned. + // Instead, we provide a unique identifiable integer track_id so that + // the customers can correlate the results of the ongoing + // ObjectTrackAnnotation of the same track_id over time. + int64 track_id = 5; + } + // Entity to specify the object category that this track is labeled as. Entity entity = 1; @@ -413,9 +429,6 @@ message ObjectTrackingAnnotation { // Information corresponding to all frames where this object track appears. repeated ObjectTrackingFrame frames = 2; - - // Each object track corresponds to one video segment where it appears. - VideoSegment segment = 3; } // Video annotation feature. diff --git a/packages/google-cloud-videointelligence/protos/protos.d.ts b/packages/google-cloud-videointelligence/protos/protos.d.ts index 0f6b328f84f..bca5c0f6b86 100644 --- a/packages/google-cloud-videointelligence/protos/protos.d.ts +++ b/packages/google-cloud-videointelligence/protos/protos.d.ts @@ -11428,6 +11428,12 @@ export namespace google { /** Properties of an ObjectTrackingAnnotation. */ interface IObjectTrackingAnnotation { + /** ObjectTrackingAnnotation segment */ + segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId */ + trackId?: (number|Long|string|null); + /** ObjectTrackingAnnotation entity */ entity?: (google.cloud.videointelligence.v1p2beta1.IEntity|null); @@ -11436,9 +11442,6 @@ export namespace google { /** ObjectTrackingAnnotation frames */ frames?: (google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame[]|null); - - /** ObjectTrackingAnnotation segment */ - segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); } /** Represents an ObjectTrackingAnnotation. */ @@ -11450,6 +11453,12 @@ export namespace google { */ constructor(properties?: google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation); + /** ObjectTrackingAnnotation segment. */ + public segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId. */ + public trackId?: (number|Long|string|null); + /** ObjectTrackingAnnotation entity. */ public entity?: (google.cloud.videointelligence.v1p2beta1.IEntity|null); @@ -11459,8 +11468,8 @@ export namespace google { /** ObjectTrackingAnnotation frames. */ public frames: google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame[]; - /** ObjectTrackingAnnotation segment. */ - public segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + /** ObjectTrackingAnnotation trackInfo. */ + public trackInfo?: ("segment"|"trackId"); /** * Creates a new ObjectTrackingAnnotation instance using the specified properties. diff --git a/packages/google-cloud-videointelligence/protos/protos.js b/packages/google-cloud-videointelligence/protos/protos.js index 847d9d1f9df..73e25fb3899 100644 --- a/packages/google-cloud-videointelligence/protos/protos.js +++ b/packages/google-cloud-videointelligence/protos/protos.js @@ -28822,10 +28822,11 @@ * Properties of an ObjectTrackingAnnotation. * @memberof google.cloud.videointelligence.v1p2beta1 * @interface IObjectTrackingAnnotation + * @property {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null} [segment] ObjectTrackingAnnotation segment + * @property {number|Long|null} [trackId] ObjectTrackingAnnotation trackId * @property {google.cloud.videointelligence.v1p2beta1.IEntity|null} [entity] ObjectTrackingAnnotation entity * @property {number|null} [confidence] ObjectTrackingAnnotation confidence * @property {Array.|null} [frames] ObjectTrackingAnnotation frames - * @property {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null} [segment] ObjectTrackingAnnotation segment */ /** @@ -28844,6 +28845,22 @@ this[keys[i]] = properties[keys[i]]; } + /** + * ObjectTrackingAnnotation segment. + * @member {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.segment = null; + + /** + * ObjectTrackingAnnotation trackId. + * @member {number|Long|null|undefined} trackId + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.trackId = null; + /** * ObjectTrackingAnnotation entity. * @member {google.cloud.videointelligence.v1p2beta1.IEntity|null|undefined} entity @@ -28868,13 +28885,19 @@ */ ObjectTrackingAnnotation.prototype.frames = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + /** - * ObjectTrackingAnnotation segment. - * @member {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null|undefined} segment + * ObjectTrackingAnnotation trackInfo. + * @member {"segment"|"trackId"|undefined} trackInfo * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation * @instance */ - ObjectTrackingAnnotation.prototype.segment = null; + Object.defineProperty(ObjectTrackingAnnotation.prototype, "trackInfo", { + get: $util.oneOfGetter($oneOfFields = ["segment", "trackId"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new ObjectTrackingAnnotation instance using the specified properties. @@ -28909,6 +28932,8 @@ $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.trackId); return writer; }; @@ -28943,6 +28968,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32()); + break; + case 5: + message.trackId = reader.int64(); + break; case 1: message.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.decode(reader, reader.uint32()); break; @@ -28954,9 +28985,6 @@ message.frames = []; message.frames.push($root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.decode(reader, reader.uint32())); break; - case 3: - message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -28992,6 +29020,22 @@ ObjectTrackingAnnotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.segment != null && message.hasOwnProperty("segment")) { + properties.trackInfo = 1; + { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + } + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (properties.trackInfo === 1) + return "trackInfo: multiple values"; + properties.trackInfo = 1; + if (!$util.isInteger(message.trackId) && !(message.trackId && $util.isInteger(message.trackId.low) && $util.isInteger(message.trackId.high))) + return "trackId: integer|Long expected"; + } if (message.entity != null && message.hasOwnProperty("entity")) { var error = $root.google.cloud.videointelligence.v1p2beta1.Entity.verify(message.entity); if (error) @@ -29009,11 +29053,6 @@ return "frames." + error; } } - if (message.segment != null && message.hasOwnProperty("segment")) { - var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.segment); - if (error) - return "segment." + error; - } return null; }; @@ -29029,6 +29068,20 @@ if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) return object; var message = new $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.segment); + } + if (object.trackId != null) + if ($util.Long) + (message.trackId = $util.Long.fromValue(object.trackId)).unsigned = false; + else if (typeof object.trackId === "string") + message.trackId = parseInt(object.trackId, 10); + else if (typeof object.trackId === "number") + message.trackId = object.trackId; + else if (typeof object.trackId === "object") + message.trackId = new $util.LongBits(object.trackId.low >>> 0, object.trackId.high >>> 0).toNumber(); if (object.entity != null) { if (typeof object.entity !== "object") throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.entity: object expected"); @@ -29046,11 +29099,6 @@ message.frames[i] = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.fromObject(object.frames[i]); } } - if (object.segment != null) { - if (typeof object.segment !== "object") - throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.segment: object expected"); - message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.segment); - } return message; }; @@ -29071,7 +29119,6 @@ object.frames = []; if (options.defaults) { object.entity = null; - object.segment = null; object.confidence = 0; } if (message.entity != null && message.hasOwnProperty("entity")) @@ -29081,10 +29128,21 @@ for (var j = 0; j < message.frames.length; ++j) object.frames[j] = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.toObject(message.frames[j], options); } - if (message.segment != null && message.hasOwnProperty("segment")) + if (message.segment != null && message.hasOwnProperty("segment")) { object.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.toObject(message.segment, options); + if (options.oneofs) + object.trackInfo = "segment"; + } if (message.confidence != null && message.hasOwnProperty("confidence")) object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (typeof message.trackId === "number") + object.trackId = options.longs === String ? String(message.trackId) : message.trackId; + else + object.trackId = options.longs === String ? $util.Long.prototype.toString.call(message.trackId) : options.longs === Number ? new $util.LongBits(message.trackId.low >>> 0, message.trackId.high >>> 0).toNumber() : message.trackId; + if (options.oneofs) + object.trackInfo = "trackId"; + } return object; }; diff --git a/packages/google-cloud-videointelligence/protos/protos.json b/packages/google-cloud-videointelligence/protos/protos.json index e2b7a29bb14..a656c3b4018 100644 --- a/packages/google-cloud-videointelligence/protos/protos.json +++ b/packages/google-cloud-videointelligence/protos/protos.json @@ -2259,7 +2259,23 @@ } }, "ObjectTrackingAnnotation": { + "oneofs": { + "trackInfo": { + "oneof": [ + "segment", + "trackId" + ] + } + }, "fields": { + "segment": { + "type": "VideoSegment", + "id": 3 + }, + "trackId": { + "type": "int64", + "id": 5 + }, "entity": { "type": "Entity", "id": 1 @@ -2272,10 +2288,6 @@ "rule": "repeated", "type": "ObjectTrackingFrame", "id": 2 - }, - "segment": { - "type": "VideoSegment", - "id": 3 } } },