Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
feat: field ObjectTrackingAnnotation.segment moved into oneof, added …
Browse files Browse the repository at this point in the history
…track_id (#318)

* chore: use gapic-generator-python 0.65.2

PiperOrigin-RevId: 444333013

Source-Link: googleapis/googleapis@f91b6cf

Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat!: field ObjectTrackingAnnotation.segment moved into oneof, added track_id

PiperOrigin-RevId: 445061085

Source-Link: googleapis/googleapis@0506e19

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 <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Apr 28, 2022
1 parent 2b71e19 commit f1f88d4
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ async def annotate_video(
from google.cloud import videointelligence_v1
def sample_annotate_video():
async def sample_annotate_video():
# Create a client
client = videointelligence_v1.VideoIntelligenceServiceClient()
client = videointelligence_v1.VideoIntelligenceServiceAsyncClient()
# Initialize request argument(s)
request = videointelligence_v1.AnnotateVideoRequest(
Expand All @@ -242,7 +242,7 @@ def sample_annotate_video():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ async def annotate_video(
from google.cloud import videointelligence_v1beta2
def sample_annotate_video():
async def sample_annotate_video():
# Create a client
client = videointelligence_v1beta2.VideoIntelligenceServiceClient()
client = videointelligence_v1beta2.VideoIntelligenceServiceAsyncClient()
# Initialize request argument(s)
request = videointelligence_v1beta2.AnnotateVideoRequest(
Expand All @@ -242,7 +242,7 @@ def sample_annotate_video():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ async def annotate_video(
from google.cloud import videointelligence_v1p1beta1
def sample_annotate_video():
async def sample_annotate_video():
# Create a client
client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient()
client = videointelligence_v1p1beta1.VideoIntelligenceServiceAsyncClient()
# Initialize request argument(s)
request = videointelligence_v1p1beta1.AnnotateVideoRequest(
Expand All @@ -242,7 +242,7 @@ def sample_annotate_video():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ async def annotate_video(
from google.cloud import videointelligence_v1p2beta1
def sample_annotate_video():
async def sample_annotate_video():
# Create a client
client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient()
client = videointelligence_v1p2beta1.VideoIntelligenceServiceAsyncClient()
# Initialize request argument(s)
request = videointelligence_v1p2beta1.AnnotateVideoRequest(
Expand All @@ -242,7 +242,7 @@ def sample_annotate_video():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,29 @@ class ObjectTrackingFrame(proto.Message):
class ObjectTrackingAnnotation(proto.Message):
r"""Annotations corresponding to one tracked object.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
segment (google.cloud.videointelligence_v1p2beta1.types.VideoSegment):
Non-streaming batch mode ONLY.
Each object track corresponds to one video
segment where it appears.
This field is a member of `oneof`_ ``track_info``.
track_id (int):
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.
This field is a member of `oneof`_ ``track_info``.
entity (google.cloud.videointelligence_v1p2beta1.types.Entity):
Entity to specify the object category that
this track is labeled as.
Expand All @@ -822,11 +844,19 @@ class ObjectTrackingAnnotation(proto.Message):
frames (Sequence[google.cloud.videointelligence_v1p2beta1.types.ObjectTrackingFrame]):
Information corresponding to all frames where
this object track appears.
segment (google.cloud.videointelligence_v1p2beta1.types.VideoSegment):
Each object track corresponds to one video
segment where it appears.
"""

segment = proto.Field(
proto.MESSAGE,
number=3,
oneof="track_info",
message="VideoSegment",
)
track_id = proto.Field(
proto.INT64,
number=5,
oneof="track_info",
)
entity = proto.Field(
proto.MESSAGE,
number=1,
Expand All @@ -841,11 +871,6 @@ class ObjectTrackingAnnotation(proto.Message):
number=2,
message="ObjectTrackingFrame",
)
segment = proto.Field(
proto.MESSAGE,
number=3,
message="VideoSegment",
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ def streaming_annotate_video(
from google.cloud import videointelligence_v1p3beta1
def sample_streaming_annotate_video():
async def sample_streaming_annotate_video():
# Create a client
client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient()
client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceAsyncClient()
# Initialize request argument(s)
request = videointelligence_v1p3beta1.StreamingAnnotateVideoRequest(
Expand All @@ -267,10 +267,10 @@ def request_generator():
yield request
# Make the request
stream = client.streaming_annotate_video(requests=request_generator())
stream = await client.streaming_annotate_video(requests=request_generator())
# Handle the response
for response in stream:
async for response in stream:
print(response)
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ async def annotate_video(
from google.cloud import videointelligence_v1p3beta1
def sample_annotate_video():
async def sample_annotate_video():
# Create a client
client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient()
client = videointelligence_v1p3beta1.VideoIntelligenceServiceAsyncClient()
# Initialize request argument(s)
request = videointelligence_v1p3beta1.AnnotateVideoRequest(
Expand All @@ -242,7 +242,7 @@ def sample_annotate_video():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down

0 comments on commit f1f88d4

Please sign in to comment.