From 49512c73baa8eeddff19f3c696fcfba5bc955cf1 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 15 Sep 2017 11:44:45 -0700 Subject: [PATCH 1/3] Remove previous auto-gen. --- .../google/cloud/gapic/__init__.py | 1 - .../cloud/gapic/videointelligence/__init__.py | 1 - .../videointelligence/v1beta1/__init__.py | 0 .../gapic/videointelligence/v1beta1/enums.py | 87 -- .../video_intelligence_service_client.py | 238 --- ...eo_intelligence_service_client_config.json | 31 - .../google/cloud/proto/__init__.py | 1 - .../cloud/proto/videointelligence/__init__.py | 1 - .../videointelligence/v1beta1/__init__.py | 1 - .../v1beta1/video_intelligence_pb2.py | 1337 ----------------- .../v1beta1/video_intelligence_pb2_grpc.py | 50 - videointelligence/setup.py | 4 - 12 files changed, 1752 deletions(-) delete mode 100644 videointelligence/google/cloud/gapic/__init__.py delete mode 100644 videointelligence/google/cloud/gapic/videointelligence/__init__.py delete mode 100644 videointelligence/google/cloud/gapic/videointelligence/v1beta1/__init__.py delete mode 100644 videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py delete mode 100644 videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py delete mode 100644 videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json delete mode 100644 videointelligence/google/cloud/proto/__init__.py delete mode 100644 videointelligence/google/cloud/proto/videointelligence/__init__.py delete mode 100644 videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py delete mode 100644 videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py delete mode 100644 videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py diff --git a/videointelligence/google/cloud/gapic/__init__.py b/videointelligence/google/cloud/gapic/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/gapic/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/gapic/videointelligence/__init__.py b/videointelligence/google/cloud/gapic/videointelligence/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/__init__.py b/videointelligence/google/cloud/gapic/videointelligence/v1beta1/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py b/videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py deleted file mode 100644 index b0781914a3de..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2016 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Wrappers for protocol buffer enum types.""" - - -class Feature(object): - """ - Video annotation feature. - - Attributes: - FEATURE_UNSPECIFIED (int): Unspecified. - LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - FACE_DETECTION (int): Human face detection and tracking. - SHOT_CHANGE_DETECTION (int): Shot change detection. - SAFE_SEARCH_DETECTION (int): Safe search detection. - """ - FEATURE_UNSPECIFIED = 0 - LABEL_DETECTION = 1 - FACE_DETECTION = 2 - SHOT_CHANGE_DETECTION = 3 - SAFE_SEARCH_DETECTION = 4 - - -class LabelLevel(object): - """ - Label level (scope). - - Attributes: - LABEL_LEVEL_UNSPECIFIED (int): Unspecified. - VIDEO_LEVEL (int): Video-level. Corresponds to the whole video. - SEGMENT_LEVEL (int): Segment-level. Corresponds to one of ``AnnotateSpec.segments``. - SHOT_LEVEL (int): Shot-level. Corresponds to a single shot (i.e. a series of frames - without a major camera position or background change). - FRAME_LEVEL (int): Frame-level. Corresponds to a single video frame. - """ - LABEL_LEVEL_UNSPECIFIED = 0 - VIDEO_LEVEL = 1 - SEGMENT_LEVEL = 2 - SHOT_LEVEL = 3 - FRAME_LEVEL = 4 - - -class LabelDetectionMode(object): - """ - Label detection mode. - - Attributes: - LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. - SHOT_MODE (int): Detect shot-level labels. - FRAME_MODE (int): Detect frame-level labels. - SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. - """ - LABEL_DETECTION_MODE_UNSPECIFIED = 0 - SHOT_MODE = 1 - FRAME_MODE = 2 - SHOT_AND_FRAME_MODE = 3 - - -class Likelihood(object): - """ - Bucketized representation of likelihood. - - Attributes: - UNKNOWN (int): Unknown likelihood. - VERY_UNLIKELY (int): Very unlikely. - UNLIKELY (int): Unlikely. - POSSIBLE (int): Possible. - LIKELY (int): Likely. - VERY_LIKELY (int): Very likely. - """ - UNKNOWN = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py b/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py deleted file mode 100644 index 5baae515c69c..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py +++ /dev/null @@ -1,238 +0,0 @@ -# Copyright 2017, Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# EDITING INSTRUCTIONS -# This file was generated from the file -# https://github.com/google/googleapis/blob/master/google/cloud/videointelligence/v1beta1/video_intelligence.proto, -# and updates to that file get reflected here through a refresh process. -# For the short term, the refresh process will only be runnable by Google engineers. -# -# The only allowed edits are to method and file documentation. A 3-way -# merge preserves those additions if the generated source changes. -"""Accesses the google.cloud.videointelligence.v1beta1 VideoIntelligenceService API.""" - -import collections -import json -import os -import pkg_resources -import platform - -from google.gapic.longrunning import operations_client -from google.gax import api_callable -from google.gax import config -from google.gax import path_template -import google.gax - -from google.cloud.gapic.videointelligence.v1beta1 import enums -from google.cloud.proto.videointelligence.v1beta1 import video_intelligence_pb2 - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = 'videointelligence.googleapis.com' - """The default address of the service.""" - - DEFAULT_SERVICE_PORT = 443 - """The default port of the service.""" - - # The scopes needed to make gRPC calls to all of the methods defined in - # this service - _ALL_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) - - def __init__(self, - service_path=SERVICE_ADDRESS, - port=DEFAULT_SERVICE_PORT, - channel=None, - credentials=None, - ssl_credentials=None, - scopes=None, - client_config=None, - app_name=None, - app_version='', - lib_name=None, - lib_version='', - metrics_headers=()): - """Constructor. - - Args: - service_path (string): The domain name of the API remote host. - port (int): The port on which to connect to the remote host. - channel (:class:`grpc.Channel`): A ``Channel`` instance through - which to make calls. - credentials (object): The authorization credentials to attach to - requests. These credentials identify this application to the - service. - ssl_credentials (:class:`grpc.ChannelCredentials`): A - ``ChannelCredentials`` instance for use with an SSL-enabled - channel. - scopes (list[string]): A list of OAuth2 scopes to attach to requests. - client_config (dict): - A dictionary for call options for each method. See - :func:`google.gax.construct_settings` for the structure of - this data. Falls back to the default config if not specified - or the specified config is missing data points. - app_name (string): The name of the application calling - the service. Recommended for analytics purposes. - app_version (string): The version of the application calling - the service. Recommended for analytics purposes. - lib_name (string): The API library software used for calling - the service. (Unless you are writing an API client itself, - leave this as default.) - lib_version (string): The API library software version used - for calling the service. (Unless you are writing an API client - itself, leave this as default.) - metrics_headers (dict): A dictionary of values for tracking - client library metrics. Ultimately serializes to a string - (e.g. 'foo/1.2.3 bar/3.14.1'). This argument should be - considered private. - - Returns: - A VideoIntelligenceServiceClient object. - """ - # Unless the calling application specifically requested - # OAuth scopes, request everything. - if scopes is None: - scopes = self._ALL_SCOPES - - # Initialize an empty client config, if none is set. - if client_config is None: - client_config = {} - - # Initialize metrics_headers as an ordered dictionary - # (cuts down on cardinality of the resulting string slightly). - metrics_headers = collections.OrderedDict(metrics_headers) - metrics_headers['gl-python'] = platform.python_version() - - # The library may or may not be set, depending on what is - # calling this client. Newer client libraries set the library name - # and version. - if lib_name: - metrics_headers[lib_name] = lib_version - - # Finally, track the GAPIC package version. - metrics_headers['gapic'] = pkg_resources.get_distribution( - 'google-cloud-videointelligence', ).version - - # Load the configuration defaults. - default_client_config = json.loads( - pkg_resources.resource_string( - __name__, 'video_intelligence_service_client_config.json') - .decode()) - defaults = api_callable.construct_settings( - 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', - default_client_config, - client_config, - config.STATUS_CODE_NAMES, - metrics_headers=metrics_headers, ) - self.video_intelligence_service_stub = config.create_stub( - video_intelligence_pb2.VideoIntelligenceServiceStub, - channel=channel, - service_path=service_path, - service_port=port, - credentials=credentials, - scopes=scopes, - ssl_credentials=ssl_credentials) - - self.operations_client = operations_client.OperationsClient( - service_path=service_path, - port=port, - channel=channel, - credentials=credentials, - ssl_credentials=ssl_credentials, - scopes=scopes, - client_config=client_config, - metrics_headers=metrics_headers, ) - - self._annotate_video = api_callable.create_api_call( - self.video_intelligence_service_stub.AnnotateVideo, - settings=defaults['annotate_video']) - - # Service calls - def annotate_video(self, - input_uri, - features, - input_content=None, - video_context=None, - output_uri=None, - location_id=None, - options=None): - """ - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Example: - >>> from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client - >>> from google.cloud.gapic.videointelligence.v1beta1 import enums - >>> client = video_intelligence_service_client.VideoIntelligenceServiceClient() - >>> input_uri = '' - >>> features = [] - >>> response = client.annotate_video(input_uri, features) - >>> - >>> def callback(operation_future): - >>> # Handle result. - >>> result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (string): Input video location. Currently, only - `Google Cloud Storage `_ URIs are - supported, which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return - ``google.rpc.Code.INVALID_ARGUMENT``). For more information, see - `Request URIs `_. - A video URI may include wildcards in ``object-id``, and thus identify - multiple videos. Supported wildcards: '*' to match 0 or more characters; - '?' to match 1 character. If unset, the input video should be embedded - in the request as ``input_content``. If set, ``input_content`` should be unset. - features (list[enum :class:`google.cloud.gapic.videointelligence.v1beta1.enums.Feature`]): Requested video annotation features. - input_content (string): The video data bytes. Encoding: base64. If unset, the input video(s) - should be specified via ``input_uri``. If set, ``input_uri`` should be unset. - video_context (:class:`google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2.VideoContext`): Additional video context and/or feature-specific parameters. - output_uri (string): Optional location where the output (in JSON format) should be stored. - Currently, only `Google Cloud Storage `_ - URIs are supported, which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return - ``google.rpc.Code.INVALID_ARGUMENT``). For more information, see - `Request URIs `_. - location_id (string): Optional cloud region where annotation should take place. Supported cloud - regions: ``us-east1``, ``us-west1``, ``europe-west1``, ``asia-east1``. If no region - is specified, a region will be determined based on video file location. - options (:class:`google.gax.CallOptions`): Overrides the default - settings for this call, e.g, timeout, retries etc. - - Returns: - A :class:`google.gax._OperationFuture` instance. - - Raises: - :exc:`google.gax.errors.GaxError` if the RPC is aborted. - :exc:`ValueError` if the parameters are invalid. - """ - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - features=features, - input_content=input_content, - video_context=video_context, - output_uri=output_uri, - location_id=location_id) - return google.gax._OperationFuture( - self._annotate_video(request, options), self.operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - video_intelligence_pb2.AnnotateVideoProgress, options) diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json b/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json deleted file mode 100644 index 996b2ab5e30b..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "interfaces": { - "google.cloud.videointelligence.v1beta1.VideoIntelligenceService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.5, - "max_retry_delay_millis": 120000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "AnnotateVideo": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/videointelligence/google/cloud/proto/__init__.py b/videointelligence/google/cloud/proto/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/proto/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/proto/videointelligence/__init__.py b/videointelligence/google/cloud/proto/videointelligence/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/proto/videointelligence/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py b/videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py deleted file mode 100644 index 8b137891791f..000000000000 --- a/videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py b/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py deleted file mode 100644 index 7eb2e71d7e05..000000000000 --- a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py +++ /dev/null @@ -1,1337 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/proto/videointelligence/v1beta1/video_intelligence.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/cloud/proto/videointelligence/v1beta1/video_intelligence.proto', - package='google.cloud.videointelligence.v1beta1', - syntax='proto3', - serialized_pb=_b('\nEgoogle/cloud/proto/videointelligence/v1beta1/video_intelligence.proto\x12&google.cloud.videointelligence.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf9\x01\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\t\x12\x41\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32/.google.cloud.videointelligence.v1beta1.Feature\x12K\n\rvideo_context\x18\x03 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t\"\xd2\x02\n\x0cVideoContext\x12\x46\n\x08segments\x18\x01 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12X\n\x14label_detection_mode\x18\x02 \x01(\x0e\x32:.google.cloud.videointelligence.v1beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x03 \x01(\x08\x12\x1d\n\x15label_detection_model\x18\x04 \x01(\t\x12\x1c\n\x14\x66\x61\x63\x65_detection_model\x18\x05 \x01(\t\x12#\n\x1bshot_change_detection_model\x18\x06 \x01(\t\x12#\n\x1bsafe_search_detection_model\x18\x07 \x01(\t\"B\n\x0cVideoSegment\x12\x19\n\x11start_time_offset\x18\x01 \x01(\x03\x12\x17\n\x0f\x65nd_time_offset\x18\x02 \x01(\x03\"\xad\x01\n\rLabelLocation\x12\x45\n\x07segment\x18\x01 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x41\n\x05level\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.LabelLevel\"\x87\x01\n\x0fLabelAnnotation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12H\n\tlocations\x18\x03 \x03(\x0b\x32\x35.google.cloud.videointelligence.v1beta1.LabelLocation\"\xfd\x02\n\x14SafeSearchAnnotation\x12\x41\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x41\n\x05spoof\x18\x02 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07medical\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07violent\x18\x04 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12@\n\x04racy\x18\x05 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x13\n\x0btime_offset\x18\x06 \x01(\x03\"G\n\x0b\x42oundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\r\n\x05right\x18\x02 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x03 \x01(\x05\x12\x0b\n\x03top\x18\x04 \x01(\x05\"n\n\x0c\x46\x61\x63\x65Location\x12I\n\x0c\x62ounding_box\x18\x01 \x01(\x0b\x32\x33.google.cloud.videointelligence.v1beta1.BoundingBox\x12\x13\n\x0btime_offset\x18\x02 \x01(\x03\"\xb4\x01\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x11\n\tthumbnail\x18\x01 \x01(\t\x12\x46\n\x08segments\x18\x02 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12G\n\tlocations\x18\x03 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.FaceLocation\"\xa3\x03\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12R\n\x11label_annotations\x18\x02 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta1.LabelAnnotation\x12P\n\x10\x66\x61\x63\x65_annotations\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1beta1.FaceAnnotation\x12N\n\x10shot_annotations\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12]\n\x17safe_search_annotations\x18\x06 \x03(\x0b\x32<.google.cloud.videointelligence.v1beta1.SafeSearchAnnotation\x12!\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.Status\"s\n\x15\x41nnotateVideoResponse\x12Z\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1beta1.VideoAnnotationResults\"\xa7\x01\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"u\n\x15\x41nnotateVideoProgress\x12\\\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32?.google.cloud.videointelligence.v1beta1.VideoAnnotationProgress*\x81\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x02\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x03\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x04*n\n\nLabelLevel\x12\x1b\n\x17LABEL_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0bVIDEO_LEVEL\x10\x01\x12\x11\n\rSEGMENT_LEVEL\x10\x02\x12\x0e\n\nSHOT_LEVEL\x10\x03\x12\x0f\n\x0b\x46RAME_LEVEL\x10\x04*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xae\x01\n\x18VideoIntelligenceService\x12\x91\x01\n\rAnnotateVideo\x12<.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/videos:annotate:\x01*B\xcf\x01\n*com.google.cloud.videointelligence.v1beta1B\x1dVideoIntelligenceServiceProtoP\x01ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\xaa\x02&Google.Cloud.VideoIntelligence.V1Beta1b\x06proto3') - , - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,google_dot_rpc_dot_status__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -_FEATURE = _descriptor.EnumDescriptor( - name='Feature', - full_name='google.cloud.videointelligence.v1beta1.Feature', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='FEATURE_UNSPECIFIED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='LABEL_DETECTION', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FACE_DETECTION', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SHOT_CHANGE_DETECTION', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SAFE_SEARCH_DETECTION', index=4, number=4, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=2794, - serialized_end=2923, -) -_sym_db.RegisterEnumDescriptor(_FEATURE) - -Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) -_LABELLEVEL = _descriptor.EnumDescriptor( - name='LabelLevel', - full_name='google.cloud.videointelligence.v1beta1.LabelLevel', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='LABEL_LEVEL_UNSPECIFIED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='VIDEO_LEVEL', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SEGMENT_LEVEL', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SHOT_LEVEL', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FRAME_LEVEL', index=4, number=4, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=2925, - serialized_end=3035, -) -_sym_db.RegisterEnumDescriptor(_LABELLEVEL) - -LabelLevel = enum_type_wrapper.EnumTypeWrapper(_LABELLEVEL) -_LABELDETECTIONMODE = _descriptor.EnumDescriptor( - name='LabelDetectionMode', - full_name='google.cloud.videointelligence.v1beta1.LabelDetectionMode', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='LABEL_DETECTION_MODE_UNSPECIFIED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SHOT_MODE', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FRAME_MODE', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SHOT_AND_FRAME_MODE', index=3, number=3, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=3037, - serialized_end=3151, -) -_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) - -LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) -_LIKELIHOOD = _descriptor.EnumDescriptor( - name='Likelihood', - full_name='google.cloud.videointelligence.v1beta1.Likelihood', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='VERY_UNLIKELY', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='UNLIKELY', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='POSSIBLE', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='LIKELY', index=4, number=4, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='VERY_LIKELY', index=5, number=5, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=3153, - serialized_end=3254, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -FEATURE_UNSPECIFIED = 0 -LABEL_DETECTION = 1 -FACE_DETECTION = 2 -SHOT_CHANGE_DETECTION = 3 -SAFE_SEARCH_DETECTION = 4 -LABEL_LEVEL_UNSPECIFIED = 0 -VIDEO_LEVEL = 1 -SEGMENT_LEVEL = 2 -SHOT_LEVEL = 3 -FRAME_LEVEL = 4 -LABEL_DETECTION_MODE_UNSPECIFIED = 0 -SHOT_MODE = 1 -FRAME_MODE = 2 -SHOT_AND_FRAME_MODE = 3 -UNKNOWN = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - - -_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name='AnnotateVideoRequest', - full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='input_uri', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.input_uri', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='input_content', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.input_content', index=1, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='features', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.features', index=2, - number=2, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='video_context', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.video_context', index=3, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='output_uri', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.output_uri', index=4, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='location_id', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.location_id', index=5, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=239, - serialized_end=488, -) - - -_VIDEOCONTEXT = _descriptor.Descriptor( - name='VideoContext', - full_name='google.cloud.videointelligence.v1beta1.VideoContext', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='segments', full_name='google.cloud.videointelligence.v1beta1.VideoContext.segments', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='label_detection_mode', full_name='google.cloud.videointelligence.v1beta1.VideoContext.label_detection_mode', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='stationary_camera', full_name='google.cloud.videointelligence.v1beta1.VideoContext.stationary_camera', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='label_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.label_detection_model', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='face_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.face_detection_model', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='shot_change_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.shot_change_detection_model', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='safe_search_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.safe_search_detection_model', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=491, - serialized_end=829, -) - - -_VIDEOSEGMENT = _descriptor.Descriptor( - name='VideoSegment', - full_name='google.cloud.videointelligence.v1beta1.VideoSegment', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='start_time_offset', full_name='google.cloud.videointelligence.v1beta1.VideoSegment.start_time_offset', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='end_time_offset', full_name='google.cloud.videointelligence.v1beta1.VideoSegment.end_time_offset', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=831, - serialized_end=897, -) - - -_LABELLOCATION = _descriptor.Descriptor( - name='LabelLocation', - full_name='google.cloud.videointelligence.v1beta1.LabelLocation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='segment', full_name='google.cloud.videointelligence.v1beta1.LabelLocation.segment', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='confidence', full_name='google.cloud.videointelligence.v1beta1.LabelLocation.confidence', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='level', full_name='google.cloud.videointelligence.v1beta1.LabelLocation.level', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=900, - serialized_end=1073, -) - - -_LABELANNOTATION = _descriptor.Descriptor( - name='LabelAnnotation', - full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='description', full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation.description', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='language_code', full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation.language_code', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='locations', full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation.locations', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1076, - serialized_end=1211, -) - - -_SAFESEARCHANNOTATION = _descriptor.Descriptor( - name='SafeSearchAnnotation', - full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='adult', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.adult', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='spoof', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.spoof', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='medical', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.medical', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='violent', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.violent', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='racy', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.racy', index=4, - number=5, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='time_offset', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.time_offset', index=5, - number=6, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1214, - serialized_end=1595, -) - - -_BOUNDINGBOX = _descriptor.Descriptor( - name='BoundingBox', - full_name='google.cloud.videointelligence.v1beta1.BoundingBox', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='left', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.left', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='right', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.right', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='bottom', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.bottom', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='top', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.top', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1597, - serialized_end=1668, -) - - -_FACELOCATION = _descriptor.Descriptor( - name='FaceLocation', - full_name='google.cloud.videointelligence.v1beta1.FaceLocation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='bounding_box', full_name='google.cloud.videointelligence.v1beta1.FaceLocation.bounding_box', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='time_offset', full_name='google.cloud.videointelligence.v1beta1.FaceLocation.time_offset', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1670, - serialized_end=1780, -) - - -_FACEANNOTATION = _descriptor.Descriptor( - name='FaceAnnotation', - full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='thumbnail', full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation.thumbnail', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='segments', full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation.segments', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='locations', full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation.locations', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1783, - serialized_end=1963, -) - - -_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name='VideoAnnotationResults', - full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='input_uri', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.input_uri', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='label_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.label_annotations', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='face_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.face_annotations', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='shot_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.shot_annotations', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='safe_search_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.safe_search_annotations', index=4, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='error', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.error', index=5, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1966, - serialized_end=2385, -) - - -_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name='AnnotateVideoResponse', - full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='annotation_results', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoResponse.annotation_results', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2387, - serialized_end=2502, -) - - -_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( - name='VideoAnnotationProgress', - full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='input_uri', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.input_uri', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='progress_percent', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.progress_percent', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='start_time', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.start_time', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='update_time', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.update_time', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2505, - serialized_end=2672, -) - - -_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( - name='AnnotateVideoProgress', - full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoProgress', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='annotation_progress', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoProgress.annotation_progress', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2674, - serialized_end=2791, -) - -_ANNOTATEVIDEOREQUEST.fields_by_name['features'].enum_type = _FEATURE -_ANNOTATEVIDEOREQUEST.fields_by_name['video_context'].message_type = _VIDEOCONTEXT -_VIDEOCONTEXT.fields_by_name['segments'].message_type = _VIDEOSEGMENT -_VIDEOCONTEXT.fields_by_name['label_detection_mode'].enum_type = _LABELDETECTIONMODE -_LABELLOCATION.fields_by_name['segment'].message_type = _VIDEOSEGMENT -_LABELLOCATION.fields_by_name['level'].enum_type = _LABELLEVEL -_LABELANNOTATION.fields_by_name['locations'].message_type = _LABELLOCATION -_SAFESEARCHANNOTATION.fields_by_name['adult'].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name['spoof'].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name['medical'].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name['violent'].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name['racy'].enum_type = _LIKELIHOOD -_FACELOCATION.fields_by_name['bounding_box'].message_type = _BOUNDINGBOX -_FACEANNOTATION.fields_by_name['segments'].message_type = _VIDEOSEGMENT -_FACEANNOTATION.fields_by_name['locations'].message_type = _FACELOCATION -_VIDEOANNOTATIONRESULTS.fields_by_name['label_annotations'].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name['face_annotations'].message_type = _FACEANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name['shot_annotations'].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name['safe_search_annotations'].message_type = _SAFESEARCHANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name['error'].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEVIDEORESPONSE.fields_by_name['annotation_results'].message_type = _VIDEOANNOTATIONRESULTS -_VIDEOANNOTATIONPROGRESS.fields_by_name['start_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name['update_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_ANNOTATEVIDEOPROGRESS.fields_by_name['annotation_progress'].message_type = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name['AnnotateVideoRequest'] = _ANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name['VideoContext'] = _VIDEOCONTEXT -DESCRIPTOR.message_types_by_name['VideoSegment'] = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name['LabelLocation'] = _LABELLOCATION -DESCRIPTOR.message_types_by_name['LabelAnnotation'] = _LABELANNOTATION -DESCRIPTOR.message_types_by_name['SafeSearchAnnotation'] = _SAFESEARCHANNOTATION -DESCRIPTOR.message_types_by_name['BoundingBox'] = _BOUNDINGBOX -DESCRIPTOR.message_types_by_name['FaceLocation'] = _FACELOCATION -DESCRIPTOR.message_types_by_name['FaceAnnotation'] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name['VideoAnnotationResults'] = _VIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name['AnnotateVideoResponse'] = _ANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name['VideoAnnotationProgress'] = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name['AnnotateVideoProgress'] = _ANNOTATEVIDEOPROGRESS -DESCRIPTOR.enum_types_by_name['Feature'] = _FEATURE -DESCRIPTOR.enum_types_by_name['LabelLevel'] = _LABELLEVEL -DESCRIPTOR.enum_types_by_name['LabelDetectionMode'] = _LABELDETECTIONMODE -DESCRIPTOR.enum_types_by_name['Likelihood'] = _LIKELIHOOD - -AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType('AnnotateVideoRequest', (_message.Message,), dict( - DESCRIPTOR = _ANNOTATEVIDEOREQUEST, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Video annotation request. - - - Attributes: - input_uri: - Input video location. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. A video URI may include - wildcards in ``object-id``, and thus identify multiple videos. - Supported wildcards: '\*' to match 0 or more characters; '?' - to match 1 character. If unset, the input video should be - embedded in the request as ``input_content``. If set, - ``input_content`` should be unset. - input_content: - The video data bytes. Encoding: base64. If unset, the input - video(s) should be specified via ``input_uri``. If set, - ``input_uri`` should be unset. - features: - Requested video annotation features. - video_context: - Additional video context and/or feature-specific parameters. - output_uri: - Optional location where the output (in JSON format) should be - stored. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. - location_id: - Optional cloud region where annotation should take place. - Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- - west1``, ``asia-east1``. If no region is specified, a region - will be determined based on video file location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoRequest) - )) -_sym_db.RegisterMessage(AnnotateVideoRequest) - -VideoContext = _reflection.GeneratedProtocolMessageType('VideoContext', (_message.Message,), dict( - DESCRIPTOR = _VIDEOCONTEXT, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Video context and/or feature-specific parameters. - - - Attributes: - segments: - Video segments to annotate. The segments may overlap and are - not required to be contiguous or span the whole video. If - unspecified, each video is treated as a single segment. - label_detection_mode: - If label detection has been requested, what labels should be - detected in addition to video-level labels or segment-level - labels. If unspecified, defaults to ``SHOT_MODE``. - stationary_camera: - Whether the video has been shot from a stationary (i.e. non- - moving) camera. When set to true, might improve detection - accuracy for moving objects. - label_detection_model: - Model to use for label detection. Supported values: "latest" - and "stable" (the default). - face_detection_model: - Model to use for face detection. Supported values: "latest" - and "stable" (the default). - shot_change_detection_model: - Model to use for shot change detection. Supported values: - "latest" and "stable" (the default). - safe_search_detection_model: - Model to use for safe search detection. Supported values: - "latest" and "stable" (the default). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoContext) - )) -_sym_db.RegisterMessage(VideoContext) - -VideoSegment = _reflection.GeneratedProtocolMessageType('VideoSegment', (_message.Message,), dict( - DESCRIPTOR = _VIDEOSEGMENT, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Video segment. - - - Attributes: - start_time_offset: - Start offset in microseconds (inclusive). Unset means 0. - end_time_offset: - End offset in microseconds (inclusive). Unset means 0. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoSegment) - )) -_sym_db.RegisterMessage(VideoSegment) - -LabelLocation = _reflection.GeneratedProtocolMessageType('LabelLocation', (_message.Message,), dict( - DESCRIPTOR = _LABELLOCATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Label location. - - - Attributes: - segment: - Video segment. Set to [-1, -1] for video-level labels. Set to - [timestamp, timestamp] for frame-level labels. Otherwise, - corresponds to one of ``AnnotateSpec.segments`` (if specified) - or to shot boundaries (if requested). - confidence: - Confidence that the label is accurate. Range: [0, 1]. - level: - Label level. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.LabelLocation) - )) -_sym_db.RegisterMessage(LabelLocation) - -LabelAnnotation = _reflection.GeneratedProtocolMessageType('LabelAnnotation', (_message.Message,), dict( - DESCRIPTOR = _LABELANNOTATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Label annotation. - - - Attributes: - description: - Textual description, e.g. ``Fixed-gear bicycle``. - language_code: - Language code for ``description`` in BCP-47 format. - locations: - Where the label was detected and with what confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.LabelAnnotation) - )) -_sym_db.RegisterMessage(LabelAnnotation) - -SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType('SafeSearchAnnotation', (_message.Message,), dict( - DESCRIPTOR = _SAFESEARCHANNOTATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Safe search annotation (based on per-frame visual signals only). If no - unsafe content has been detected in a frame, no annotations are present - for that frame. If only some types of unsafe content have been detected - in a frame, the likelihood is set to ``UNKNOWN`` for all other types of - unsafe content. - - - Attributes: - adult: - Likelihood of adult content. - spoof: - Likelihood that an obvious modification was made to the - original version to make it appear funny or offensive. - medical: - Likelihood of medical content. - violent: - Likelihood of violent content. - racy: - Likelihood of racy content. - time_offset: - Video time offset in microseconds. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.SafeSearchAnnotation) - )) -_sym_db.RegisterMessage(SafeSearchAnnotation) - -BoundingBox = _reflection.GeneratedProtocolMessageType('BoundingBox', (_message.Message,), dict( - DESCRIPTOR = _BOUNDINGBOX, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Bounding box. - - - Attributes: - left: - Left X coordinate. - right: - Right X coordinate. - bottom: - Bottom Y coordinate. - top: - Top Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.BoundingBox) - )) -_sym_db.RegisterMessage(BoundingBox) - -FaceLocation = _reflection.GeneratedProtocolMessageType('FaceLocation', (_message.Message,), dict( - DESCRIPTOR = _FACELOCATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Face location. - - - Attributes: - bounding_box: - Bounding box in a frame. - time_offset: - Video time offset in microseconds. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.FaceLocation) - )) -_sym_db.RegisterMessage(FaceLocation) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType('FaceAnnotation', (_message.Message,), dict( - DESCRIPTOR = _FACEANNOTATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Face annotation. - - - Attributes: - thumbnail: - Thumbnail of a representative face view (in JPEG format). - Encoding: base64. - segments: - All locations where a face was detected. Faces are detected - and tracked on a per-video basis (as opposed to across - multiple videos). - locations: - Face locations at one frame per second. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.FaceAnnotation) - )) -_sym_db.RegisterMessage(FaceAnnotation) - -VideoAnnotationResults = _reflection.GeneratedProtocolMessageType('VideoAnnotationResults', (_message.Message,), dict( - DESCRIPTOR = _VIDEOANNOTATIONRESULTS, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Annotation results for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - label_annotations: - Label annotations. There is exactly one element for each - unique label. - face_annotations: - Face annotations. There is exactly one element for each unique - face. - shot_annotations: - Shot annotations. Each shot is represented as a video segment. - safe_search_annotations: - Safe search annotations. - error: - If set, indicates an error. Note that for a single - ``AnnotateVideoRequest`` some videos may succeed and some may - fail. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoAnnotationResults) - )) -_sym_db.RegisterMessage(VideoAnnotationResults) - -AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType('AnnotateVideoResponse', (_message.Message,), dict( - DESCRIPTOR = _ANNOTATEVIDEORESPONSE, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Video annotation response. Included in the ``response`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_results: - Annotation results for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoResponse) - )) -_sym_db.RegisterMessage(AnnotateVideoResponse) - -VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType('VideoAnnotationProgress', (_message.Message,), dict( - DESCRIPTOR = _VIDEOANNOTATIONPROGRESS, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Annotation progress for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - progress_percent: - Approximate percentage processed thus far. Guaranteed to be - 100 when fully processed. - start_time: - Time when the request was received. - update_time: - Time of the most recent update. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoAnnotationProgress) - )) -_sym_db.RegisterMessage(VideoAnnotationProgress) - -AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType('AnnotateVideoProgress', (_message.Message,), dict( - DESCRIPTOR = _ANNOTATEVIDEOPROGRESS, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' - , - __doc__ = """Video annotation progress. Included in the ``metadata`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_progress: - Progress metadata for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoProgress) - )) -_sym_db.RegisterMessage(AnnotateVideoProgress) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n*com.google.cloud.videointelligence.v1beta1B\035VideoIntelligenceServiceProtoP\001ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\252\002&Google.Cloud.VideoIntelligence.V1Beta1')) -try: - # THESE ELEMENTS WILL BE DEPRECATED. - # Please use the generated *_pb2_grpc.py files instead. - import grpc - from grpc.beta import implementations as beta_implementations - from grpc.beta import interfaces as beta_interfaces - from grpc.framework.common import cardinality - from grpc.framework.interfaces.face import utilities as face_utilities - - - class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - '/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo', - request_serializer=AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - - class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - - def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'AnnotateVideo': grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - class BetaVideoIntelligenceServiceServicer(object): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This class was generated - only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - """Service that implements Google Cloud Video Intelligence API. - """ - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - - - class BetaVideoIntelligenceServiceStub(object): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This class was generated - only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - """Service that implements Google Cloud Video Intelligence API. - """ - def AnnotateVideo(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - raise NotImplementedError() - AnnotateVideo.future = None - - - def beta_create_VideoIntelligenceService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This function was - generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" - request_deserializers = { - ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): AnnotateVideoRequest.FromString, - } - response_serializers = { - ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - } - method_implementations = { - ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): face_utilities.unary_unary_inline(servicer.AnnotateVideo), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - - - def beta_create_VideoIntelligenceService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This function was - generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" - request_serializers = { - ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): AnnotateVideoRequest.SerializeToString, - } - response_deserializers = { - ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, - } - cardinalities = { - 'AnnotateVideo': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', cardinalities, options=stub_options) -except ImportError: - pass -# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py deleted file mode 100644 index ca09db976c12..000000000000 --- a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -import google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2 as google_dot_cloud_dot_proto_dot_videointelligence_dot_v1beta1_dot_video__intelligence__pb2 -import google.longrunning.operations_pb2 as google_dot_longrunning_dot_operations__pb2 - - -class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - '/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo', - request_serializer=google_dot_cloud_dot_proto_dot_videointelligence_dot_v1beta1_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'AnnotateVideo': grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=google_dot_cloud_dot_proto_dot_videointelligence_dot_v1beta1_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/setup.py b/videointelligence/setup.py index 6b69d4267840..2d6d4a6c06e4 100644 --- a/videointelligence/setup.py +++ b/videointelligence/setup.py @@ -35,10 +35,6 @@ namespace_packages=[ 'google', 'google.cloud', - 'google.cloud.gapic', - 'google.cloud.gapic.videointelligence', - 'google.cloud.proto', - 'google.cloud.proto.videointelligence', ], packages=find_packages(exclude=('tests*',)), install_requires=( From 27feb114ca25fa4a8bff64e124da885eb77be9ee Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 15 Sep 2017 11:53:42 -0700 Subject: [PATCH 2/3] Remove tests. --- .../test_video_intelligence_service_client.py | 87 ------------------- 1 file changed, 87 deletions(-) delete mode 100644 videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py diff --git a/videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py b/videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py deleted file mode 100644 index 3d2dcb325420..000000000000 --- a/videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2017, Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Unit tests.""" - -import mock -import unittest - -from google.gax import errors -from google.rpc import status_pb2 - -from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client -from google.cloud.proto.videointelligence.v1beta1 import video_intelligence_pb2 -from google.longrunning import operations_pb2 - - -class CustomException(Exception): - pass - - -class TestVideoIntelligenceServiceClient(unittest.TestCase): - @mock.patch('google.gax.config.create_stub', spec=True) - def test_annotate_video(self, mock_create_stub): - # Mock gRPC layer - grpc_stub = mock.Mock() - mock_create_stub.return_value = grpc_stub - - client = video_intelligence_service_client.VideoIntelligenceServiceClient( - ) - - # Mock request - input_uri = 'inputUri1707300727' - features = [] - - # Mock response - expected_response = video_intelligence_pb2.AnnotateVideoResponse() - operation = operations_pb2.Operation( - name='operations/test_annotate_video', done=True) - operation.response.Pack(expected_response) - grpc_stub.AnnotateVideo.return_value = operation - - response = client.annotate_video(input_uri, features) - self.assertEqual(expected_response, response.result()) - - grpc_stub.AnnotateVideo.assert_called_once() - args, kwargs = grpc_stub.AnnotateVideo.call_args - self.assertEqual(len(args), 2) - self.assertEqual(len(kwargs), 1) - self.assertIn('metadata', kwargs) - actual_request = args[0] - - expected_request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, features=features) - self.assertEqual(expected_request, actual_request) - - @mock.patch('google.gax.config.create_stub', spec=True) - def test_annotate_video_exception(self, mock_create_stub): - # Mock gRPC layer - grpc_stub = mock.Mock() - mock_create_stub.return_value = grpc_stub - - client = video_intelligence_service_client.VideoIntelligenceServiceClient( - ) - - # Mock request - input_uri = 'inputUri1707300727' - features = [] - - # Mock exception response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name='operations/test_annotate_video_exception', done=True) - operation.error.CopyFrom(error) - grpc_stub.AnnotateVideo.return_value = operation - - response = client.annotate_video(input_uri, features) - self.assertEqual(error, response.exception()) From 71f64d6967f9bd70b70631d40931e7ead57541cb Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 15 Sep 2017 13:23:24 -0700 Subject: [PATCH 3/3] Video Intelligence: Add new autogen layer. (#3976) --- .../videointelligence_v1beta1/__init__.py | 13 +- .../gapic/__init__.py | 0 .../videointelligence_v1beta1/gapic/enums.py | 87 ++ .../video_intelligence_service_client.py | 225 +++ ...ideo_intelligence_service_client_config.py | 28 + .../proto/__init__.py | 0 .../proto/video_intelligence_pb2.py | 1361 +++++++++++++++++ .../proto/video_intelligence_pb2_grpc.py | 50 + .../cloud/videointelligence_v1beta1/types.py | 27 +- ...deo_intelligence_service_client_v1beta1.py | 87 ++ 10 files changed, 1867 insertions(+), 11 deletions(-) create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/gapic/__init__.py create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/proto/__init__.py create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py create mode 100644 videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py create mode 100644 videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py index 9e732b5800bd..9c89e385979c 100644 --- a/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py @@ -14,15 +14,18 @@ from __future__ import absolute_import -from google.cloud.gapic.videointelligence.v1beta1.video_intelligence_service_client import VideoIntelligenceServiceClient -from google.cloud.gapic.videointelligence.v1beta1 import enums - from google.cloud.videointelligence_v1beta1 import types +from google.cloud.videointelligence_v1beta1.gapic import enums +from google.cloud.videointelligence_v1beta1.gapic import video_intelligence_service_client + +class VideoIntelligenceServiceClient( + video_intelligence_service_client.VideoIntelligenceServiceClient): + __doc__ = video_intelligence_service_client.VideoIntelligenceServiceClient.__doc__ + enums = enums __all__ = ( 'enums', 'types', - 'VideoIntelligenceServiceClient', -) + 'VideoIntelligenceServiceClient', ) diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/gapic/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py new file mode 100644 index 000000000000..b44bb33c43ae --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py @@ -0,0 +1,87 @@ +# Copyright 2017, Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Wrappers for protocol buffer enum types.""" + + +class Feature(object): + """ + Video annotation feature. + + Attributes: + FEATURE_UNSPECIFIED (int): Unspecified. + LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. + FACE_DETECTION (int): Human face detection and tracking. + SHOT_CHANGE_DETECTION (int): Shot change detection. + SAFE_SEARCH_DETECTION (int): Safe search detection. + """ + FEATURE_UNSPECIFIED = 0 + LABEL_DETECTION = 1 + FACE_DETECTION = 2 + SHOT_CHANGE_DETECTION = 3 + SAFE_SEARCH_DETECTION = 4 + + +class LabelLevel(object): + """ + Label level (scope). + + Attributes: + LABEL_LEVEL_UNSPECIFIED (int): Unspecified. + VIDEO_LEVEL (int): Video-level. Corresponds to the whole video. + SEGMENT_LEVEL (int): Segment-level. Corresponds to one of ``AnnotateSpec.segments``. + SHOT_LEVEL (int): Shot-level. Corresponds to a single shot (i.e. a series of frames + without a major camera position or background change). + FRAME_LEVEL (int): Frame-level. Corresponds to a single video frame. + """ + LABEL_LEVEL_UNSPECIFIED = 0 + VIDEO_LEVEL = 1 + SEGMENT_LEVEL = 2 + SHOT_LEVEL = 3 + FRAME_LEVEL = 4 + + +class LabelDetectionMode(object): + """ + Label detection mode. + + Attributes: + LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. + SHOT_MODE (int): Detect shot-level labels. + FRAME_MODE (int): Detect frame-level labels. + SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. + """ + LABEL_DETECTION_MODE_UNSPECIFIED = 0 + SHOT_MODE = 1 + FRAME_MODE = 2 + SHOT_AND_FRAME_MODE = 3 + + +class Likelihood(object): + """ + Bucketized representation of likelihood. + + Attributes: + UNKNOWN (int): Unknown likelihood. + VERY_UNLIKELY (int): Very unlikely. + UNLIKELY (int): Unlikely. + POSSIBLE (int): Possible. + LIKELY (int): Likely. + VERY_LIKELY (int): Very likely. + """ + UNKNOWN = 0 + VERY_UNLIKELY = 1 + UNLIKELY = 2 + POSSIBLE = 3 + LIKELY = 4 + VERY_LIKELY = 5 diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py new file mode 100644 index 000000000000..63bd4d4ea7c4 --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py @@ -0,0 +1,225 @@ +# Copyright 2017, Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# EDITING INSTRUCTIONS +# This file was generated from the file +# https://github.com/google/googleapis/blob/master/google/cloud/videointelligence/v1beta1/video_intelligence.proto, +# and updates to that file get reflected here through a refresh process. +# For the short term, the refresh process will only be runnable by Google engineers. +# +# The only allowed edits are to method and file documentation. A 3-way +# merge preserves those additions if the generated source changes. +"""Accesses the google.cloud.videointelligence.v1beta1 VideoIntelligenceService API.""" + +import collections +import json +import os +import pkg_resources +import platform + +from google.gapic.longrunning import operations_client +from google.gax import api_callable +from google.gax import config +from google.gax import path_template +import google.gax + +from google.cloud.videointelligence_v1beta1.gapic import enums +from google.cloud.videointelligence_v1beta1.gapic import video_intelligence_service_client_config +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 + + +class VideoIntelligenceServiceClient(object): + """Service that implements Google Cloud Video Intelligence API.""" + + SERVICE_ADDRESS = 'videointelligence.googleapis.com' + """The default address of the service.""" + + DEFAULT_SERVICE_PORT = 443 + """The default port of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _ALL_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + def __init__(self, + channel=None, + credentials=None, + ssl_credentials=None, + scopes=None, + client_config=None, + lib_name=None, + lib_version='', + metrics_headers=()): + """Constructor. + + Args: + channel (~grpc.Channel): A ``Channel`` instance through + which to make calls. + credentials (~google.auth.credentials.Credentials): The authorization + credentials to attach to requests. These credentials identify this + application to the service. + ssl_credentials (~grpc.ChannelCredentials): A + ``ChannelCredentials`` instance for use with an SSL-enabled + channel. + scopes (Sequence[str]): A list of OAuth2 scopes to attach to requests. + client_config (dict): + A dictionary for call options for each method. See + :func:`google.gax.construct_settings` for the structure of + this data. Falls back to the default config if not specified + or the specified config is missing data points. + lib_name (str): The API library software used for calling + the service. (Unless you are writing an API client itself, + leave this as default.) + lib_version (str): The API library software version used + for calling the service. (Unless you are writing an API client + itself, leave this as default.) + metrics_headers (dict): A dictionary of values for tracking + client library metrics. Ultimately serializes to a string + (e.g. 'foo/1.2.3 bar/3.14.1'). This argument should be + considered private. + """ + # Unless the calling application specifically requested + # OAuth scopes, request everything. + if scopes is None: + scopes = self._ALL_SCOPES + + # Initialize an empty client config, if none is set. + if client_config is None: + client_config = {} + + # Initialize metrics_headers as an ordered dictionary + # (cuts down on cardinality of the resulting string slightly). + metrics_headers = collections.OrderedDict(metrics_headers) + metrics_headers['gl-python'] = platform.python_version() + + # The library may or may not be set, depending on what is + # calling this client. Newer client libraries set the library name + # and version. + if lib_name: + metrics_headers[lib_name] = lib_version + + # Finally, track the GAPIC package version. + metrics_headers['gapic'] = pkg_resources.get_distribution( + 'google-cloud-videointelligence', ).version + + # Load the configuration defaults. + defaults = api_callable.construct_settings( + 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', + video_intelligence_service_client_config.config, + client_config, + config.STATUS_CODE_NAMES, + metrics_headers=metrics_headers, ) + self.video_intelligence_service_stub = config.create_stub( + video_intelligence_pb2.VideoIntelligenceServiceStub, + channel=channel, + service_path=self.SERVICE_ADDRESS, + service_port=self.DEFAULT_SERVICE_PORT, + credentials=credentials, + scopes=scopes, + ssl_credentials=ssl_credentials) + + self.operations_client = operations_client.OperationsClient( + channel=channel, + credentials=credentials, + ssl_credentials=ssl_credentials, + scopes=scopes, + client_config=client_config, + metrics_headers=metrics_headers, ) + + self._annotate_video = api_callable.create_api_call( + self.video_intelligence_service_stub.AnnotateVideo, + settings=defaults['annotate_video']) + + # Service calls + def annotate_video(self, + input_uri, + features, + input_content=None, + video_context=None, + output_uri=None, + location_id=None, + options=None): + """ + Performs asynchronous video annotation. Progress and results can be + retrieved through the ``google.longrunning.Operations`` interface. + ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). + ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + Example: + >>> from google.cloud import videointelligence_v1beta1 + >>> from google.cloud.videointelligence_v1beta1 import enums + >>> + >>> client = videointelligence_v1beta1.VideoIntelligenceServiceClient() + >>> + >>> input_uri = '' + >>> features = [] + >>> + >>> response = client.annotate_video(input_uri, features) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + input_uri (str): Input video location. Currently, only + `Google Cloud Storage `_ URIs are + supported, which must be specified in the following format: + ``gs://bucket-id/object-id`` (other URI formats return + ``google.rpc.Code.INVALID_ARGUMENT``). For more information, see + `Request URIs `_. + A video URI may include wildcards in ``object-id``, and thus identify + multiple videos. Supported wildcards: '*' to match 0 or more characters; + '?' to match 1 character. If unset, the input video should be embedded + in the request as ``input_content``. If set, ``input_content`` should be unset. + features (list[~google.cloud.videointelligence_v1beta1.types.Feature]): Requested video annotation features. + input_content (str): The video data bytes. Encoding: base64. If unset, the input video(s) + should be specified via ``input_uri``. If set, ``input_uri`` should be unset. + video_context (Union[dict, ~google.cloud.videointelligence_v1beta1.types.VideoContext]): Additional video context and/or feature-specific parameters. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.videointelligence_v1beta1.types.VideoContext` + output_uri (str): Optional location where the output (in JSON format) should be stored. + Currently, only `Google Cloud Storage `_ + URIs are supported, which must be specified in the following format: + ``gs://bucket-id/object-id`` (other URI formats return + ``google.rpc.Code.INVALID_ARGUMENT``). For more information, see + `Request URIs `_. + location_id (str): Optional cloud region where annotation should take place. Supported cloud + regions: ``us-east1``, ``us-west1``, ``europe-west1``, ``asia-east1``. If no region + is specified, a region will be determined based on video file location. + options (~google.gax.CallOptions): Overrides the default + settings for this call, e.g, timeout, retries etc. + + Returns: + A :class:`~google.cloud.videointelligence_v1beta1.types._OperationFuture` instance. + + Raises: + :exc:`google.gax.errors.GaxError` if the RPC is aborted. + :exc:`ValueError` if the parameters are invalid. + """ + request = video_intelligence_pb2.AnnotateVideoRequest( + input_uri=input_uri, + features=features, + input_content=input_content, + video_context=video_context, + output_uri=output_uri, + location_id=location_id) + return google.gax._OperationFuture( + self._annotate_video(request, options), self.operations_client, + video_intelligence_pb2.AnnotateVideoResponse, + video_intelligence_pb2.AnnotateVideoProgress, options) diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py new file mode 100644 index 000000000000..1f9d656ca75e --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py @@ -0,0 +1,28 @@ +config = { + "interfaces": { + "google.cloud.videointelligence.v1beta1.VideoIntelligenceService": { + "retry_codes": { + "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 120000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 120000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnnotateVideo": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta1/proto/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py new file mode 100644 index 000000000000..12eb7e100a74 --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py @@ -0,0 +1,1361 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/videointelligence_v1beta1/proto/video_intelligence.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/videointelligence_v1beta1/proto/video_intelligence.proto', + package='google.cloud.videointelligence.v1beta1', + syntax='proto3', + serialized_pb=_b('\nEgoogle/cloud/videointelligence_v1beta1/proto/video_intelligence.proto\x12&google.cloud.videointelligence.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf9\x01\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\t\x12\x41\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32/.google.cloud.videointelligence.v1beta1.Feature\x12K\n\rvideo_context\x18\x03 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t\"\xd2\x02\n\x0cVideoContext\x12\x46\n\x08segments\x18\x01 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12X\n\x14label_detection_mode\x18\x02 \x01(\x0e\x32:.google.cloud.videointelligence.v1beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x03 \x01(\x08\x12\x1d\n\x15label_detection_model\x18\x04 \x01(\t\x12\x1c\n\x14\x66\x61\x63\x65_detection_model\x18\x05 \x01(\t\x12#\n\x1bshot_change_detection_model\x18\x06 \x01(\t\x12#\n\x1bsafe_search_detection_model\x18\x07 \x01(\t\"B\n\x0cVideoSegment\x12\x19\n\x11start_time_offset\x18\x01 \x01(\x03\x12\x17\n\x0f\x65nd_time_offset\x18\x02 \x01(\x03\"\xad\x01\n\rLabelLocation\x12\x45\n\x07segment\x18\x01 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x41\n\x05level\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.LabelLevel\"\x87\x01\n\x0fLabelAnnotation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12H\n\tlocations\x18\x03 \x03(\x0b\x32\x35.google.cloud.videointelligence.v1beta1.LabelLocation\"\xfd\x02\n\x14SafeSearchAnnotation\x12\x41\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x41\n\x05spoof\x18\x02 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07medical\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07violent\x18\x04 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12@\n\x04racy\x18\x05 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x13\n\x0btime_offset\x18\x06 \x01(\x03\"G\n\x0b\x42oundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\r\n\x05right\x18\x02 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x03 \x01(\x05\x12\x0b\n\x03top\x18\x04 \x01(\x05\"n\n\x0c\x46\x61\x63\x65Location\x12I\n\x0c\x62ounding_box\x18\x01 \x01(\x0b\x32\x33.google.cloud.videointelligence.v1beta1.BoundingBox\x12\x13\n\x0btime_offset\x18\x02 \x01(\x03\"\xb4\x01\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x11\n\tthumbnail\x18\x01 \x01(\t\x12\x46\n\x08segments\x18\x02 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12G\n\tlocations\x18\x03 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.FaceLocation\"\xa3\x03\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12R\n\x11label_annotations\x18\x02 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta1.LabelAnnotation\x12P\n\x10\x66\x61\x63\x65_annotations\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1beta1.FaceAnnotation\x12N\n\x10shot_annotations\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12]\n\x17safe_search_annotations\x18\x06 \x03(\x0b\x32<.google.cloud.videointelligence.v1beta1.SafeSearchAnnotation\x12!\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.Status\"s\n\x15\x41nnotateVideoResponse\x12Z\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1beta1.VideoAnnotationResults\"\xa7\x01\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"u\n\x15\x41nnotateVideoProgress\x12\\\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32?.google.cloud.videointelligence.v1beta1.VideoAnnotationProgress*\x81\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x02\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x03\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x04*n\n\nLabelLevel\x12\x1b\n\x17LABEL_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0bVIDEO_LEVEL\x10\x01\x12\x11\n\rSEGMENT_LEVEL\x10\x02\x12\x0e\n\nSHOT_LEVEL\x10\x03\x12\x0f\n\x0b\x46RAME_LEVEL\x10\x04*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xae\x01\n\x18VideoIntelligenceService\x12\x91\x01\n\rAnnotateVideo\x12<.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/videos:annotate:\x01*B\xcf\x01\n*com.google.cloud.videointelligence.v1beta1B\x1dVideoIntelligenceServiceProtoP\x01ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\xaa\x02&Google.Cloud.VideoIntelligence.V1Beta1b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,google_dot_rpc_dot_status__pb2.DESCRIPTOR,]) + +_FEATURE = _descriptor.EnumDescriptor( + name='Feature', + full_name='google.cloud.videointelligence.v1beta1.Feature', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='FEATURE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LABEL_DETECTION', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FACE_DETECTION', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SHOT_CHANGE_DETECTION', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SAFE_SEARCH_DETECTION', index=4, number=4, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2794, + serialized_end=2923, +) +_sym_db.RegisterEnumDescriptor(_FEATURE) + +Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) +_LABELLEVEL = _descriptor.EnumDescriptor( + name='LabelLevel', + full_name='google.cloud.videointelligence.v1beta1.LabelLevel', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='LABEL_LEVEL_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='VIDEO_LEVEL', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SEGMENT_LEVEL', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SHOT_LEVEL', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FRAME_LEVEL', index=4, number=4, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2925, + serialized_end=3035, +) +_sym_db.RegisterEnumDescriptor(_LABELLEVEL) + +LabelLevel = enum_type_wrapper.EnumTypeWrapper(_LABELLEVEL) +_LABELDETECTIONMODE = _descriptor.EnumDescriptor( + name='LabelDetectionMode', + full_name='google.cloud.videointelligence.v1beta1.LabelDetectionMode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='LABEL_DETECTION_MODE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SHOT_MODE', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FRAME_MODE', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SHOT_AND_FRAME_MODE', index=3, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=3037, + serialized_end=3151, +) +_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) + +LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) +_LIKELIHOOD = _descriptor.EnumDescriptor( + name='Likelihood', + full_name='google.cloud.videointelligence.v1beta1.Likelihood', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='VERY_UNLIKELY', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='UNLIKELY', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='POSSIBLE', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LIKELY', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='VERY_LIKELY', index=5, number=5, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=3153, + serialized_end=3254, +) +_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) + +Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) +FEATURE_UNSPECIFIED = 0 +LABEL_DETECTION = 1 +FACE_DETECTION = 2 +SHOT_CHANGE_DETECTION = 3 +SAFE_SEARCH_DETECTION = 4 +LABEL_LEVEL_UNSPECIFIED = 0 +VIDEO_LEVEL = 1 +SEGMENT_LEVEL = 2 +SHOT_LEVEL = 3 +FRAME_LEVEL = 4 +LABEL_DETECTION_MODE_UNSPECIFIED = 0 +SHOT_MODE = 1 +FRAME_MODE = 2 +SHOT_AND_FRAME_MODE = 3 +UNKNOWN = 0 +VERY_UNLIKELY = 1 +UNLIKELY = 2 +POSSIBLE = 3 +LIKELY = 4 +VERY_LIKELY = 5 + + + +_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( + name='AnnotateVideoRequest', + full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input_uri', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.input_uri', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='input_content', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.input_content', index=1, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='features', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.features', index=2, + number=2, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='video_context', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.video_context', index=3, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='output_uri', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.output_uri', index=4, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='location_id', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.location_id', index=5, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=239, + serialized_end=488, +) + + +_VIDEOCONTEXT = _descriptor.Descriptor( + name='VideoContext', + full_name='google.cloud.videointelligence.v1beta1.VideoContext', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='segments', full_name='google.cloud.videointelligence.v1beta1.VideoContext.segments', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='label_detection_mode', full_name='google.cloud.videointelligence.v1beta1.VideoContext.label_detection_mode', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stationary_camera', full_name='google.cloud.videointelligence.v1beta1.VideoContext.stationary_camera', index=2, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='label_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.label_detection_model', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='face_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.face_detection_model', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='shot_change_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.shot_change_detection_model', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='safe_search_detection_model', full_name='google.cloud.videointelligence.v1beta1.VideoContext.safe_search_detection_model', index=6, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=491, + serialized_end=829, +) + + +_VIDEOSEGMENT = _descriptor.Descriptor( + name='VideoSegment', + full_name='google.cloud.videointelligence.v1beta1.VideoSegment', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='start_time_offset', full_name='google.cloud.videointelligence.v1beta1.VideoSegment.start_time_offset', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='end_time_offset', full_name='google.cloud.videointelligence.v1beta1.VideoSegment.end_time_offset', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=831, + serialized_end=897, +) + + +_LABELLOCATION = _descriptor.Descriptor( + name='LabelLocation', + full_name='google.cloud.videointelligence.v1beta1.LabelLocation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='segment', full_name='google.cloud.videointelligence.v1beta1.LabelLocation.segment', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='confidence', full_name='google.cloud.videointelligence.v1beta1.LabelLocation.confidence', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='level', full_name='google.cloud.videointelligence.v1beta1.LabelLocation.level', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=900, + serialized_end=1073, +) + + +_LABELANNOTATION = _descriptor.Descriptor( + name='LabelAnnotation', + full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='description', full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation.description', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation.language_code', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='locations', full_name='google.cloud.videointelligence.v1beta1.LabelAnnotation.locations', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1076, + serialized_end=1211, +) + + +_SAFESEARCHANNOTATION = _descriptor.Descriptor( + name='SafeSearchAnnotation', + full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='adult', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.adult', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='spoof', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.spoof', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='medical', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.medical', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='violent', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.violent', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='racy', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.racy', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='time_offset', full_name='google.cloud.videointelligence.v1beta1.SafeSearchAnnotation.time_offset', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1214, + serialized_end=1595, +) + + +_BOUNDINGBOX = _descriptor.Descriptor( + name='BoundingBox', + full_name='google.cloud.videointelligence.v1beta1.BoundingBox', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='left', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.left', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='right', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.right', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='bottom', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.bottom', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='top', full_name='google.cloud.videointelligence.v1beta1.BoundingBox.top', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1597, + serialized_end=1668, +) + + +_FACELOCATION = _descriptor.Descriptor( + name='FaceLocation', + full_name='google.cloud.videointelligence.v1beta1.FaceLocation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='bounding_box', full_name='google.cloud.videointelligence.v1beta1.FaceLocation.bounding_box', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='time_offset', full_name='google.cloud.videointelligence.v1beta1.FaceLocation.time_offset', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1670, + serialized_end=1780, +) + + +_FACEANNOTATION = _descriptor.Descriptor( + name='FaceAnnotation', + full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='thumbnail', full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation.thumbnail', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='segments', full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation.segments', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='locations', full_name='google.cloud.videointelligence.v1beta1.FaceAnnotation.locations', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1783, + serialized_end=1963, +) + + +_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( + name='VideoAnnotationResults', + full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input_uri', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.input_uri', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='label_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.label_annotations', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='face_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.face_annotations', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='shot_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.shot_annotations', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='safe_search_annotations', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.safe_search_annotations', index=4, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='error', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationResults.error', index=5, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1966, + serialized_end=2385, +) + + +_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( + name='AnnotateVideoResponse', + full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='annotation_results', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoResponse.annotation_results', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2387, + serialized_end=2502, +) + + +_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( + name='VideoAnnotationProgress', + full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input_uri', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.input_uri', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='progress_percent', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.progress_percent', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='start_time', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.start_time', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='update_time', full_name='google.cloud.videointelligence.v1beta1.VideoAnnotationProgress.update_time', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2505, + serialized_end=2672, +) + + +_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( + name='AnnotateVideoProgress', + full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoProgress', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='annotation_progress', full_name='google.cloud.videointelligence.v1beta1.AnnotateVideoProgress.annotation_progress', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2674, + serialized_end=2791, +) + +_ANNOTATEVIDEOREQUEST.fields_by_name['features'].enum_type = _FEATURE +_ANNOTATEVIDEOREQUEST.fields_by_name['video_context'].message_type = _VIDEOCONTEXT +_VIDEOCONTEXT.fields_by_name['segments'].message_type = _VIDEOSEGMENT +_VIDEOCONTEXT.fields_by_name['label_detection_mode'].enum_type = _LABELDETECTIONMODE +_LABELLOCATION.fields_by_name['segment'].message_type = _VIDEOSEGMENT +_LABELLOCATION.fields_by_name['level'].enum_type = _LABELLEVEL +_LABELANNOTATION.fields_by_name['locations'].message_type = _LABELLOCATION +_SAFESEARCHANNOTATION.fields_by_name['adult'].enum_type = _LIKELIHOOD +_SAFESEARCHANNOTATION.fields_by_name['spoof'].enum_type = _LIKELIHOOD +_SAFESEARCHANNOTATION.fields_by_name['medical'].enum_type = _LIKELIHOOD +_SAFESEARCHANNOTATION.fields_by_name['violent'].enum_type = _LIKELIHOOD +_SAFESEARCHANNOTATION.fields_by_name['racy'].enum_type = _LIKELIHOOD +_FACELOCATION.fields_by_name['bounding_box'].message_type = _BOUNDINGBOX +_FACEANNOTATION.fields_by_name['segments'].message_type = _VIDEOSEGMENT +_FACEANNOTATION.fields_by_name['locations'].message_type = _FACELOCATION +_VIDEOANNOTATIONRESULTS.fields_by_name['label_annotations'].message_type = _LABELANNOTATION +_VIDEOANNOTATIONRESULTS.fields_by_name['face_annotations'].message_type = _FACEANNOTATION +_VIDEOANNOTATIONRESULTS.fields_by_name['shot_annotations'].message_type = _VIDEOSEGMENT +_VIDEOANNOTATIONRESULTS.fields_by_name['safe_search_annotations'].message_type = _SAFESEARCHANNOTATION +_VIDEOANNOTATIONRESULTS.fields_by_name['error'].message_type = google_dot_rpc_dot_status__pb2._STATUS +_ANNOTATEVIDEORESPONSE.fields_by_name['annotation_results'].message_type = _VIDEOANNOTATIONRESULTS +_VIDEOANNOTATIONPROGRESS.fields_by_name['start_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_VIDEOANNOTATIONPROGRESS.fields_by_name['update_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_ANNOTATEVIDEOPROGRESS.fields_by_name['annotation_progress'].message_type = _VIDEOANNOTATIONPROGRESS +DESCRIPTOR.message_types_by_name['AnnotateVideoRequest'] = _ANNOTATEVIDEOREQUEST +DESCRIPTOR.message_types_by_name['VideoContext'] = _VIDEOCONTEXT +DESCRIPTOR.message_types_by_name['VideoSegment'] = _VIDEOSEGMENT +DESCRIPTOR.message_types_by_name['LabelLocation'] = _LABELLOCATION +DESCRIPTOR.message_types_by_name['LabelAnnotation'] = _LABELANNOTATION +DESCRIPTOR.message_types_by_name['SafeSearchAnnotation'] = _SAFESEARCHANNOTATION +DESCRIPTOR.message_types_by_name['BoundingBox'] = _BOUNDINGBOX +DESCRIPTOR.message_types_by_name['FaceLocation'] = _FACELOCATION +DESCRIPTOR.message_types_by_name['FaceAnnotation'] = _FACEANNOTATION +DESCRIPTOR.message_types_by_name['VideoAnnotationResults'] = _VIDEOANNOTATIONRESULTS +DESCRIPTOR.message_types_by_name['AnnotateVideoResponse'] = _ANNOTATEVIDEORESPONSE +DESCRIPTOR.message_types_by_name['VideoAnnotationProgress'] = _VIDEOANNOTATIONPROGRESS +DESCRIPTOR.message_types_by_name['AnnotateVideoProgress'] = _ANNOTATEVIDEOPROGRESS +DESCRIPTOR.enum_types_by_name['Feature'] = _FEATURE +DESCRIPTOR.enum_types_by_name['LabelLevel'] = _LABELLEVEL +DESCRIPTOR.enum_types_by_name['LabelDetectionMode'] = _LABELDETECTIONMODE +DESCRIPTOR.enum_types_by_name['Likelihood'] = _LIKELIHOOD +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType('AnnotateVideoRequest', (_message.Message,), dict( + DESCRIPTOR = _ANNOTATEVIDEOREQUEST, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Video annotation request. + + + Attributes: + input_uri: + Input video location. Currently, only `Google Cloud Storage + `__ URIs are supported, + which must be specified in the following format: + ``gs://bucket-id/object-id`` (other URI formats return [google + .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT + ]). For more information, see `Request URIs + `__. A video URI may include + wildcards in ``object-id``, and thus identify multiple videos. + Supported wildcards: '\*' to match 0 or more characters; '?' + to match 1 character. If unset, the input video should be + embedded in the request as ``input_content``. If set, + ``input_content`` should be unset. + input_content: + The video data bytes. Encoding: base64. If unset, the input + video(s) should be specified via ``input_uri``. If set, + ``input_uri`` should be unset. + features: + Requested video annotation features. + video_context: + Additional video context and/or feature-specific parameters. + output_uri: + Optional location where the output (in JSON format) should be + stored. Currently, only `Google Cloud Storage + `__ URIs are supported, + which must be specified in the following format: + ``gs://bucket-id/object-id`` (other URI formats return [google + .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT + ]). For more information, see `Request URIs + `__. + location_id: + Optional cloud region where annotation should take place. + Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- + west1``, ``asia-east1``. If no region is specified, a region + will be determined based on video file location. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoRequest) + )) +_sym_db.RegisterMessage(AnnotateVideoRequest) + +VideoContext = _reflection.GeneratedProtocolMessageType('VideoContext', (_message.Message,), dict( + DESCRIPTOR = _VIDEOCONTEXT, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Video context and/or feature-specific parameters. + + + Attributes: + segments: + Video segments to annotate. The segments may overlap and are + not required to be contiguous or span the whole video. If + unspecified, each video is treated as a single segment. + label_detection_mode: + If label detection has been requested, what labels should be + detected in addition to video-level labels or segment-level + labels. If unspecified, defaults to ``SHOT_MODE``. + stationary_camera: + Whether the video has been shot from a stationary (i.e. non- + moving) camera. When set to true, might improve detection + accuracy for moving objects. + label_detection_model: + Model to use for label detection. Supported values: "latest" + and "stable" (the default). + face_detection_model: + Model to use for face detection. Supported values: "latest" + and "stable" (the default). + shot_change_detection_model: + Model to use for shot change detection. Supported values: + "latest" and "stable" (the default). + safe_search_detection_model: + Model to use for safe search detection. Supported values: + "latest" and "stable" (the default). + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoContext) + )) +_sym_db.RegisterMessage(VideoContext) + +VideoSegment = _reflection.GeneratedProtocolMessageType('VideoSegment', (_message.Message,), dict( + DESCRIPTOR = _VIDEOSEGMENT, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Video segment. + + + Attributes: + start_time_offset: + Start offset in microseconds (inclusive). Unset means 0. + end_time_offset: + End offset in microseconds (inclusive). Unset means 0. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoSegment) + )) +_sym_db.RegisterMessage(VideoSegment) + +LabelLocation = _reflection.GeneratedProtocolMessageType('LabelLocation', (_message.Message,), dict( + DESCRIPTOR = _LABELLOCATION, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Label location. + + + Attributes: + segment: + Video segment. Set to [-1, -1] for video-level labels. Set to + [timestamp, timestamp] for frame-level labels. Otherwise, + corresponds to one of ``AnnotateSpec.segments`` (if specified) + or to shot boundaries (if requested). + confidence: + Confidence that the label is accurate. Range: [0, 1]. + level: + Label level. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.LabelLocation) + )) +_sym_db.RegisterMessage(LabelLocation) + +LabelAnnotation = _reflection.GeneratedProtocolMessageType('LabelAnnotation', (_message.Message,), dict( + DESCRIPTOR = _LABELANNOTATION, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Label annotation. + + + Attributes: + description: + Textual description, e.g. ``Fixed-gear bicycle``. + language_code: + Language code for ``description`` in BCP-47 format. + locations: + Where the label was detected and with what confidence. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.LabelAnnotation) + )) +_sym_db.RegisterMessage(LabelAnnotation) + +SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType('SafeSearchAnnotation', (_message.Message,), dict( + DESCRIPTOR = _SAFESEARCHANNOTATION, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Safe search annotation (based on per-frame visual signals only). If no + unsafe content has been detected in a frame, no annotations are present + for that frame. If only some types of unsafe content have been detected + in a frame, the likelihood is set to ``UNKNOWN`` for all other types of + unsafe content. + + + Attributes: + adult: + Likelihood of adult content. + spoof: + Likelihood that an obvious modification was made to the + original version to make it appear funny or offensive. + medical: + Likelihood of medical content. + violent: + Likelihood of violent content. + racy: + Likelihood of racy content. + time_offset: + Video time offset in microseconds. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.SafeSearchAnnotation) + )) +_sym_db.RegisterMessage(SafeSearchAnnotation) + +BoundingBox = _reflection.GeneratedProtocolMessageType('BoundingBox', (_message.Message,), dict( + DESCRIPTOR = _BOUNDINGBOX, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Bounding box. + + + Attributes: + left: + Left X coordinate. + right: + Right X coordinate. + bottom: + Bottom Y coordinate. + top: + Top Y coordinate. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.BoundingBox) + )) +_sym_db.RegisterMessage(BoundingBox) + +FaceLocation = _reflection.GeneratedProtocolMessageType('FaceLocation', (_message.Message,), dict( + DESCRIPTOR = _FACELOCATION, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Face location. + + + Attributes: + bounding_box: + Bounding box in a frame. + time_offset: + Video time offset in microseconds. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.FaceLocation) + )) +_sym_db.RegisterMessage(FaceLocation) + +FaceAnnotation = _reflection.GeneratedProtocolMessageType('FaceAnnotation', (_message.Message,), dict( + DESCRIPTOR = _FACEANNOTATION, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Face annotation. + + + Attributes: + thumbnail: + Thumbnail of a representative face view (in JPEG format). + Encoding: base64. + segments: + All locations where a face was detected. Faces are detected + and tracked on a per-video basis (as opposed to across + multiple videos). + locations: + Face locations at one frame per second. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.FaceAnnotation) + )) +_sym_db.RegisterMessage(FaceAnnotation) + +VideoAnnotationResults = _reflection.GeneratedProtocolMessageType('VideoAnnotationResults', (_message.Message,), dict( + DESCRIPTOR = _VIDEOANNOTATIONRESULTS, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Annotation results for a single video. + + + Attributes: + input_uri: + Video file location in `Google Cloud Storage + `__. + label_annotations: + Label annotations. There is exactly one element for each + unique label. + face_annotations: + Face annotations. There is exactly one element for each unique + face. + shot_annotations: + Shot annotations. Each shot is represented as a video segment. + safe_search_annotations: + Safe search annotations. + error: + If set, indicates an error. Note that for a single + ``AnnotateVideoRequest`` some videos may succeed and some may + fail. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoAnnotationResults) + )) +_sym_db.RegisterMessage(VideoAnnotationResults) + +AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType('AnnotateVideoResponse', (_message.Message,), dict( + DESCRIPTOR = _ANNOTATEVIDEORESPONSE, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Video annotation response. Included in the ``response`` field of the + ``Operation`` returned by the ``GetOperation`` call of the + ``google::longrunning::Operations`` service. + + + Attributes: + annotation_results: + Annotation results for all videos specified in + ``AnnotateVideoRequest``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoResponse) + )) +_sym_db.RegisterMessage(AnnotateVideoResponse) + +VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType('VideoAnnotationProgress', (_message.Message,), dict( + DESCRIPTOR = _VIDEOANNOTATIONPROGRESS, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Annotation progress for a single video. + + + Attributes: + input_uri: + Video file location in `Google Cloud Storage + `__. + progress_percent: + Approximate percentage processed thus far. Guaranteed to be + 100 when fully processed. + start_time: + Time when the request was received. + update_time: + Time of the most recent update. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.VideoAnnotationProgress) + )) +_sym_db.RegisterMessage(VideoAnnotationProgress) + +AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType('AnnotateVideoProgress', (_message.Message,), dict( + DESCRIPTOR = _ANNOTATEVIDEOPROGRESS, + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' + , + __doc__ = """Video annotation progress. Included in the ``metadata`` field of the + ``Operation`` returned by the ``GetOperation`` call of the + ``google::longrunning::Operations`` service. + + + Attributes: + annotation_progress: + Progress metadata for all videos specified in + ``AnnotateVideoRequest``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoProgress) + )) +_sym_db.RegisterMessage(AnnotateVideoProgress) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n*com.google.cloud.videointelligence.v1beta1B\035VideoIntelligenceServiceProtoP\001ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\252\002&Google.Cloud.VideoIntelligence.V1Beta1')) + +_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( + name='VideoIntelligenceService', + full_name='google.cloud.videointelligence.v1beta1.VideoIntelligenceService', + file=DESCRIPTOR, + index=0, + options=None, + serialized_start=3257, + serialized_end=3431, + methods=[ + _descriptor.MethodDescriptor( + name='AnnotateVideo', + full_name='google.cloud.videointelligence.v1beta1.VideoIntelligenceService.AnnotateVideo', + index=0, + containing_service=None, + input_type=_ANNOTATEVIDEOREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\035\"\030/v1beta1/videos:annotate:\001*')), + ), +]) +_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) + +DESCRIPTOR.services_by_name['VideoIntelligenceService'] = _VIDEOINTELLIGENCESERVICE + +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class VideoIntelligenceServiceStub(object): + """Service that implements Google Cloud Video Intelligence API. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.AnnotateVideo = channel.unary_unary( + '/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo', + request_serializer=AnnotateVideoRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + + class VideoIntelligenceServiceServicer(object): + """Service that implements Google Cloud Video Intelligence API. + """ + + def AnnotateVideo(self, request, context): + """Performs asynchronous video annotation. Progress and results can be + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `AnnotateVideoProgress` (progress). + `Operation.response` contains `AnnotateVideoResponse` (results). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_VideoIntelligenceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'AnnotateVideo': grpc.unary_unary_rpc_method_handler( + servicer.AnnotateVideo, + request_deserializer=AnnotateVideoRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaVideoIntelligenceServiceServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Service that implements Google Cloud Video Intelligence API. + """ + def AnnotateVideo(self, request, context): + """Performs asynchronous video annotation. Progress and results can be + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `AnnotateVideoProgress` (progress). + `Operation.response` contains `AnnotateVideoResponse` (results). + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaVideoIntelligenceServiceStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Service that implements Google Cloud Video Intelligence API. + """ + def AnnotateVideo(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Performs asynchronous video annotation. Progress and results can be + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `AnnotateVideoProgress` (progress). + `Operation.response` contains `AnnotateVideoResponse` (results). + """ + raise NotImplementedError() + AnnotateVideo.future = None + + + def beta_create_VideoIntelligenceService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): AnnotateVideoRequest.FromString, + } + response_serializers = { + ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + } + method_implementations = { + ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): face_utilities.unary_unary_inline(servicer.AnnotateVideo), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_VideoIntelligenceService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): AnnotateVideoRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.videointelligence.v1beta1.VideoIntelligenceService', 'AnnotateVideo'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + } + cardinalities = { + 'AnnotateVideo': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py new file mode 100644 index 000000000000..9625085d430f --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py @@ -0,0 +1,50 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 + + +class VideoIntelligenceServiceStub(object): + """Service that implements Google Cloud Video Intelligence API. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.AnnotateVideo = channel.unary_unary( + '/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo', + request_serializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + +class VideoIntelligenceServiceServicer(object): + """Service that implements Google Cloud Video Intelligence API. + """ + + def AnnotateVideo(self, request, context): + """Performs asynchronous video annotation. Progress and results can be + retrieved through the `google.longrunning.Operations` interface. + `Operation.metadata` contains `AnnotateVideoProgress` (progress). + `Operation.response` contains `AnnotateVideoResponse` (results). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_VideoIntelligenceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'AnnotateVideo': grpc.unary_unary_rpc_method_handler( + servicer.AnnotateVideo, + request_deserializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/types.py b/videointelligence/google/cloud/videointelligence_v1beta1/types.py index bfc99c3ab24b..0c096fdfb931 100644 --- a/videointelligence/google/cloud/videointelligence_v1beta1/types.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/types.py @@ -15,15 +15,30 @@ from __future__ import absolute_import import sys -from google.cloud.proto.videointelligence.v1beta1 import video_intelligence_pb2 from google.gax.utils.messages import get_messages +from google.api import http_pb2 +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import descriptor_pb2 +from google.protobuf import empty_pb2 +from google.protobuf import timestamp_pb2 +from google.rpc import status_pb2 names = [] -for name, message in get_messages(video_intelligence_pb2).items(): - message.__module__ = 'google.cloud.videointelligence_v1beta1.types' - setattr(sys.modules[__name__], name, message) - names.append(name) - +for module in ( + http_pb2, + video_intelligence_pb2, + operations_pb2, + any_pb2, + descriptor_pb2, + empty_pb2, + timestamp_pb2, + status_pb2, ): + for name, message in get_messages(module).items(): + message.__module__ = 'google.cloud.videointelligence_v1beta1.types' + setattr(sys.modules[__name__], name, message) + names.append(name) __all__ = tuple(sorted(names)) diff --git a/videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py b/videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py new file mode 100644 index 000000000000..8d6855f59313 --- /dev/null +++ b/videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py @@ -0,0 +1,87 @@ +# Copyright 2017, Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Unit tests.""" + +import mock +import unittest + +from google.gax import errors +from google.rpc import status_pb2 + +from google.cloud import videointelligence_v1beta1 +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 +from google.longrunning import operations_pb2 + + +class CustomException(Exception): + pass + + +class TestVideoIntelligenceServiceClient(unittest.TestCase): + @mock.patch('google.gax.config.create_stub', spec=True) + def test_annotate_video(self, mock_create_stub): + # Mock gRPC layer + grpc_stub = mock.Mock() + mock_create_stub.return_value = grpc_stub + + client = videointelligence_v1beta1.VideoIntelligenceServiceClient() + + # Mock request + input_uri = 'inputUri1707300727' + features = [] + + # Mock response + expected_response = {} + expected_response = video_intelligence_pb2.AnnotateVideoResponse( + **expected_response) + operation = operations_pb2.Operation( + name='operations/test_annotate_video', done=True) + operation.response.Pack(expected_response) + grpc_stub.AnnotateVideo.return_value = operation + + response = client.annotate_video(input_uri, features) + self.assertEqual(expected_response, response.result()) + + grpc_stub.AnnotateVideo.assert_called_once() + args, kwargs = grpc_stub.AnnotateVideo.call_args + self.assertEqual(len(args), 2) + self.assertEqual(len(kwargs), 1) + self.assertIn('metadata', kwargs) + actual_request = args[0] + + expected_request = video_intelligence_pb2.AnnotateVideoRequest( + input_uri=input_uri, features=features) + self.assertEqual(expected_request, actual_request) + + @mock.patch('google.gax.config.create_stub', spec=True) + def test_annotate_video_exception(self, mock_create_stub): + # Mock gRPC layer + grpc_stub = mock.Mock() + mock_create_stub.return_value = grpc_stub + + client = videointelligence_v1beta1.VideoIntelligenceServiceClient() + + # Mock request + input_uri = 'inputUri1707300727' + features = [] + + # Mock exception response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_annotate_video_exception', done=True) + operation.error.CopyFrom(error) + grpc_stub.AnnotateVideo.return_value = operation + + response = client.annotate_video(input_uri, features) + self.assertEqual(error, response.exception())