-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-run 'synth.py' to create v1p2beta1 artifacts.
- Loading branch information
Showing
13 changed files
with
2,520 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Client for Cloud Video Intelligence API | ||
======================================= | ||
|
||
.. automodule:: google.cloud.videointelligence_v1p2beta1 | ||
:members: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Types for Cloud Video Intelligence API Client | ||
============================================= | ||
|
||
.. automodule:: google.cloud.videointelligence_v1p2beta1.types | ||
:members: |
34 changes: 34 additions & 0 deletions
34
videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2018 Google LLC | ||
# | ||
# 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 | ||
# | ||
# https://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. | ||
|
||
from __future__ import absolute_import | ||
|
||
from google.cloud.videointelligence_v1p2beta1 import types | ||
from google.cloud.videointelligence_v1p2beta1.gapic import enums | ||
from google.cloud.videointelligence_v1p2beta1.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', | ||
) |
Empty file.
74 changes: 74 additions & 0 deletions
74
videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/enums.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2018 Google LLC | ||
# | ||
# 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 | ||
# | ||
# https://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.""" | ||
|
||
import enum | ||
|
||
|
||
class Feature(enum.IntEnum): | ||
""" | ||
Video annotation feature. | ||
Attributes: | ||
FEATURE_UNSPECIFIED (int): Unspecified. | ||
LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. | ||
SHOT_CHANGE_DETECTION (int): Shot change detection. | ||
EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. | ||
TEXT_DETECTION (int): OCR text detection and tracking. | ||
OBJECT_TRACKING (int): Object detection and tracking. | ||
""" | ||
FEATURE_UNSPECIFIED = 0 | ||
LABEL_DETECTION = 1 | ||
SHOT_CHANGE_DETECTION = 2 | ||
EXPLICIT_CONTENT_DETECTION = 3 | ||
TEXT_DETECTION = 7 | ||
OBJECT_TRACKING = 9 | ||
|
||
|
||
class LabelDetectionMode(enum.IntEnum): | ||
""" | ||
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(enum.IntEnum): | ||
""" | ||
Bucketized representation of likelihood. | ||
Attributes: | ||
LIKELIHOOD_UNSPECIFIED (int): Unspecified likelihood. | ||
VERY_UNLIKELY (int): Very unlikely. | ||
UNLIKELY (int): Unlikely. | ||
POSSIBLE (int): Possible. | ||
LIKELY (int): Likely. | ||
VERY_LIKELY (int): Very likely. | ||
""" | ||
LIKELIHOOD_UNSPECIFIED = 0 | ||
VERY_UNLIKELY = 1 | ||
UNLIKELY = 2 | ||
POSSIBLE = 3 | ||
LIKELY = 4 | ||
VERY_LIKELY = 5 |
Empty file.
116 changes: 116 additions & 0 deletions
116
...videointelligence_v1p2beta1/gapic/transports/video_intelligence_service_grpc_transport.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2018 Google LLC | ||
# | ||
# 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 | ||
# | ||
# https://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. | ||
|
||
import google.api_core.grpc_helpers | ||
import google.api_core.operations_v1 | ||
|
||
from google.cloud.videointelligence_v1p2beta1.proto import video_intelligence_pb2_grpc | ||
|
||
|
||
class VideoIntelligenceServiceGrpcTransport(object): | ||
"""gRPC transport class providing stubs for | ||
google.cloud.videointelligence.v1p2beta1 VideoIntelligenceService API. | ||
The transport provides access to the raw gRPC stubs, | ||
which can be used to take advantage of advanced | ||
features of gRPC. | ||
""" | ||
# The scopes needed to make gRPC calls to all of the methods defined | ||
# in this service. | ||
_OAUTH_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) | ||
|
||
def __init__(self, | ||
channel=None, | ||
credentials=None, | ||
address='videointelligence.googleapis.com:443'): | ||
"""Instantiate the transport class. | ||
Args: | ||
channel (grpc.Channel): A ``Channel`` instance through | ||
which to make calls. This argument is mutually exclusive | ||
with ``credentials``; providing both will raise an exception. | ||
credentials (google.auth.credentials.Credentials): The | ||
authorization credentials to attach to requests. These | ||
credentials identify this application to the service. If none | ||
are specified, the client will attempt to ascertain the | ||
credentials from the environment. | ||
address (str): The address where the service is hosted. | ||
""" | ||
# If both `channel` and `credentials` are specified, raise an | ||
# exception (channels come with credentials baked in already). | ||
if channel is not None and credentials is not None: | ||
raise ValueError( | ||
'The `channel` and `credentials` arguments are mutually ' | ||
'exclusive.', ) | ||
|
||
# Create the channel. | ||
if channel is None: | ||
channel = self.create_channel( | ||
address=address, | ||
credentials=credentials, | ||
) | ||
|
||
# gRPC uses objects called "stubs" that are bound to the | ||
# channel and provide a basic method for each RPC. | ||
self._stubs = { | ||
'video_intelligence_service_stub': | ||
video_intelligence_pb2_grpc.VideoIntelligenceServiceStub(channel), | ||
} | ||
|
||
# Because this API includes a method that returns a | ||
# long-running operation (proto: google.longrunning.Operation), | ||
# instantiate an LRO client. | ||
self._operations_client = google.api_core.operations_v1.OperationsClient( | ||
channel) | ||
|
||
@classmethod | ||
def create_channel(cls, | ||
address='videointelligence.googleapis.com:443', | ||
credentials=None): | ||
"""Create and return a gRPC channel object. | ||
Args: | ||
address (str): The host for the channel to use. | ||
credentials (~.Credentials): The | ||
authorization credentials to attach to requests. These | ||
credentials identify this application to the service. If | ||
none are specified, the client will attempt to ascertain | ||
the credentials from the environment. | ||
Returns: | ||
grpc.Channel: A gRPC channel object. | ||
""" | ||
return google.api_core.grpc_helpers.create_channel( | ||
address, | ||
credentials=credentials, | ||
scopes=cls._OAUTH_SCOPES, | ||
) | ||
|
||
@property | ||
def annotate_video(self): | ||
"""Return the gRPC stub for {$apiMethod.name}. | ||
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). | ||
Returns: | ||
Callable: A callable which accepts the appropriate | ||
deserialized request object and returns a | ||
deserialized response object. | ||
""" | ||
return self._stubs['video_intelligence_service_stub'].AnnotateVideo |
Oops, something went wrong.