diff --git a/.kokoro/continuous/datalabeling.cfg b/.kokoro/continuous/datalabeling.cfg new file mode 100644 index 000000000000..a1c53b81884b --- /dev/null +++ b/.kokoro/continuous/datalabeling.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "PACKAGE" + value: "datalabeling" +} diff --git a/.kokoro/presubmit/datalabeling.cfg b/.kokoro/presubmit/datalabeling.cfg new file mode 100644 index 000000000000..a1c53b81884b --- /dev/null +++ b/.kokoro/presubmit/datalabeling.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "PACKAGE" + value: "datalabeling" +} diff --git a/.kokoro/release/datalabeling.cfg b/.kokoro/release/datalabeling.cfg new file mode 100644 index 000000000000..a1c53b81884b --- /dev/null +++ b/.kokoro/release/datalabeling.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "PACKAGE" + value: "datalabeling" +} diff --git a/datalabeling/.coveragerc b/datalabeling/.coveragerc new file mode 100644 index 000000000000..6b9ab9da4a1b --- /dev/null +++ b/datalabeling/.coveragerc @@ -0,0 +1,18 @@ +[run] +branch = True + +[report] +fail_under = 100 +show_missing = True +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ + # Ignore abstract methods + raise NotImplementedError +omit = + */gapic/*.py + */proto/*.py + */core/*.py + */site-packages/*.py \ No newline at end of file diff --git a/datalabeling/.flake8 b/datalabeling/.flake8 new file mode 100644 index 000000000000..61766fa84d02 --- /dev/null +++ b/datalabeling/.flake8 @@ -0,0 +1,13 @@ +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + *_pb2.py + + # Standard linting exemptions. + __pycache__, + .git, + *.pyc, + conf.py diff --git a/datalabeling/.gitignore b/datalabeling/.gitignore new file mode 100644 index 000000000000..9e3a5f25770c --- /dev/null +++ b/datalabeling/.gitignore @@ -0,0 +1 @@ +docs/_build \ No newline at end of file diff --git a/datalabeling/CHANGELOG.md b/datalabeling/CHANGELOG.md new file mode 100644 index 000000000000..9bedd76f876a --- /dev/null +++ b/datalabeling/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +[PyPI History][1] + +[1]: https://pypi.org/project/google-cloud-datalabeling/#history diff --git a/datalabeling/LICENSE b/datalabeling/LICENSE new file mode 100644 index 000000000000..a8ee855de2aa --- /dev/null +++ b/datalabeling/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/datalabeling/MANIFEST.in b/datalabeling/MANIFEST.in new file mode 100644 index 000000000000..9cbf175afe6b --- /dev/null +++ b/datalabeling/MANIFEST.in @@ -0,0 +1,5 @@ +include README.rst LICENSE +recursive-include google *.json *.proto +recursive-include tests * +global-exclude *.py[co] +global-exclude __pycache__ diff --git a/datalabeling/README.rst b/datalabeling/README.rst new file mode 100644 index 000000000000..e269d2e41360 --- /dev/null +++ b/datalabeling/README.rst @@ -0,0 +1,87 @@ +Python Client for Data Labeling API (`Beta`_) +============================================== + +`Data Labeling API`_: Public API for Google Cloud AI Data Labeling Service. + +- `Client Library Documentation`_ +- `Product Documentation`_ + +.. _Beta: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst +.. _Data Labeling API: https://cloud.google.com/datalabeling +.. _Client Library Documentation: https://googlecloudplatform.github.io/google-cloud-python/latest/datalabeling/usage.html +.. _Product Documentation: https://cloud.google.com/datalabeling + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. `Enable the Data Labeling API.`_ +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Enable the Data Labeling API.: https://cloud.google.com/datalabeling +.. _Setup Authentication.: https://googlecloudplatform.github.io/google-cloud-python/latest/core/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Supported Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Python >= 3.5 + + +Deprecated Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Python == 2.7. Python 2.7 support will be removed on January 1, 2020. + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + pip install virtualenv + virtualenv + source /bin/activate + /bin/pip install google-cloud-datalabeling + + +Windows +^^^^^^^ + +.. code-block:: console + + pip install virtualenv + virtualenv + \Scripts\activate + \Scripts\pip.exe install google-cloud-datalabeling + +Next Steps +~~~~~~~~~~ + +- Read the `Client Library Documentation`_ for Data Labeling API + API to see other available methods on the client. +- Read the `Data Labeling API Product documentation`_ to learn + more about the product and see How-to Guides. +- View this `repository’s main README`_ to see the full list of Cloud + APIs that we cover. + +.. _Data Labeling API Product documentation: https://cloud.google.com/datalabeling +.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst \ No newline at end of file diff --git a/datalabeling/docs/changelog.md b/datalabeling/docs/changelog.md new file mode 120000 index 000000000000..04c99a55caae --- /dev/null +++ b/datalabeling/docs/changelog.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/datalabeling/docs/conf.py b/datalabeling/docs/conf.py new file mode 100644 index 000000000000..9f8c4c67cb4b --- /dev/null +++ b/datalabeling/docs/conf.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +# +# google-cloud-datalabeling documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = ".rst" + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = "index" + +# General information about the project. +project = u"google-cloud-datalabeling" +copyright = u"2017, Google" +author = u"Google APIs" + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "sphinx_rtd_theme" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = [] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-cloud-datalabeling-doc" + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + #'preamble': '', + # Latex figure (float) alignment + #'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + master_doc, + "google-cloud-datalabeling.tex", + u"google-cloud-datalabeling Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + master_doc, + "google-cloud-datalabeling", + u"google-cloud-datalabeling Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + master_doc, + "google-cloud-datalabeling", + u"google-cloud-datalabeling Documentation", + author, + "google-cloud-datalabeling", + "GAPIC library for the {metadata.shortName} v1beta1 service", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), +} + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/datalabeling/docs/gapic/v1beta1/api.rst b/datalabeling/docs/gapic/v1beta1/api.rst new file mode 100644 index 000000000000..78258fac24c6 --- /dev/null +++ b/datalabeling/docs/gapic/v1beta1/api.rst @@ -0,0 +1,6 @@ +Client for Data Labeling API +============================ + +.. automodule:: google.cloud.datalabeling_v1beta1 + :members: + :inherited-members: \ No newline at end of file diff --git a/datalabeling/docs/gapic/v1beta1/types.rst b/datalabeling/docs/gapic/v1beta1/types.rst new file mode 100644 index 000000000000..07d64dc8da3b --- /dev/null +++ b/datalabeling/docs/gapic/v1beta1/types.rst @@ -0,0 +1,5 @@ +Types for Data Labeling API Client +================================== + +.. automodule:: google.cloud.datalabeling_v1beta1.types + :members: \ No newline at end of file diff --git a/datalabeling/docs/index.rst b/datalabeling/docs/index.rst new file mode 100644 index 000000000000..d409b6aef9f7 --- /dev/null +++ b/datalabeling/docs/index.rst @@ -0,0 +1,10 @@ +.. include:: /../bigquery_datatransfer/README.rst + +Api Reference +------------- +.. toctree:: + :maxdepth: 2 + + gapic/v1beta1/api + gapic/v1beta1/types + changelog diff --git a/datalabeling/google/__init__.py b/datalabeling/google/__init__.py new file mode 100644 index 000000000000..8fcc60e2b9c6 --- /dev/null +++ b/datalabeling/google/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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. + +try: + import pkg_resources + + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datalabeling/google/cloud/__init__.py b/datalabeling/google/cloud/__init__.py new file mode 100644 index 000000000000..8fcc60e2b9c6 --- /dev/null +++ b/datalabeling/google/cloud/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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. + +try: + import pkg_resources + + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datalabeling/google/cloud/datalabeling.py b/datalabeling/google/cloud/datalabeling.py new file mode 100644 index 000000000000..bfbc68927c58 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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.datalabeling_v1beta1 import DataLabelingServiceClient +from google.cloud.datalabeling_v1beta1 import enums +from google.cloud.datalabeling_v1beta1 import types + +__all__ = ("enums", "types", "DataLabelingServiceClient") diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/__init__.py new file mode 100644 index 000000000000..908930d63de2 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/__init__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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.datalabeling_v1beta1 import types +from google.cloud.datalabeling_v1beta1.gapic import data_labeling_service_client +from google.cloud.datalabeling_v1beta1.gapic import enums + + +class DataLabelingServiceClient(data_labeling_service_client.DataLabelingServiceClient): + __doc__ = data_labeling_service_client.DataLabelingServiceClient.__doc__ + enums = enums + + +__all__ = ("enums", "types", "DataLabelingServiceClient") diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py new file mode 100644 index 000000000000..edb9fac4cf0b --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py @@ -0,0 +1,2557 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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. +"""Accesses the google.cloud.datalabeling.v1beta1 DataLabelingService API.""" + +import functools +import pkg_resources +import warnings + +from google.oauth2 import service_account +import google.api_core.gapic_v1.client_info +import google.api_core.gapic_v1.config +import google.api_core.gapic_v1.method +import google.api_core.gapic_v1.routing_header +import google.api_core.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 +import google.api_core.page_iterator +import google.api_core.path_template +import google.api_core.protobuf_helpers +import grpc + +from google.cloud.datalabeling_v1beta1.gapic import data_labeling_service_client_config +from google.cloud.datalabeling_v1beta1.gapic import enums +from google.cloud.datalabeling_v1beta1.gapic.transports import ( + data_labeling_service_grpc_transport, +) +from google.cloud.datalabeling_v1beta1.proto import annotation_spec_set_pb2 +from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2 +from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2_grpc +from google.cloud.datalabeling_v1beta1.proto import dataset_pb2 +from google.cloud.datalabeling_v1beta1.proto import human_annotation_config_pb2 +from google.cloud.datalabeling_v1beta1.proto import instruction_pb2 +from google.cloud.datalabeling_v1beta1.proto import ( + operations_pb2 as proto_operations_pb2, +) +from google.longrunning import operations_pb2 as longrunning_operations_pb2 +from google.protobuf import empty_pb2 + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-datalabeling" +).version + + +class DataLabelingServiceClient(object): + SERVICE_ADDRESS = "datalabeling.googleapis.com:443" + """The default address of the service.""" + + # The name of the interface for this client. This is the key used to + # find the method configuration in the client_config dictionary. + _INTERFACE_NAME = "google.cloud.datalabeling.v1beta1.DataLabelingService" + + @classmethod + def from_service_account_file(cls, filename, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + DataLabelingServiceClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @classmethod + def project_path(cls, project): + """Return a fully-qualified project string.""" + return google.api_core.path_template.expand( + "projects/{project}", project=project + ) + + @classmethod + def annotation_spec_set_path(cls, project, annotation_spec_set): + """Return a fully-qualified annotation_spec_set string.""" + return google.api_core.path_template.expand( + "projects/{project}/annotationSpecSets/{annotation_spec_set}", + project=project, + annotation_spec_set=annotation_spec_set, + ) + + @classmethod + def dataset_path(cls, project, dataset): + """Return a fully-qualified dataset string.""" + return google.api_core.path_template.expand( + "projects/{project}/datasets/{dataset}", project=project, dataset=dataset + ) + + @classmethod + def annotated_dataset_path(cls, project, dataset, annotated_dataset): + """Return a fully-qualified annotated_dataset string.""" + return google.api_core.path_template.expand( + "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}", + project=project, + dataset=dataset, + annotated_dataset=annotated_dataset, + ) + + @classmethod + def example_path(cls, project, dataset, annotated_dataset, example): + """Return a fully-qualified example string.""" + return google.api_core.path_template.expand( + "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}", + project=project, + dataset=dataset, + annotated_dataset=annotated_dataset, + example=example, + ) + + @classmethod + def data_item_path(cls, project, dataset, data_item): + """Return a fully-qualified data_item string.""" + return google.api_core.path_template.expand( + "projects/{project}/datasets/{dataset}/dataItems/{data_item}", + project=project, + dataset=dataset, + data_item=data_item, + ) + + @classmethod + def instruction_path(cls, project, instruction): + """Return a fully-qualified instruction string.""" + return google.api_core.path_template.expand( + "projects/{project}/instructions/{instruction}", + project=project, + instruction=instruction, + ) + + def __init__( + self, + transport=None, + channel=None, + credentials=None, + client_config=None, + client_info=None, + ): + """Constructor. + + Args: + transport (Union[~.DataLabelingServiceGrpcTransport, + Callable[[~.Credentials, type], ~.DataLabelingServiceGrpcTransport]): A transport + instance, responsible for actually making the API calls. + The default transport uses the gRPC protocol. + This argument may also be a callable which returns a + transport instance. Callables will be sent the credentials + as the first argument and the default transport class as + the second argument. + channel (grpc.Channel): DEPRECATED. 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. + This argument is mutually exclusive with providing a + transport instance to ``transport``; doing so will raise + an exception. + client_config (dict): DEPRECATED. A dictionary of call options for + each method. If not specified, the default configuration is used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + """ + # Raise deprecation warnings for things we want to go away. + if client_config is not None: + warnings.warn( + "The `client_config` argument is deprecated.", + PendingDeprecationWarning, + stacklevel=2, + ) + else: + client_config = data_labeling_service_client_config.config + + if channel: + warnings.warn( + "The `channel` argument is deprecated; use " "`transport` instead.", + PendingDeprecationWarning, + stacklevel=2, + ) + + # Instantiate the transport. + # The transport is responsible for handling serialization and + # deserialization and actually sending data to the service. + if transport: + if callable(transport): + self.transport = transport( + credentials=credentials, + default_class=data_labeling_service_grpc_transport.DataLabelingServiceGrpcTransport, + ) + else: + if credentials: + raise ValueError( + "Received both a transport instance and " + "credentials; these are mutually exclusive." + ) + self.transport = transport + else: + self.transport = data_labeling_service_grpc_transport.DataLabelingServiceGrpcTransport( + address=self.SERVICE_ADDRESS, channel=channel, credentials=credentials + ) + + if client_info is None: + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + self._client_info = client_info + + # Parse out the default settings for retry and timeout for each RPC + # from the client configuration. + # (Ordinarily, these are the defaults specified in the `*_config.py` + # file next to this one.) + self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config["interfaces"][self._INTERFACE_NAME] + ) + + # Save a dictionary of cached API call functions. + # These are the actual callables which invoke the proper + # transport methods, wrapped with `wrap_method` to add retry, + # timeout, and the like. + self._inner_api_calls = {} + + # Service calls + def create_dataset( + self, + parent, + dataset, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Creates dataset. If success return a Dataset resource. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # TODO: Initialize `dataset`: + >>> dataset = {} + >>> + >>> response = client.create_dataset(parent, dataset) + + Args: + parent (str): Required. Dataset resource parent, format: projects/{project\_id} + dataset (Union[dict, ~google.cloud.datalabeling_v1beta1.types.Dataset]): Required. The dataset to be created. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "create_dataset" not in self._inner_api_calls: + self._inner_api_calls[ + "create_dataset" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_dataset, + default_retry=self._method_configs["CreateDataset"].retry, + default_timeout=self._method_configs["CreateDataset"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.CreateDatasetRequest( + parent=parent, dataset=dataset + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_dataset"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_dataset( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets dataset by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> response = client.get_dataset(name) + + Args: + name (str): Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_dataset" not in self._inner_api_calls: + self._inner_api_calls[ + "get_dataset" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_dataset, + default_retry=self._method_configs["GetDataset"].retry, + default_timeout=self._method_configs["GetDataset"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.GetDatasetRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_dataset"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_datasets( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists datasets under a project. Pagination is supported. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # Iterate over all results + >>> for element in client.list_datasets(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_datasets(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Dataset resource parent, format: projects/{project\_id} + filter_ (str): Optional. Filter on dataset is not supported at this moment. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_datasets" not in self._inner_api_calls: + self._inner_api_calls[ + "list_datasets" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_datasets, + default_retry=self._method_configs["ListDatasets"].retry, + default_timeout=self._method_configs["ListDatasets"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ListDatasetsRequest( + parent=parent, filter=filter_, page_size=page_size + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_datasets"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="datasets", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def delete_dataset( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes a dataset by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> client.delete_dataset(name) + + Args: + name (str): Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_dataset" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_dataset" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_dataset, + default_retry=self._method_configs["DeleteDataset"].retry, + default_timeout=self._method_configs["DeleteDataset"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.DeleteDatasetRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_dataset"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def import_data( + self, + name, + input_config, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Imports data into dataset based on source locations defined in request. + It can be called multiple times for the same dataset. Each dataset can + only have one long running operation running on it. For example, no + labeling task (also long running operation) can be started while + importing is still ongoing. Vice versa. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # TODO: Initialize `input_config`: + >>> input_config = {} + >>> + >>> response = client.import_data(name, input_config) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + name (str): Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + input_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.InputConfig]): Required. Specify the input source of the data. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.InputConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "import_data" not in self._inner_api_calls: + self._inner_api_calls[ + "import_data" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.import_data, + default_retry=self._method_configs["ImportData"].retry, + default_timeout=self._method_configs["ImportData"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ImportDataRequest( + name=name, input_config=input_config + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["import_data"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + proto_operations_pb2.ImportDataOperationResponse, + metadata_type=proto_operations_pb2.ImportDataOperationMetadata, + ) + + def export_data( + self, + name, + annotated_dataset, + output_config, + filter_=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Exports data and annotations from dataset. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # TODO: Initialize `annotated_dataset`: + >>> annotated_dataset = '' + >>> + >>> # TODO: Initialize `output_config`: + >>> output_config = {} + >>> + >>> response = client.export_data(name, annotated_dataset, output_config) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + name (str): Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + annotated_dataset (str): Required. Annotated dataset resource name. DataItem in Dataset and their + annotations in specified annotated dataset will be exported. It's in + format of + projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id} + output_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.OutputConfig]): Required. Specify the output destination. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.OutputConfig` + filter_ (str): Optional. Filter is not supported at this moment. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "export_data" not in self._inner_api_calls: + self._inner_api_calls[ + "export_data" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.export_data, + default_retry=self._method_configs["ExportData"].retry, + default_timeout=self._method_configs["ExportData"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ExportDataRequest( + name=name, + annotated_dataset=annotated_dataset, + output_config=output_config, + filter=filter_, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["export_data"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + proto_operations_pb2.ExportDataOperationResponse, + metadata_type=proto_operations_pb2.ExportDataOperationMetadata, + ) + + def get_data_item( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets a data item in a dataset by resource name. This API can be + called after data are imported into dataset. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.data_item_path('[PROJECT]', '[DATASET]', '[DATA_ITEM]') + >>> + >>> response = client.get_data_item(name) + + Args: + name (str): Required. The name of the data item to get, format: + projects/{project\_id}/datasets/{dataset\_id}/dataItems/{data\_item\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.DataItem` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_data_item" not in self._inner_api_calls: + self._inner_api_calls[ + "get_data_item" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_data_item, + default_retry=self._method_configs["GetDataItem"].retry, + default_timeout=self._method_configs["GetDataItem"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.GetDataItemRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_data_item"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_data_items( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists data items in a dataset. This API can be called after data + are imported into dataset. Pagination is supported. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # Iterate over all results + >>> for element in client.list_data_items(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_data_items(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Name of the dataset to list data items, format: + projects/{project\_id}/datasets/{dataset\_id} + filter_ (str): Optional. Filter is not supported at this moment. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.datalabeling_v1beta1.types.DataItem` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_data_items" not in self._inner_api_calls: + self._inner_api_calls[ + "list_data_items" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_data_items, + default_retry=self._method_configs["ListDataItems"].retry, + default_timeout=self._method_configs["ListDataItems"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ListDataItemsRequest( + parent=parent, filter=filter_, page_size=page_size + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_data_items"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="data_items", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def get_annotated_dataset( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets an annotated dataset by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.annotated_dataset_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]') + >>> + >>> response = client.get_annotated_dataset(name) + + Args: + name (str): Required. Name of the annotated dataset to get, format: + projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.AnnotatedDataset` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_annotated_dataset" not in self._inner_api_calls: + self._inner_api_calls[ + "get_annotated_dataset" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_annotated_dataset, + default_retry=self._method_configs["GetAnnotatedDataset"].retry, + default_timeout=self._method_configs["GetAnnotatedDataset"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.GetAnnotatedDatasetRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_annotated_dataset"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_annotated_datasets( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists annotated datasets for a dataset. Pagination is supported. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # Iterate over all results + >>> for element in client.list_annotated_datasets(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_annotated_datasets(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Name of the dataset to list annotated datasets, format: + projects/{project\_id}/datasets/{dataset\_id} + filter_ (str): Optional. Filter is not supported at this moment. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.datalabeling_v1beta1.types.AnnotatedDataset` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_annotated_datasets" not in self._inner_api_calls: + self._inner_api_calls[ + "list_annotated_datasets" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_annotated_datasets, + default_retry=self._method_configs["ListAnnotatedDatasets"].retry, + default_timeout=self._method_configs["ListAnnotatedDatasets"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ListAnnotatedDatasetsRequest( + parent=parent, filter=filter_, page_size=page_size + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_annotated_datasets"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="annotated_datasets", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def label_image( + self, + parent, + basic_config, + feature, + image_classification_config=None, + bounding_poly_config=None, + polyline_config=None, + segmentation_config=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Starts a labeling task for image. The type of image labeling task is + configured by feature in the request. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> from google.cloud.datalabeling_v1beta1 import enums + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # TODO: Initialize `basic_config`: + >>> basic_config = {} + >>> + >>> # TODO: Initialize `feature`: + >>> feature = enums.LabelImageRequest.Feature.FEATURE_UNSPECIFIED + >>> + >>> response = client.label_image(parent, basic_config, feature) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. Name of the dataset to request labeling task, format: + projects/{project\_id}/datasets/{dataset\_id} + basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` + feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of image labeling task. + image_classification_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.ImageClassificationConfig]): Configuration for image classification task. One of + image\_classification\_config, bounding\_poly\_config, polyline\_config + and segmentation\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.ImageClassificationConfig` + bounding_poly_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.BoundingPolyConfig]): Configuration for bounding box and bounding poly task. One of + image\_classification\_config, bounding\_poly\_config, polyline\_config + and segmentation\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.BoundingPolyConfig` + polyline_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.PolylineConfig]): Configuration for polyline task. One of image\_classification\_config, + bounding\_poly\_config, polyline\_config and segmentation\_config is + required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.PolylineConfig` + segmentation_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.SegmentationConfig]): Configuration for segmentation task. One of + image\_classification\_config, bounding\_poly\_config, polyline\_config + and segmentation\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.SegmentationConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "label_image" not in self._inner_api_calls: + self._inner_api_calls[ + "label_image" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.label_image, + default_retry=self._method_configs["LabelImage"].retry, + default_timeout=self._method_configs["LabelImage"].timeout, + client_info=self._client_info, + ) + + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof( + image_classification_config=image_classification_config, + bounding_poly_config=bounding_poly_config, + polyline_config=polyline_config, + segmentation_config=segmentation_config, + ) + + request = data_labeling_service_pb2.LabelImageRequest( + parent=parent, + basic_config=basic_config, + feature=feature, + image_classification_config=image_classification_config, + bounding_poly_config=bounding_poly_config, + polyline_config=polyline_config, + segmentation_config=segmentation_config, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["label_image"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + dataset_pb2.AnnotatedDataset, + metadata_type=proto_operations_pb2.LabelOperationMetadata, + ) + + def label_video( + self, + parent, + basic_config, + feature, + video_classification_config=None, + object_detection_config=None, + object_tracking_config=None, + event_config=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Starts a labeling task for video. The type of video labeling task is + configured by feature in the request. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> from google.cloud.datalabeling_v1beta1 import enums + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # TODO: Initialize `basic_config`: + >>> basic_config = {} + >>> + >>> # TODO: Initialize `feature`: + >>> feature = enums.LabelVideoRequest.Feature.FEATURE_UNSPECIFIED + >>> + >>> response = client.label_video(parent, basic_config, feature) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. Name of the dataset to request labeling task, format: + projects/{project\_id}/datasets/{dataset\_id} + basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` + feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of video labeling task. + video_classification_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.VideoClassificationConfig]): Configuration for video classification task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.VideoClassificationConfig` + object_detection_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.ObjectDetectionConfig]): Configuration for video object detection task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.ObjectDetectionConfig` + object_tracking_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.ObjectTrackingConfig]): Configuration for video object tracking task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.ObjectTrackingConfig` + event_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.EventConfig]): Configuration for video event task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.EventConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "label_video" not in self._inner_api_calls: + self._inner_api_calls[ + "label_video" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.label_video, + default_retry=self._method_configs["LabelVideo"].retry, + default_timeout=self._method_configs["LabelVideo"].timeout, + client_info=self._client_info, + ) + + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof( + video_classification_config=video_classification_config, + object_detection_config=object_detection_config, + object_tracking_config=object_tracking_config, + event_config=event_config, + ) + + request = data_labeling_service_pb2.LabelVideoRequest( + parent=parent, + basic_config=basic_config, + feature=feature, + video_classification_config=video_classification_config, + object_detection_config=object_detection_config, + object_tracking_config=object_tracking_config, + event_config=event_config, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["label_video"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + dataset_pb2.AnnotatedDataset, + metadata_type=proto_operations_pb2.LabelOperationMetadata, + ) + + def label_text( + self, + parent, + basic_config, + feature, + text_classification_config=None, + text_entity_extraction_config=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Starts a labeling task for text. The type of text labeling task is + configured by feature in the request. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> from google.cloud.datalabeling_v1beta1 import enums + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # TODO: Initialize `basic_config`: + >>> basic_config = {} + >>> + >>> # TODO: Initialize `feature`: + >>> feature = enums.LabelTextRequest.Feature.FEATURE_UNSPECIFIED + >>> + >>> response = client.label_text(parent, basic_config, feature) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. Name of the data set to request labeling task, format: + projects/{project\_id}/datasets/{dataset\_id} + basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` + feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of text labeling task. + text_classification_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.TextClassificationConfig]): Configuration for text classification task. One of + text\_classification\_config and text\_entity\_extraction\_config is + required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.TextClassificationConfig` + text_entity_extraction_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.TextEntityExtractionConfig]): Configuration for entity extraction task. One of + text\_classification\_config and text\_entity\_extraction\_config is + required. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.TextEntityExtractionConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "label_text" not in self._inner_api_calls: + self._inner_api_calls[ + "label_text" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.label_text, + default_retry=self._method_configs["LabelText"].retry, + default_timeout=self._method_configs["LabelText"].timeout, + client_info=self._client_info, + ) + + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof( + text_classification_config=text_classification_config, + text_entity_extraction_config=text_entity_extraction_config, + ) + + request = data_labeling_service_pb2.LabelTextRequest( + parent=parent, + basic_config=basic_config, + feature=feature, + text_classification_config=text_classification_config, + text_entity_extraction_config=text_entity_extraction_config, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["label_text"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + dataset_pb2.AnnotatedDataset, + metadata_type=proto_operations_pb2.LabelOperationMetadata, + ) + + def label_audio( + self, + parent, + basic_config, + feature, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Starts a labeling task for audio. The type of audio labeling task is + configured by feature in the request. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> from google.cloud.datalabeling_v1beta1 import enums + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') + >>> + >>> # TODO: Initialize `basic_config`: + >>> basic_config = {} + >>> + >>> # TODO: Initialize `feature`: + >>> feature = enums.LabelAudioRequest.Feature.FEATURE_UNSPECIFIED + >>> + >>> response = client.label_audio(parent, basic_config, feature) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. Name of the dataset to request labeling task, format: + projects/{project\_id}/datasets/{dataset\_id} + basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` + feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of audio labeling task. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "label_audio" not in self._inner_api_calls: + self._inner_api_calls[ + "label_audio" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.label_audio, + default_retry=self._method_configs["LabelAudio"].retry, + default_timeout=self._method_configs["LabelAudio"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.LabelAudioRequest( + parent=parent, basic_config=basic_config, feature=feature + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["label_audio"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + dataset_pb2.AnnotatedDataset, + metadata_type=proto_operations_pb2.LabelOperationMetadata, + ) + + def get_example( + self, + name, + filter_=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets an example by resource name, including both data and annotation. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.example_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]', '[EXAMPLE]') + >>> + >>> response = client.get_example(name) + + Args: + name (str): Required. Name of example, format: + projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id}/examples/{example\_id} + filter_ (str): Optional. An expression for filtering Examples. Filter by + annotation\_spec.display\_name is supported. Format + "annotation\_spec.display\_name = {display\_name}" + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.Example` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_example" not in self._inner_api_calls: + self._inner_api_calls[ + "get_example" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_example, + default_retry=self._method_configs["GetExample"].retry, + default_timeout=self._method_configs["GetExample"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.GetExampleRequest(name=name, filter=filter_) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_example"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_examples( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists examples in an annotated dataset. Pagination is supported. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.annotated_dataset_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]') + >>> + >>> # Iterate over all results + >>> for element in client.list_examples(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_examples(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Example resource parent. + filter_ (str): Optional. An expression for filtering Examples. For annotated datasets + that have annotation spec set, filter by annotation\_spec.display\_name + is supported. Format "annotation\_spec.display\_name = {display\_name}" + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Example` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_examples" not in self._inner_api_calls: + self._inner_api_calls[ + "list_examples" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_examples, + default_retry=self._method_configs["ListExamples"].retry, + default_timeout=self._method_configs["ListExamples"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ListExamplesRequest( + parent=parent, filter=filter_, page_size=page_size + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_examples"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="examples", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def create_annotation_spec_set( + self, + parent, + annotation_spec_set, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Creates an annotation spec set by providing a set of labels. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # TODO: Initialize `annotation_spec_set`: + >>> annotation_spec_set = {} + >>> + >>> response = client.create_annotation_spec_set(parent, annotation_spec_set) + + Args: + parent (str): Required. AnnotationSpecSet resource parent, format: + projects/{project\_id} + annotation_spec_set (Union[dict, ~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet]): Required. Annotation spec set to create. Annotation specs must be + included. Only one annotation spec will be accepted for annotation specs + with same display\_name. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "create_annotation_spec_set" not in self._inner_api_calls: + self._inner_api_calls[ + "create_annotation_spec_set" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_annotation_spec_set, + default_retry=self._method_configs["CreateAnnotationSpecSet"].retry, + default_timeout=self._method_configs["CreateAnnotationSpecSet"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.CreateAnnotationSpecSetRequest( + parent=parent, annotation_spec_set=annotation_spec_set + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_annotation_spec_set"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_annotation_spec_set( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets an annotation spec set by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.annotation_spec_set_path('[PROJECT]', '[ANNOTATION_SPEC_SET]') + >>> + >>> response = client.get_annotation_spec_set(name) + + Args: + name (str): Required. AnnotationSpecSet resource name, format: + projects/{project\_id}/annotationSpecSets/{annotation\_spec\_set\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_annotation_spec_set" not in self._inner_api_calls: + self._inner_api_calls[ + "get_annotation_spec_set" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_annotation_spec_set, + default_retry=self._method_configs["GetAnnotationSpecSet"].retry, + default_timeout=self._method_configs["GetAnnotationSpecSet"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.GetAnnotationSpecSetRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_annotation_spec_set"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_annotation_spec_sets( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists annotation spec sets for a project. Pagination is supported. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # Iterate over all results + >>> for element in client.list_annotation_spec_sets(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_annotation_spec_sets(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Parent of AnnotationSpecSet resource, format: + projects/{project\_id} + filter_ (str): Optional. Filter is not supported at this moment. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_annotation_spec_sets" not in self._inner_api_calls: + self._inner_api_calls[ + "list_annotation_spec_sets" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_annotation_spec_sets, + default_retry=self._method_configs["ListAnnotationSpecSets"].retry, + default_timeout=self._method_configs["ListAnnotationSpecSets"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ListAnnotationSpecSetsRequest( + parent=parent, filter=filter_, page_size=page_size + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_annotation_spec_sets"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="annotation_spec_sets", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def delete_annotation_spec_set( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes an annotation spec set by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.annotation_spec_set_path('[PROJECT]', '[ANNOTATION_SPEC_SET]') + >>> + >>> client.delete_annotation_spec_set(name) + + Args: + name (str): Required. AnnotationSpec resource name, format: + ``projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_annotation_spec_set" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_annotation_spec_set" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_annotation_spec_set, + default_retry=self._method_configs["DeleteAnnotationSpecSet"].retry, + default_timeout=self._method_configs["DeleteAnnotationSpecSet"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.DeleteAnnotationSpecSetRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_annotation_spec_set"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def create_instruction( + self, + parent, + instruction, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Creates an instruction for how data should be labeled. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # TODO: Initialize `instruction`: + >>> instruction = {} + >>> + >>> response = client.create_instruction(parent, instruction) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. Instruction resource parent, format: projects/{project\_id} + instruction (Union[dict, ~google.cloud.datalabeling_v1beta1.types.Instruction]): Required. Instruction of how to perform the labeling task. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datalabeling_v1beta1.types.Instruction` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "create_instruction" not in self._inner_api_calls: + self._inner_api_calls[ + "create_instruction" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_instruction, + default_retry=self._method_configs["CreateInstruction"].retry, + default_timeout=self._method_configs["CreateInstruction"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.CreateInstructionRequest( + parent=parent, instruction=instruction + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["create_instruction"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + instruction_pb2.Instruction, + metadata_type=proto_operations_pb2.CreateInstructionMetadata, + ) + + def get_instruction( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets an instruction by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.instruction_path('[PROJECT]', '[INSTRUCTION]') + >>> + >>> response = client.get_instruction(name) + + Args: + name (str): Required. Instruction resource name, format: + projects/{project\_id}/instructions/{instruction\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datalabeling_v1beta1.types.Instruction` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_instruction" not in self._inner_api_calls: + self._inner_api_calls[ + "get_instruction" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_instruction, + default_retry=self._method_configs["GetInstruction"].retry, + default_timeout=self._method_configs["GetInstruction"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.GetInstructionRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_instruction"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_instructions( + self, + parent, + filter_=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists instructions for a project. Pagination is supported. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> # Iterate over all results + >>> for element in client.list_instructions(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_instructions(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Instruction resource parent, format: projects/{project\_id} + filter_ (str): Optional. Filter is not supported at this moment. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Instruction` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_instructions" not in self._inner_api_calls: + self._inner_api_calls[ + "list_instructions" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_instructions, + default_retry=self._method_configs["ListInstructions"].retry, + default_timeout=self._method_configs["ListInstructions"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.ListInstructionsRequest( + parent=parent, filter=filter_, page_size=page_size + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_instructions"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="instructions", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + + def delete_instruction( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes an instruction object by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> name = client.instruction_path('[PROJECT]', '[INSTRUCTION]') + >>> + >>> client.delete_instruction(name) + + Args: + name (str): Required. Instruction resource name, format: + projects/{project\_id}/instructions/{instruction\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_instruction" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_instruction" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_instruction, + default_retry=self._method_configs["DeleteInstruction"].retry, + default_timeout=self._method_configs["DeleteInstruction"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.DeleteInstructionRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_instruction"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_annotated_dataset( + self, + name=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes an annotated dataset by resource name. + + Example: + >>> from google.cloud import datalabeling_v1beta1 + >>> + >>> client = datalabeling_v1beta1.DataLabelingServiceClient() + >>> + >>> client.delete_annotated_dataset() + + Args: + name (str): Required. Name of the annotated dataset to delete, format: + projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id} + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_annotated_dataset" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_annotated_dataset" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_annotated_dataset, + default_retry=self._method_configs["DeleteAnnotatedDataset"].retry, + default_timeout=self._method_configs["DeleteAnnotatedDataset"].timeout, + client_info=self._client_info, + ) + + request = data_labeling_service_pb2.DeleteAnnotatedDatasetRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_annotated_dataset"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py new file mode 100644 index 000000000000..4345a5f17ad5 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py @@ -0,0 +1,148 @@ +config = { + "interfaces": { + "google.cloud.datalabeling.v1beta1.DataLabelingService": { + "retry_codes": { + "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "non_idempotent": [], + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 300000, + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "DeleteDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ImportData": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "ExportData": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "GetDataItem": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListDataItems": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "GetAnnotatedDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListAnnotatedDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "LabelImage": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "LabelVideo": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "LabelText": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "LabelAudio": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListExamples": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "CreateAnnotationSpecSet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetAnnotationSpecSet": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListAnnotationSpecSets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "DeleteAnnotationSpecSet": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "CreateInstruction": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetInstruction": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListInstructions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "DeleteInstruction": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "DeleteAnnotatedDataset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + }, + } + } +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py new file mode 100644 index 000000000000..2fba61df6e5c --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py @@ -0,0 +1,190 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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 AnnotationSentiment(enum.IntEnum): + """ + Attributes: + ANNOTATION_SENTIMENT_UNSPECIFIED (int) + NEGATIVE (int): This annotation describes negatively about the data. + POSITIVE (int): This label describes positively about the data. + """ + + ANNOTATION_SENTIMENT_UNSPECIFIED = 0 + NEGATIVE = 1 + POSITIVE = 2 + + +class AnnotationSource(enum.IntEnum): + """ + Specifies where is the answer from. + + Attributes: + ANNOTATION_SOURCE_UNSPECIFIED (int) + OPERATOR (int): Answer is provided by a human contributor. + """ + + ANNOTATION_SOURCE_UNSPECIFIED = 0 + OPERATOR = 3 + + +class AnnotationType(enum.IntEnum): + """ + Attributes: + ANNOTATION_TYPE_UNSPECIFIED (int) + IMAGE_CLASSIFICATION_ANNOTATION (int): Classification annotations in an image. + IMAGE_BOUNDING_BOX_ANNOTATION (int): Bounding box annotations in an image. + IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION (int): Oriented bounding box. The box does not have to be parallel to horizontal + line. + IMAGE_BOUNDING_POLY_ANNOTATION (int): Bounding poly annotations in an image. + IMAGE_POLYLINE_ANNOTATION (int): Polyline annotations in an image. + IMAGE_SEGMENTATION_ANNOTATION (int): Segmentation annotations in an image. + VIDEO_SHOTS_CLASSIFICATION_ANNOTATION (int): Classification annotations in video shots. + VIDEO_OBJECT_TRACKING_ANNOTATION (int): Video object tracking annotation. + VIDEO_OBJECT_DETECTION_ANNOTATION (int): Video object detection annotation. + VIDEO_EVENT_ANNOTATION (int): Video event annotation. + AUDIO_TRANSCRIPTION_ANNOTATION (int): Speech to text annotation. + TEXT_CLASSIFICATION_ANNOTATION (int): Classification for text. + TEXT_ENTITY_EXTRACTION_ANNOTATION (int): Entity extraction for text. + """ + + ANNOTATION_TYPE_UNSPECIFIED = 0 + IMAGE_CLASSIFICATION_ANNOTATION = 1 + IMAGE_BOUNDING_BOX_ANNOTATION = 2 + IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13 + IMAGE_BOUNDING_POLY_ANNOTATION = 10 + IMAGE_POLYLINE_ANNOTATION = 11 + IMAGE_SEGMENTATION_ANNOTATION = 12 + VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3 + VIDEO_OBJECT_TRACKING_ANNOTATION = 4 + VIDEO_OBJECT_DETECTION_ANNOTATION = 5 + VIDEO_EVENT_ANNOTATION = 6 + AUDIO_TRANSCRIPTION_ANNOTATION = 7 + TEXT_CLASSIFICATION_ANNOTATION = 8 + TEXT_ENTITY_EXTRACTION_ANNOTATION = 9 + + +class DataType(enum.IntEnum): + """ + Attributes: + DATA_TYPE_UNSPECIFIED (int) + IMAGE (int) + VIDEO (int) + TEXT (int) + AUDIO (int) + """ + + DATA_TYPE_UNSPECIFIED = 0 + IMAGE = 1 + VIDEO = 2 + TEXT = 4 + AUDIO = 5 + + +class StringAggregationType(enum.IntEnum): + """ + Attributes: + STRING_AGGREGATION_TYPE_UNSPECIFIED (int) + MAJORITY_VOTE (int): Majority vote to aggregate answers. + UNANIMOUS_VOTE (int): Unanimous answers will be adopted. + NO_AGGREGATION (int): Preserve all answers by crowd compute. + """ + + STRING_AGGREGATION_TYPE_UNSPECIFIED = 0 + MAJORITY_VOTE = 1 + UNANIMOUS_VOTE = 2 + NO_AGGREGATION = 3 + + +class LabelAudioRequest(object): + class Feature(enum.IntEnum): + """ + Audio labeling task feature. + + Attributes: + FEATURE_UNSPECIFIED (int) + AUDIO_TRANSCRIPTION (int): Transcribe the audios into text. + """ + + FEATURE_UNSPECIFIED = 0 + AUDIO_TRANSCRIPTION = 1 + + +class LabelImageRequest(object): + class Feature(enum.IntEnum): + """ + Image labeling task feature. + + Attributes: + FEATURE_UNSPECIFIED (int) + CLASSIFICATION (int): Label whole image with one or more of labels. + BOUNDING_BOX (int): Label image with bounding boxes for labels. + ORIENTED_BOUNDING_BOX (int): Label oriented bounding box. The box does not have to be parallel to + horizontal line. + BOUNDING_POLY (int): Label images with bounding poly. A bounding poly is a plane figure that + is bounded by a finite chain of straight line segments closing in a loop. + POLYLINE (int): Label images with polyline. Polyline is formed by connected line segments + which are not in closed form. + SEGMENTATION (int): Label images with segmentation. Segmentation is different from bounding + poly since it is more fine-grained, pixel level annotation. + """ + + FEATURE_UNSPECIFIED = 0 + CLASSIFICATION = 1 + BOUNDING_BOX = 2 + ORIENTED_BOUNDING_BOX = 6 + BOUNDING_POLY = 3 + POLYLINE = 4 + SEGMENTATION = 5 + + +class LabelTextRequest(object): + class Feature(enum.IntEnum): + """ + Text labeling task feature. + + Attributes: + FEATURE_UNSPECIFIED (int) + TEXT_CLASSIFICATION (int): Label text content to one of more labels. + TEXT_ENTITY_EXTRACTION (int): Label entities and their span in text. + """ + + FEATURE_UNSPECIFIED = 0 + TEXT_CLASSIFICATION = 1 + TEXT_ENTITY_EXTRACTION = 2 + + +class LabelVideoRequest(object): + class Feature(enum.IntEnum): + """ + Video labeling task feature. + + Attributes: + FEATURE_UNSPECIFIED (int) + CLASSIFICATION (int): Label whole video or video segment with one or more labels. + OBJECT_DETECTION (int): Label objects with bounding box on image frames extracted from the video. + OBJECT_TRACKING (int): Label and track objects in video. + EVENT (int): Label the range of video for the specified events. + """ + + FEATURE_UNSPECIFIED = 0 + CLASSIFICATION = 1 + OBJECT_DETECTION = 2 + OBJECT_TRACKING = 3 + EVENT = 4 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py new file mode 100644 index 000000000000..59af936d6649 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py @@ -0,0 +1,443 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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.datalabeling_v1beta1.proto import data_labeling_service_pb2_grpc + + +class DataLabelingServiceGrpcTransport(object): + """gRPC transport class providing stubs for + google.cloud.datalabeling.v1beta1 DataLabelingService 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="datalabeling.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) + + self._channel = channel + + # gRPC uses objects called "stubs" that are bound to the + # channel and provide a basic method for each RPC. + self._stubs = { + "data_labeling_service_stub": data_labeling_service_pb2_grpc.DataLabelingServiceStub( + 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="datalabeling.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 channel(self): + """The gRPC channel used by the transport. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return self._channel + + @property + def create_dataset(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_dataset`. + + Creates dataset. If success return a Dataset resource. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].CreateDataset + + @property + def get_dataset(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_dataset`. + + Gets dataset by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].GetDataset + + @property + def list_datasets(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_datasets`. + + Lists datasets under a project. Pagination is supported. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ListDatasets + + @property + def delete_dataset(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_dataset`. + + Deletes a dataset by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].DeleteDataset + + @property + def import_data(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.import_data`. + + Imports data into dataset based on source locations defined in request. + It can be called multiple times for the same dataset. Each dataset can + only have one long running operation running on it. For example, no + labeling task (also long running operation) can be started while + importing is still ongoing. Vice versa. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ImportData + + @property + def export_data(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.export_data`. + + Exports data and annotations from dataset. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ExportData + + @property + def get_data_item(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_data_item`. + + Gets a data item in a dataset by resource name. This API can be + called after data are imported into dataset. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].GetDataItem + + @property + def list_data_items(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_data_items`. + + Lists data items in a dataset. This API can be called after data + are imported into dataset. Pagination is supported. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ListDataItems + + @property + def get_annotated_dataset(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_annotated_dataset`. + + Gets an annotated dataset by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].GetAnnotatedDataset + + @property + def list_annotated_datasets(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_annotated_datasets`. + + Lists annotated datasets for a dataset. Pagination is supported. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ListAnnotatedDatasets + + @property + def label_image(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_image`. + + Starts a labeling task for image. The type of image labeling task is + configured by feature in the request. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].LabelImage + + @property + def label_video(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_video`. + + Starts a labeling task for video. The type of video labeling task is + configured by feature in the request. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].LabelVideo + + @property + def label_text(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_text`. + + Starts a labeling task for text. The type of text labeling task is + configured by feature in the request. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].LabelText + + @property + def label_audio(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_audio`. + + Starts a labeling task for audio. The type of audio labeling task is + configured by feature in the request. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].LabelAudio + + @property + def get_example(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_example`. + + Gets an example by resource name, including both data and annotation. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].GetExample + + @property + def list_examples(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_examples`. + + Lists examples in an annotated dataset. Pagination is supported. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ListExamples + + @property + def create_annotation_spec_set(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_annotation_spec_set`. + + Creates an annotation spec set by providing a set of labels. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].CreateAnnotationSpecSet + + @property + def get_annotation_spec_set(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_annotation_spec_set`. + + Gets an annotation spec set by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].GetAnnotationSpecSet + + @property + def list_annotation_spec_sets(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_annotation_spec_sets`. + + Lists annotation spec sets for a project. Pagination is supported. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ListAnnotationSpecSets + + @property + def delete_annotation_spec_set(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_annotation_spec_set`. + + Deletes an annotation spec set by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].DeleteAnnotationSpecSet + + @property + def create_instruction(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_instruction`. + + Creates an instruction for how data should be labeled. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].CreateInstruction + + @property + def get_instruction(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_instruction`. + + Gets an instruction by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].GetInstruction + + @property + def list_instructions(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_instructions`. + + Lists instructions for a project. Pagination is supported. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].ListInstructions + + @property + def delete_instruction(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_instruction`. + + Deletes an instruction object by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].DeleteInstruction + + @property + def delete_annotated_dataset(self): + """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_annotated_dataset`. + + Deletes an annotated dataset by resource name. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["data_labeling_service_stub"].DeleteAnnotatedDataset diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto new file mode 100644 index 000000000000..204ad8e3d874 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto @@ -0,0 +1,337 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +// Specifies where is the answer from. +enum AnnotationSource { + ANNOTATION_SOURCE_UNSPECIFIED = 0; + + // Answer is provided by a human contributor. + OPERATOR = 3; +} + +enum AnnotationSentiment { + ANNOTATION_SENTIMENT_UNSPECIFIED = 0; + + // This annotation describes negatively about the data. + NEGATIVE = 1; + + // This label describes positively about the data. + POSITIVE = 2; +} + +enum AnnotationType { + ANNOTATION_TYPE_UNSPECIFIED = 0; + + // Classification annotations in an image. + IMAGE_CLASSIFICATION_ANNOTATION = 1; + + // Bounding box annotations in an image. + IMAGE_BOUNDING_BOX_ANNOTATION = 2; + + // Oriented bounding box. The box does not have to be parallel to horizontal + // line. + IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13; + + // Bounding poly annotations in an image. + IMAGE_BOUNDING_POLY_ANNOTATION = 10; + + // Polyline annotations in an image. + IMAGE_POLYLINE_ANNOTATION = 11; + + // Segmentation annotations in an image. + IMAGE_SEGMENTATION_ANNOTATION = 12; + + // Classification annotations in video shots. + VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3; + + // Video object tracking annotation. + VIDEO_OBJECT_TRACKING_ANNOTATION = 4; + + // Video object detection annotation. + VIDEO_OBJECT_DETECTION_ANNOTATION = 5; + + // Video event annotation. + VIDEO_EVENT_ANNOTATION = 6; + + // Speech to text annotation. + AUDIO_TRANSCRIPTION_ANNOTATION = 7; + + // Classification for text. + TEXT_CLASSIFICATION_ANNOTATION = 8; + + // Entity extraction for text. + TEXT_ENTITY_EXTRACTION_ANNOTATION = 9; +} + +// Annotation for Example. Each example may have one or more annotations. For +// example in image classification problem, each image might have one or more +// labels. We call labels binded with this image an Annotation. +message Annotation { + // Output only. Unique name of this annotation, format is: + // + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id} + string name = 1; + + // Output only. The source of the annotation. + AnnotationSource annotation_source = 2; + + // Output only. This is the actual annotation value, e.g classification, + // bounding box values are stored here. + AnnotationValue annotation_value = 3; + + // Output only. Annotation metadata, including information like votes + // for labels. + AnnotationMetadata annotation_metadata = 4; + + // Output only. Sentiment for this annotation. + AnnotationSentiment annotation_sentiment = 6; +} + +// Annotation value for an example. +message AnnotationValue { + oneof value_type { + // Annotation value for image classification case. + ImageClassificationAnnotation image_classification_annotation = 1; + + // Annotation value for image bounding box, oriented bounding box + // and polygon cases. + ImageBoundingPolyAnnotation image_bounding_poly_annotation = 2; + + // Annotation value for image polyline cases. + // Polyline here is different from BoundingPoly. It is formed by + // line segments connected to each other but not closed form(Bounding Poly). + // The line segments can cross each other. + ImagePolylineAnnotation image_polyline_annotation = 8; + + // Annotation value for image segmentation. + ImageSegmentationAnnotation image_segmentation_annotation = 9; + + // Annotation value for text classification case. + TextClassificationAnnotation text_classification_annotation = 3; + + // Annotation value for video classification case. + VideoClassificationAnnotation video_classification_annotation = 4; + + // Annotation value for video object detection and tracking case. + VideoObjectTrackingAnnotation video_object_tracking_annotation = 5; + + // Annotation value for video event case. + VideoEventAnnotation video_event_annotation = 6; + + // Annotation value for speech audio recognition case. + AudioRecognitionAnnotation audio_recognition_annotation = 7; + } +} + +// Image classification annotation definition. +message ImageClassificationAnnotation { + // Label of image. + AnnotationSpec annotation_spec = 1; +} + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +message Vertex { + // X coordinate. + int32 x = 1; + + // Y coordinate. + int32 y = 2; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// A bounding polygon in the image. +message BoundingPoly { + // The bounding polygon vertices. + repeated Vertex vertices = 1; +} + +// Normalized bounding polygon. +message NormalizedBoundingPoly { + // The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 1; +} + +// Image bounding poly annotation. It represents a polygon including +// bounding box in the image. +message ImageBoundingPolyAnnotation { + // The region of the polygon. If it is a bounding box, it is guaranteed to be + // four points. + oneof bounded_area { + BoundingPoly bounding_poly = 2; + + NormalizedBoundingPoly normalized_bounding_poly = 3; + } + + // Label of object in this bounding polygon. + AnnotationSpec annotation_spec = 1; +} + +// A line with multiple line segments. +message Polyline { + // The polyline vertices. + repeated Vertex vertices = 1; +} + +// Normalized polyline. +message NormalizedPolyline { + // The normalized polyline vertices. + repeated NormalizedVertex normalized_vertices = 1; +} + +// A polyline for the image annotation. +message ImagePolylineAnnotation { + oneof poly { + Polyline polyline = 2; + + NormalizedPolyline normalized_polyline = 3; + } + + // Label of this polyline. + AnnotationSpec annotation_spec = 1; +} + +// Image segmentation annotation. +message ImageSegmentationAnnotation { + // The mapping between rgb color and annotation spec. The key is the rgb + // color represented in format of rgb(0, 0, 0). The value is the + // AnnotationSpec. + map annotation_colors = 1; + + // Image format. + string mime_type = 2; + + // A byte string of a full image's color map. + bytes image_bytes = 3; +} + +// Text classification annotation. +message TextClassificationAnnotation { + // Label of the text. + AnnotationSpec annotation_spec = 1; +} + +// A time period inside of an example that has a time dimension (e.g. video). +message TimeSegment { + // Start of the time segment (inclusive), represented as the duration since + // the example start. + google.protobuf.Duration start_time_offset = 1; + + // End of the time segment (exclusive), represented as the duration since the + // example start. + google.protobuf.Duration end_time_offset = 2; +} + +// Video classification annotation. +message VideoClassificationAnnotation { + // The time segment of the video to which the annotation applies. + TimeSegment time_segment = 1; + + // Label of the segment specified by time_segment. + AnnotationSpec annotation_spec = 2; +} + +// Video frame level annotation for object detection and tracking. +message ObjectTrackingFrame { + // The bounding box location of this object track for the frame. + oneof bounded_area { + BoundingPoly bounding_poly = 1; + + NormalizedBoundingPoly normalized_bounding_poly = 2; + } + + // The time offset of this frame relative to the beginning of the video. + google.protobuf.Duration time_offset = 3; +} + +// Video object tracking annotation. +message VideoObjectTrackingAnnotation { + // Label of the object tracked in this annotation. + AnnotationSpec annotation_spec = 1; + + // The time segment of the video to which object tracking applies. + TimeSegment time_segment = 2; + + // The list of frames where this object track appears. + repeated ObjectTrackingFrame object_tracking_frames = 3; +} + +// Video event annotation. +message VideoEventAnnotation { + // Label of the event in this annotation. + AnnotationSpec annotation_spec = 1; + + // The time segment of the video to which the annotation applies. + TimeSegment time_segment = 2; +} + +// Speech audio recognition. +message AudioRecognitionAnnotation { + // Transcript text representing the words spoken. + string transcript = 1; + + // Start position in audio file that the transcription corresponds to. + google.protobuf.Duration start_offset = 2; + + // End position in audio file that the transcription corresponds to. + google.protobuf.Duration end_offset = 3; +} + +// Additional information associated with the annotation. +message AnnotationMetadata { + // Metadata related to human labeling. + OperatorMetadata operator_metadata = 2; +} + +// General information useful for labels coming from contributors. +message OperatorMetadata { + // Confidence score corresponding to a label. For examle, if 3 contributors + // have answered the question and 2 of them agree on the final label, the + // confidence score will be 0.67 (2/3). + float score = 1; + + // The total number of contributors that answer this question. + int32 total_votes = 2; + + // The total number of contributors that choose this label. + int32 label_votes = 3; + + repeated string comments = 4; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py new file mode 100644 index 000000000000..d264078c994a --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py @@ -0,0 +1,2435 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/annotation.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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.cloud.datalabeling_v1beta1.proto import ( + annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, +) +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/annotation.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\n8google/cloud/datalabeling_v1beta1/proto/annotation.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x41google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xe2\x02\n\nAnnotation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x11\x61nnotation_source\x18\x02 \x01(\x0e\x32\x33.google.cloud.datalabeling.v1beta1.AnnotationSource\x12L\n\x10\x61nnotation_value\x18\x03 \x01(\x0b\x32\x32.google.cloud.datalabeling.v1beta1.AnnotationValue\x12R\n\x13\x61nnotation_metadata\x18\x04 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.AnnotationMetadata\x12T\n\x14\x61nnotation_sentiment\x18\x06 \x01(\x0e\x32\x36.google.cloud.datalabeling.v1beta1.AnnotationSentiment"\xc8\x07\n\x0f\x41nnotationValue\x12k\n\x1fimage_classification_annotation\x18\x01 \x01(\x0b\x32@.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotationH\x00\x12h\n\x1eimage_bounding_poly_annotation\x18\x02 \x01(\x0b\x32>.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotationH\x00\x12_\n\x19image_polyline_annotation\x18\x08 \x01(\x0b\x32:.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotationH\x00\x12g\n\x1dimage_segmentation_annotation\x18\t \x01(\x0b\x32>.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotationH\x00\x12i\n\x1etext_classification_annotation\x18\x03 \x01(\x0b\x32?.google.cloud.datalabeling.v1beta1.TextClassificationAnnotationH\x00\x12k\n\x1fvideo_classification_annotation\x18\x04 \x01(\x0b\x32@.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotationH\x00\x12l\n video_object_tracking_annotation\x18\x05 \x01(\x0b\x32@.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotationH\x00\x12Y\n\x16video_event_annotation\x18\x06 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.VideoEventAnnotationH\x00\x12\x65\n\x1c\x61udio_recognition_annotation\x18\x07 \x01(\x0b\x32=.google.cloud.datalabeling.v1beta1.AudioRecognitionAnnotationH\x00\x42\x0c\n\nvalue_type"k\n\x1dImageClassificationAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"K\n\x0c\x42oundingPoly\x12;\n\x08vertices\x18\x01 \x03(\x0b\x32).google.cloud.datalabeling.v1beta1.Vertex"j\n\x16NormalizedBoundingPoly\x12P\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.NormalizedVertex"\xa2\x02\n\x1bImageBoundingPolyAnnotation\x12H\n\rbounding_poly\x18\x02 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.BoundingPolyH\x00\x12]\n\x18normalized_bounding_poly\x18\x03 \x01(\x0b\x32\x39.google.cloud.datalabeling.v1beta1.NormalizedBoundingPolyH\x00\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpecB\x0e\n\x0c\x62ounded_area"G\n\x08Polyline\x12;\n\x08vertices\x18\x01 \x03(\x0b\x32).google.cloud.datalabeling.v1beta1.Vertex"f\n\x12NormalizedPolyline\x12P\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.NormalizedVertex"\x84\x02\n\x17ImagePolylineAnnotation\x12?\n\x08polyline\x18\x02 \x01(\x0b\x32+.google.cloud.datalabeling.v1beta1.PolylineH\x00\x12T\n\x13normalized_polyline\x18\x03 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.NormalizedPolylineH\x00\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpecB\x06\n\x04poly"\xa2\x02\n\x1bImageSegmentationAnnotation\x12o\n\x11\x61nnotation_colors\x18\x01 \x03(\x0b\x32T.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x13\n\x0bimage_bytes\x18\x03 \x01(\x0c\x1aj\n\x15\x41nnotationColorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec:\x02\x38\x01"j\n\x1cTextClassificationAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec"w\n\x0bTimeSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\xb1\x01\n\x1dVideoClassificationAnnotation\x12\x44\n\x0ctime_segment\x18\x01 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TimeSegment\x12J\n\x0f\x61nnotation_spec\x18\x02 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec"\xfe\x01\n\x13ObjectTrackingFrame\x12H\n\rbounding_poly\x18\x01 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.BoundingPolyH\x00\x12]\n\x18normalized_bounding_poly\x18\x02 \x01(\x0b\x32\x39.google.cloud.datalabeling.v1beta1.NormalizedBoundingPolyH\x00\x12.\n\x0btime_offset\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\n\x0c\x62ounded_area"\x89\x02\n\x1dVideoObjectTrackingAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x44\n\x0ctime_segment\x18\x02 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TimeSegment\x12V\n\x16object_tracking_frames\x18\x03 \x03(\x0b\x32\x36.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame"\xa8\x01\n\x14VideoEventAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x44\n\x0ctime_segment\x18\x02 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TimeSegment"\x90\x01\n\x1a\x41udioRecognitionAnnotation\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12/\n\x0cstart_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration"d\n\x12\x41nnotationMetadata\x12N\n\x11operator_metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.OperatorMetadata"]\n\x10OperatorMetadata\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x13\n\x0btotal_votes\x18\x02 \x01(\x05\x12\x13\n\x0blabel_votes\x18\x03 \x01(\x05\x12\x10\n\x08\x63omments\x18\x04 \x03(\t*C\n\x10\x41nnotationSource\x12!\n\x1d\x41NNOTATION_SOURCE_UNSPECIFIED\x10\x00\x12\x0c\n\x08OPERATOR\x10\x03*W\n\x13\x41nnotationSentiment\x12$\n ANNOTATION_SENTIMENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08NEGATIVE\x10\x01\x12\x0c\n\x08POSITIVE\x10\x02*\x8e\x04\n\x0e\x41nnotationType\x12\x1f\n\x1b\x41NNOTATION_TYPE_UNSPECIFIED\x10\x00\x12#\n\x1fIMAGE_CLASSIFICATION_ANNOTATION\x10\x01\x12!\n\x1dIMAGE_BOUNDING_BOX_ANNOTATION\x10\x02\x12*\n&IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION\x10\r\x12"\n\x1eIMAGE_BOUNDING_POLY_ANNOTATION\x10\n\x12\x1d\n\x19IMAGE_POLYLINE_ANNOTATION\x10\x0b\x12!\n\x1dIMAGE_SEGMENTATION_ANNOTATION\x10\x0c\x12)\n%VIDEO_SHOTS_CLASSIFICATION_ANNOTATION\x10\x03\x12$\n VIDEO_OBJECT_TRACKING_ANNOTATION\x10\x04\x12%\n!VIDEO_OBJECT_DETECTION_ANNOTATION\x10\x05\x12\x1a\n\x16VIDEO_EVENT_ANNOTATION\x10\x06\x12"\n\x1e\x41UDIO_TRANSCRIPTION_ANNOTATION\x10\x07\x12"\n\x1eTEXT_CLASSIFICATION_ANNOTATION\x10\x08\x12%\n!TEXT_ENTITY_EXTRACTION_ANNOTATION\x10\tBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[ + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.DESCRIPTOR, + google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, + google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + +_ANNOTATIONSOURCE = _descriptor.EnumDescriptor( + name="AnnotationSource", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSource", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="ANNOTATION_SOURCE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="OPERATOR", index=1, number=3, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=4458, + serialized_end=4525, +) +_sym_db.RegisterEnumDescriptor(_ANNOTATIONSOURCE) + +AnnotationSource = enum_type_wrapper.EnumTypeWrapper(_ANNOTATIONSOURCE) +_ANNOTATIONSENTIMENT = _descriptor.EnumDescriptor( + name="AnnotationSentiment", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSentiment", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="ANNOTATION_SENTIMENT_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="NEGATIVE", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="POSITIVE", index=2, number=2, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=4527, + serialized_end=4614, +) +_sym_db.RegisterEnumDescriptor(_ANNOTATIONSENTIMENT) + +AnnotationSentiment = enum_type_wrapper.EnumTypeWrapper(_ANNOTATIONSENTIMENT) +_ANNOTATIONTYPE = _descriptor.EnumDescriptor( + name="AnnotationType", + full_name="google.cloud.datalabeling.v1beta1.AnnotationType", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="ANNOTATION_TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE_CLASSIFICATION_ANNOTATION", + index=1, + number=1, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE_BOUNDING_BOX_ANNOTATION", + index=2, + number=2, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION", + index=3, + number=13, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE_BOUNDING_POLY_ANNOTATION", + index=4, + number=10, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE_POLYLINE_ANNOTATION", + index=5, + number=11, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE_SEGMENTATION_ANNOTATION", + index=6, + number=12, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="VIDEO_SHOTS_CLASSIFICATION_ANNOTATION", + index=7, + number=3, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="VIDEO_OBJECT_TRACKING_ANNOTATION", + index=8, + number=4, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="VIDEO_OBJECT_DETECTION_ANNOTATION", + index=9, + number=5, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="VIDEO_EVENT_ANNOTATION", + index=10, + number=6, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="AUDIO_TRANSCRIPTION_ANNOTATION", + index=11, + number=7, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="TEXT_CLASSIFICATION_ANNOTATION", + index=12, + number=8, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="TEXT_ENTITY_EXTRACTION_ANNOTATION", + index=13, + number=9, + serialized_options=None, + type=None, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=4617, + serialized_end=5143, +) +_sym_db.RegisterEnumDescriptor(_ANNOTATIONTYPE) + +AnnotationType = enum_type_wrapper.EnumTypeWrapper(_ANNOTATIONTYPE) +ANNOTATION_SOURCE_UNSPECIFIED = 0 +OPERATOR = 3 +ANNOTATION_SENTIMENT_UNSPECIFIED = 0 +NEGATIVE = 1 +POSITIVE = 2 +ANNOTATION_TYPE_UNSPECIFIED = 0 +IMAGE_CLASSIFICATION_ANNOTATION = 1 +IMAGE_BOUNDING_BOX_ANNOTATION = 2 +IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13 +IMAGE_BOUNDING_POLY_ANNOTATION = 10 +IMAGE_POLYLINE_ANNOTATION = 11 +IMAGE_SEGMENTATION_ANNOTATION = 12 +VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3 +VIDEO_OBJECT_TRACKING_ANNOTATION = 4 +VIDEO_OBJECT_DETECTION_ANNOTATION = 5 +VIDEO_EVENT_ANNOTATION = 6 +AUDIO_TRANSCRIPTION_ANNOTATION = 7 +TEXT_CLASSIFICATION_ANNOTATION = 8 +TEXT_ENTITY_EXTRACTION_ANNOTATION = 9 + + +_ANNOTATION = _descriptor.Descriptor( + name="Annotation", + full_name="google.cloud.datalabeling.v1beta1.Annotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.Annotation.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_source", + full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_source", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_value", + full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_value", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_metadata", + full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_metadata", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_sentiment", + full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_sentiment", + index=4, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=288, + serialized_end=642, +) + + +_ANNOTATIONVALUE = _descriptor.Descriptor( + name="AnnotationValue", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="image_classification_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_classification_annotation", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_bounding_poly_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_bounding_poly_annotation", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_polyline_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_polyline_annotation", + index=2, + number=8, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_segmentation_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_segmentation_annotation", + index=3, + number=9, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_classification_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.text_classification_annotation", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_classification_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.video_classification_annotation", + index=5, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_object_tracking_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.video_object_tracking_annotation", + index=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_event_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.video_event_annotation", + index=7, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="audio_recognition_annotation", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.audio_recognition_annotation", + index=8, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="value_type", + full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.value_type", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=645, + serialized_end=1613, +) + + +_IMAGECLASSIFICATIONANNOTATION = _descriptor.Descriptor( + name="ImageClassificationAnnotation", + full_name="google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.annotation_spec", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1615, + serialized_end=1722, +) + + +_VERTEX = _descriptor.Descriptor( + name="Vertex", + full_name="google.cloud.datalabeling.v1beta1.Vertex", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="x", + full_name="google.cloud.datalabeling.v1beta1.Vertex.x", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="y", + full_name="google.cloud.datalabeling.v1beta1.Vertex.y", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1724, + serialized_end=1754, +) + + +_NORMALIZEDVERTEX = _descriptor.Descriptor( + name="NormalizedVertex", + full_name="google.cloud.datalabeling.v1beta1.NormalizedVertex", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="x", + full_name="google.cloud.datalabeling.v1beta1.NormalizedVertex.x", + index=0, + number=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="y", + full_name="google.cloud.datalabeling.v1beta1.NormalizedVertex.y", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1756, + serialized_end=1796, +) + + +_BOUNDINGPOLY = _descriptor.Descriptor( + name="BoundingPoly", + full_name="google.cloud.datalabeling.v1beta1.BoundingPoly", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="vertices", + full_name="google.cloud.datalabeling.v1beta1.BoundingPoly.vertices", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1798, + serialized_end=1873, +) + + +_NORMALIZEDBOUNDINGPOLY = _descriptor.Descriptor( + name="NormalizedBoundingPoly", + full_name="google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="normalized_vertices", + full_name="google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.normalized_vertices", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1875, + serialized_end=1981, +) + + +_IMAGEBOUNDINGPOLYANNOTATION = _descriptor.Descriptor( + name="ImageBoundingPolyAnnotation", + full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="bounding_poly", + full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.bounding_poly", + index=0, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="normalized_bounding_poly", + full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.normalized_bounding_poly", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.annotation_spec", + index=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="bounded_area", + full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.bounded_area", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=1984, + serialized_end=2274, +) + + +_POLYLINE = _descriptor.Descriptor( + name="Polyline", + full_name="google.cloud.datalabeling.v1beta1.Polyline", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="vertices", + full_name="google.cloud.datalabeling.v1beta1.Polyline.vertices", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2276, + serialized_end=2347, +) + + +_NORMALIZEDPOLYLINE = _descriptor.Descriptor( + name="NormalizedPolyline", + full_name="google.cloud.datalabeling.v1beta1.NormalizedPolyline", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="normalized_vertices", + full_name="google.cloud.datalabeling.v1beta1.NormalizedPolyline.normalized_vertices", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2349, + serialized_end=2451, +) + + +_IMAGEPOLYLINEANNOTATION = _descriptor.Descriptor( + name="ImagePolylineAnnotation", + full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="polyline", + full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.polyline", + index=0, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="normalized_polyline", + full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.normalized_polyline", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.annotation_spec", + index=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="poly", + full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.poly", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=2454, + serialized_end=2714, +) + + +_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY = _descriptor.Descriptor( + name="AnnotationColorsEntry", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry.key", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry.value", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=_b("8\001"), + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2901, + serialized_end=3007, +) + +_IMAGESEGMENTATIONANNOTATION = _descriptor.Descriptor( + name="ImageSegmentationAnnotation", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_colors", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.annotation_colors", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.mime_type", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_bytes", + full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.image_bytes", + index=2, + number=3, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b(""), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2717, + serialized_end=3007, +) + + +_TEXTCLASSIFICATIONANNOTATION = _descriptor.Descriptor( + name="TextClassificationAnnotation", + full_name="google.cloud.datalabeling.v1beta1.TextClassificationAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.annotation_spec", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3009, + serialized_end=3115, +) + + +_TIMESEGMENT = _descriptor.Descriptor( + name="TimeSegment", + full_name="google.cloud.datalabeling.v1beta1.TimeSegment", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="start_time_offset", + full_name="google.cloud.datalabeling.v1beta1.TimeSegment.start_time_offset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="end_time_offset", + full_name="google.cloud.datalabeling.v1beta1.TimeSegment.end_time_offset", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3117, + serialized_end=3236, +) + + +_VIDEOCLASSIFICATIONANNOTATION = _descriptor.Descriptor( + name="VideoClassificationAnnotation", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="time_segment", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.time_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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.annotation_spec", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3239, + serialized_end=3416, +) + + +_OBJECTTRACKINGFRAME = _descriptor.Descriptor( + name="ObjectTrackingFrame", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="bounding_poly", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.bounding_poly", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="normalized_bounding_poly", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.normalized_bounding_poly", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="time_offset", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.time_offset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="bounded_area", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.bounded_area", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=3419, + serialized_end=3673, +) + + +_VIDEOOBJECTTRACKINGANNOTATION = _descriptor.Descriptor( + name="VideoObjectTrackingAnnotation", + full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.annotation_spec", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="time_segment", + full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.time_segment", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="object_tracking_frames", + full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.object_tracking_frames", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3676, + serialized_end=3941, +) + + +_VIDEOEVENTANNOTATION = _descriptor.Descriptor( + name="VideoEventAnnotation", + full_name="google.cloud.datalabeling.v1beta1.VideoEventAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec", + full_name="google.cloud.datalabeling.v1beta1.VideoEventAnnotation.annotation_spec", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="time_segment", + full_name="google.cloud.datalabeling.v1beta1.VideoEventAnnotation.time_segment", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3944, + serialized_end=4112, +) + + +_AUDIORECOGNITIONANNOTATION = _descriptor.Descriptor( + name="AudioRecognitionAnnotation", + full_name="google.cloud.datalabeling.v1beta1.AudioRecognitionAnnotation", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="transcript", + full_name="google.cloud.datalabeling.v1beta1.AudioRecognitionAnnotation.transcript", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="start_offset", + full_name="google.cloud.datalabeling.v1beta1.AudioRecognitionAnnotation.start_offset", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="end_offset", + full_name="google.cloud.datalabeling.v1beta1.AudioRecognitionAnnotation.end_offset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4115, + serialized_end=4259, +) + + +_ANNOTATIONMETADATA = _descriptor.Descriptor( + name="AnnotationMetadata", + full_name="google.cloud.datalabeling.v1beta1.AnnotationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="operator_metadata", + full_name="google.cloud.datalabeling.v1beta1.AnnotationMetadata.operator_metadata", + index=0, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4261, + serialized_end=4361, +) + + +_OPERATORMETADATA = _descriptor.Descriptor( + name="OperatorMetadata", + full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="score", + full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.score", + index=0, + number=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="total_votes", + full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.total_votes", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="label_votes", + full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.label_votes", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="comments", + full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.comments", + index=3, + number=4, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4363, + serialized_end=4456, +) + +_ANNOTATION.fields_by_name["annotation_source"].enum_type = _ANNOTATIONSOURCE +_ANNOTATION.fields_by_name["annotation_value"].message_type = _ANNOTATIONVALUE +_ANNOTATION.fields_by_name["annotation_metadata"].message_type = _ANNOTATIONMETADATA +_ANNOTATION.fields_by_name["annotation_sentiment"].enum_type = _ANNOTATIONSENTIMENT +_ANNOTATIONVALUE.fields_by_name[ + "image_classification_annotation" +].message_type = _IMAGECLASSIFICATIONANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "image_bounding_poly_annotation" +].message_type = _IMAGEBOUNDINGPOLYANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "image_polyline_annotation" +].message_type = _IMAGEPOLYLINEANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "image_segmentation_annotation" +].message_type = _IMAGESEGMENTATIONANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "text_classification_annotation" +].message_type = _TEXTCLASSIFICATIONANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "video_classification_annotation" +].message_type = _VIDEOCLASSIFICATIONANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "video_object_tracking_annotation" +].message_type = _VIDEOOBJECTTRACKINGANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "video_event_annotation" +].message_type = _VIDEOEVENTANNOTATION +_ANNOTATIONVALUE.fields_by_name[ + "audio_recognition_annotation" +].message_type = _AUDIORECOGNITIONANNOTATION +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["image_classification_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "image_classification_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["image_bounding_poly_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "image_bounding_poly_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["image_polyline_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "image_polyline_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["image_segmentation_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "image_segmentation_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["text_classification_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "text_classification_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["video_classification_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "video_classification_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["video_object_tracking_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "video_object_tracking_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["video_event_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "video_event_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( + _ANNOTATIONVALUE.fields_by_name["audio_recognition_annotation"] +) +_ANNOTATIONVALUE.fields_by_name[ + "audio_recognition_annotation" +].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] +_IMAGECLASSIFICATIONANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX +_NORMALIZEDBOUNDINGPOLY.fields_by_name[ + "normalized_vertices" +].message_type = _NORMALIZEDVERTEX +_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ + "bounding_poly" +].message_type = _BOUNDINGPOLY +_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ + "normalized_bounding_poly" +].message_type = _NORMALIZEDBOUNDINGPOLY +_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"].fields.append( + _IMAGEBOUNDINGPOLYANNOTATION.fields_by_name["bounding_poly"] +) +_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ + "bounding_poly" +].containing_oneof = _IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"] +_IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"].fields.append( + _IMAGEBOUNDINGPOLYANNOTATION.fields_by_name["normalized_bounding_poly"] +) +_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ + "normalized_bounding_poly" +].containing_oneof = _IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"] +_POLYLINE.fields_by_name["vertices"].message_type = _VERTEX +_NORMALIZEDPOLYLINE.fields_by_name[ + "normalized_vertices" +].message_type = _NORMALIZEDVERTEX +_IMAGEPOLYLINEANNOTATION.fields_by_name["polyline"].message_type = _POLYLINE +_IMAGEPOLYLINEANNOTATION.fields_by_name[ + "normalized_polyline" +].message_type = _NORMALIZEDPOLYLINE +_IMAGEPOLYLINEANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"].fields.append( + _IMAGEPOLYLINEANNOTATION.fields_by_name["polyline"] +) +_IMAGEPOLYLINEANNOTATION.fields_by_name[ + "polyline" +].containing_oneof = _IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"] +_IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"].fields.append( + _IMAGEPOLYLINEANNOTATION.fields_by_name["normalized_polyline"] +) +_IMAGEPOLYLINEANNOTATION.fields_by_name[ + "normalized_polyline" +].containing_oneof = _IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"] +_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY.fields_by_name[ + "value" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY.containing_type = ( + _IMAGESEGMENTATIONANNOTATION +) +_IMAGESEGMENTATIONANNOTATION.fields_by_name[ + "annotation_colors" +].message_type = _IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY +_TEXTCLASSIFICATIONANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_TIMESEGMENT.fields_by_name[ + "start_time_offset" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_TIMESEGMENT.fields_by_name[ + "end_time_offset" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_VIDEOCLASSIFICATIONANNOTATION.fields_by_name[ + "time_segment" +].message_type = _TIMESEGMENT +_VIDEOCLASSIFICATIONANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_OBJECTTRACKINGFRAME.fields_by_name["bounding_poly"].message_type = _BOUNDINGPOLY +_OBJECTTRACKINGFRAME.fields_by_name[ + "normalized_bounding_poly" +].message_type = _NORMALIZEDBOUNDINGPOLY +_OBJECTTRACKINGFRAME.fields_by_name[ + "time_offset" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"].fields.append( + _OBJECTTRACKINGFRAME.fields_by_name["bounding_poly"] +) +_OBJECTTRACKINGFRAME.fields_by_name[ + "bounding_poly" +].containing_oneof = _OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"] +_OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"].fields.append( + _OBJECTTRACKINGFRAME.fields_by_name["normalized_bounding_poly"] +) +_OBJECTTRACKINGFRAME.fields_by_name[ + "normalized_bounding_poly" +].containing_oneof = _OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"] +_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ + "time_segment" +].message_type = _TIMESEGMENT +_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ + "object_tracking_frames" +].message_type = _OBJECTTRACKINGFRAME +_VIDEOEVENTANNOTATION.fields_by_name[ + "annotation_spec" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC +) +_VIDEOEVENTANNOTATION.fields_by_name["time_segment"].message_type = _TIMESEGMENT +_AUDIORECOGNITIONANNOTATION.fields_by_name[ + "start_offset" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_AUDIORECOGNITIONANNOTATION.fields_by_name[ + "end_offset" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_ANNOTATIONMETADATA.fields_by_name["operator_metadata"].message_type = _OPERATORMETADATA +DESCRIPTOR.message_types_by_name["Annotation"] = _ANNOTATION +DESCRIPTOR.message_types_by_name["AnnotationValue"] = _ANNOTATIONVALUE +DESCRIPTOR.message_types_by_name[ + "ImageClassificationAnnotation" +] = _IMAGECLASSIFICATIONANNOTATION +DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX +DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX +DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY +DESCRIPTOR.message_types_by_name["NormalizedBoundingPoly"] = _NORMALIZEDBOUNDINGPOLY +DESCRIPTOR.message_types_by_name[ + "ImageBoundingPolyAnnotation" +] = _IMAGEBOUNDINGPOLYANNOTATION +DESCRIPTOR.message_types_by_name["Polyline"] = _POLYLINE +DESCRIPTOR.message_types_by_name["NormalizedPolyline"] = _NORMALIZEDPOLYLINE +DESCRIPTOR.message_types_by_name["ImagePolylineAnnotation"] = _IMAGEPOLYLINEANNOTATION +DESCRIPTOR.message_types_by_name[ + "ImageSegmentationAnnotation" +] = _IMAGESEGMENTATIONANNOTATION +DESCRIPTOR.message_types_by_name[ + "TextClassificationAnnotation" +] = _TEXTCLASSIFICATIONANNOTATION +DESCRIPTOR.message_types_by_name["TimeSegment"] = _TIMESEGMENT +DESCRIPTOR.message_types_by_name[ + "VideoClassificationAnnotation" +] = _VIDEOCLASSIFICATIONANNOTATION +DESCRIPTOR.message_types_by_name["ObjectTrackingFrame"] = _OBJECTTRACKINGFRAME +DESCRIPTOR.message_types_by_name[ + "VideoObjectTrackingAnnotation" +] = _VIDEOOBJECTTRACKINGANNOTATION +DESCRIPTOR.message_types_by_name["VideoEventAnnotation"] = _VIDEOEVENTANNOTATION +DESCRIPTOR.message_types_by_name[ + "AudioRecognitionAnnotation" +] = _AUDIORECOGNITIONANNOTATION +DESCRIPTOR.message_types_by_name["AnnotationMetadata"] = _ANNOTATIONMETADATA +DESCRIPTOR.message_types_by_name["OperatorMetadata"] = _OPERATORMETADATA +DESCRIPTOR.enum_types_by_name["AnnotationSource"] = _ANNOTATIONSOURCE +DESCRIPTOR.enum_types_by_name["AnnotationSentiment"] = _ANNOTATIONSENTIMENT +DESCRIPTOR.enum_types_by_name["AnnotationType"] = _ANNOTATIONTYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Annotation = _reflection.GeneratedProtocolMessageType( + "Annotation", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Annotation for Example. Each example may have one or more annotations. + For example in image classification problem, each image might have one + or more labels. We call labels binded with this image an Annotation. + + + Attributes: + name: + Output only. Unique name of this annotation, format is: proje + cts/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/{an + notated\_dataset}/examples/{example\_id}/annotations/{annotati + on\_id} + annotation_source: + Output only. The source of the annotation. + annotation_value: + Output only. This is the actual annotation value, e.g + classification, bounding box values are stored here. + annotation_metadata: + Output only. Annotation metadata, including information like + votes for labels. + annotation_sentiment: + Output only. Sentiment for this annotation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Annotation) + ), +) +_sym_db.RegisterMessage(Annotation) + +AnnotationValue = _reflection.GeneratedProtocolMessageType( + "AnnotationValue", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATIONVALUE, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Annotation value for an example. + + + Attributes: + image_classification_annotation: + Annotation value for image classification case. + image_bounding_poly_annotation: + Annotation value for image bounding box, oriented bounding box + and polygon cases. + image_polyline_annotation: + Annotation value for image polyline cases. Polyline here is + different from BoundingPoly. It is formed by line segments + connected to each other but not closed form(Bounding Poly). + The line segments can cross each other. + image_segmentation_annotation: + Annotation value for image segmentation. + text_classification_annotation: + Annotation value for text classification case. + video_classification_annotation: + Annotation value for video classification case. + video_object_tracking_annotation: + Annotation value for video object detection and tracking case. + video_event_annotation: + Annotation value for video event case. + audio_recognition_annotation: + Annotation value for speech audio recognition case. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationValue) + ), +) +_sym_db.RegisterMessage(AnnotationValue) + +ImageClassificationAnnotation = _reflection.GeneratedProtocolMessageType( + "ImageClassificationAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_IMAGECLASSIFICATIONANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Image classification annotation definition. + + + Attributes: + annotation_spec: + Label of image. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation) + ), +) +_sym_db.RegisterMessage(ImageClassificationAnnotation) + +Vertex = _reflection.GeneratedProtocolMessageType( + "Vertex", + (_message.Message,), + dict( + DESCRIPTOR=_VERTEX, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""X coordinate. + + + Attributes: + y: + Y coordinate. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Vertex) + ), +) +_sym_db.RegisterMessage(Vertex) + +NormalizedVertex = _reflection.GeneratedProtocolMessageType( + "NormalizedVertex", + (_message.Message,), + dict( + DESCRIPTOR=_NORMALIZEDVERTEX, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""X coordinate. + + + Attributes: + y: + Y coordinate. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.NormalizedVertex) + ), +) +_sym_db.RegisterMessage(NormalizedVertex) + +BoundingPoly = _reflection.GeneratedProtocolMessageType( + "BoundingPoly", + (_message.Message,), + dict( + DESCRIPTOR=_BOUNDINGPOLY, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""A bounding polygon in the image. + + + Attributes: + vertices: + The bounding polygon vertices. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.BoundingPoly) + ), +) +_sym_db.RegisterMessage(BoundingPoly) + +NormalizedBoundingPoly = _reflection.GeneratedProtocolMessageType( + "NormalizedBoundingPoly", + (_message.Message,), + dict( + DESCRIPTOR=_NORMALIZEDBOUNDINGPOLY, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Normalized bounding polygon. + + + Attributes: + normalized_vertices: + The bounding polygon normalized vertices. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly) + ), +) +_sym_db.RegisterMessage(NormalizedBoundingPoly) + +ImageBoundingPolyAnnotation = _reflection.GeneratedProtocolMessageType( + "ImageBoundingPolyAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_IMAGEBOUNDINGPOLYANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Image bounding poly annotation. It represents a polygon including + bounding box in the image. + + + Attributes: + bounded_area: + The region of the polygon. If it is a bounding box, it is + guaranteed to be four points. + annotation_spec: + Label of object in this bounding polygon. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation) + ), +) +_sym_db.RegisterMessage(ImageBoundingPolyAnnotation) + +Polyline = _reflection.GeneratedProtocolMessageType( + "Polyline", + (_message.Message,), + dict( + DESCRIPTOR=_POLYLINE, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""A line with multiple line segments. + + + Attributes: + vertices: + The polyline vertices. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Polyline) + ), +) +_sym_db.RegisterMessage(Polyline) + +NormalizedPolyline = _reflection.GeneratedProtocolMessageType( + "NormalizedPolyline", + (_message.Message,), + dict( + DESCRIPTOR=_NORMALIZEDPOLYLINE, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Normalized polyline. + + + Attributes: + normalized_vertices: + The normalized polyline vertices. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.NormalizedPolyline) + ), +) +_sym_db.RegisterMessage(NormalizedPolyline) + +ImagePolylineAnnotation = _reflection.GeneratedProtocolMessageType( + "ImagePolylineAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_IMAGEPOLYLINEANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""A polyline for the image annotation. + + + Attributes: + annotation_spec: + Label of this polyline. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation) + ), +) +_sym_db.RegisterMessage(ImagePolylineAnnotation) + +ImageSegmentationAnnotation = _reflection.GeneratedProtocolMessageType( + "ImageSegmentationAnnotation", + (_message.Message,), + dict( + AnnotationColorsEntry=_reflection.GeneratedProtocolMessageType( + "AnnotationColorsEntry", + (_message.Message,), + dict( + DESCRIPTOR=_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2" + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry) + ), + ), + DESCRIPTOR=_IMAGESEGMENTATIONANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Image segmentation annotation. + + + Attributes: + annotation_colors: + The mapping between rgb color and annotation spec. The key is + the rgb color represented in format of rgb(0, 0, 0). The value + is the AnnotationSpec. + mime_type: + Image format. + image_bytes: + A byte string of a full image's color map. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation) + ), +) +_sym_db.RegisterMessage(ImageSegmentationAnnotation) +_sym_db.RegisterMessage(ImageSegmentationAnnotation.AnnotationColorsEntry) + +TextClassificationAnnotation = _reflection.GeneratedProtocolMessageType( + "TextClassificationAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_TEXTCLASSIFICATIONANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Text classification annotation. + + + Attributes: + annotation_spec: + Label of the text. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextClassificationAnnotation) + ), +) +_sym_db.RegisterMessage(TextClassificationAnnotation) + +TimeSegment = _reflection.GeneratedProtocolMessageType( + "TimeSegment", + (_message.Message,), + dict( + DESCRIPTOR=_TIMESEGMENT, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""A time period inside of an example that has a time dimension (e.g. + video). + + + Attributes: + start_time_offset: + Start of the time segment (inclusive), represented as the + duration since the example start. + end_time_offset: + End of the time segment (exclusive), represented as the + duration since the example start. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TimeSegment) + ), +) +_sym_db.RegisterMessage(TimeSegment) + +VideoClassificationAnnotation = _reflection.GeneratedProtocolMessageType( + "VideoClassificationAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_VIDEOCLASSIFICATIONANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Video classification annotation. + + + Attributes: + time_segment: + The time segment of the video to which the annotation applies. + annotation_spec: + Label of the segment specified by time\_segment. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation) + ), +) +_sym_db.RegisterMessage(VideoClassificationAnnotation) + +ObjectTrackingFrame = _reflection.GeneratedProtocolMessageType( + "ObjectTrackingFrame", + (_message.Message,), + dict( + DESCRIPTOR=_OBJECTTRACKINGFRAME, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Video frame level annotation for object detection and tracking. + + + Attributes: + bounded_area: + The bounding box location of this object track for the frame. + time_offset: + The time offset of this frame relative to the beginning of the + video. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectTrackingFrame) + ), +) +_sym_db.RegisterMessage(ObjectTrackingFrame) + +VideoObjectTrackingAnnotation = _reflection.GeneratedProtocolMessageType( + "VideoObjectTrackingAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_VIDEOOBJECTTRACKINGANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Video object tracking annotation. + + + Attributes: + annotation_spec: + Label of the object tracked in this annotation. + time_segment: + The time segment of the video to which object tracking + applies. + object_tracking_frames: + The list of frames where this object track appears. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation) + ), +) +_sym_db.RegisterMessage(VideoObjectTrackingAnnotation) + +VideoEventAnnotation = _reflection.GeneratedProtocolMessageType( + "VideoEventAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_VIDEOEVENTANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Video event annotation. + + + Attributes: + annotation_spec: + Label of the event in this annotation. + time_segment: + The time segment of the video to which the annotation applies. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoEventAnnotation) + ), +) +_sym_db.RegisterMessage(VideoEventAnnotation) + +AudioRecognitionAnnotation = _reflection.GeneratedProtocolMessageType( + "AudioRecognitionAnnotation", + (_message.Message,), + dict( + DESCRIPTOR=_AUDIORECOGNITIONANNOTATION, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Speech audio recognition. + + + Attributes: + transcript: + Transcript text representing the words spoken. + start_offset: + Start position in audio file that the transcription + corresponds to. + end_offset: + End position in audio file that the transcription corresponds + to. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AudioRecognitionAnnotation) + ), +) +_sym_db.RegisterMessage(AudioRecognitionAnnotation) + +AnnotationMetadata = _reflection.GeneratedProtocolMessageType( + "AnnotationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""Additional information associated with the annotation. + + + Attributes: + operator_metadata: + Metadata related to human labeling. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationMetadata) + ), +) +_sym_db.RegisterMessage(AnnotationMetadata) + +OperatorMetadata = _reflection.GeneratedProtocolMessageType( + "OperatorMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_OPERATORMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", + __doc__="""General information useful for labels coming from contributors. + + + Attributes: + score: + Confidence score corresponding to a label. For examle, if 3 + contributors have answered the question and 2 of them agree on + the final label, the confidence score will be 0.67 (2/3). + total_votes: + The total number of contributors that answer this question. + label_votes: + The total number of contributors that choose this label. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.OperatorMetadata) + ), +) +_sym_db.RegisterMessage(OperatorMetadata) + + +DESCRIPTOR._options = None +_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto new file mode 100644 index 000000000000..20fdec73c4d9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto @@ -0,0 +1,56 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +// AnnotationSpecSet is a collection of label definitions. For example, in +// image classification tasks, we define a set of labels, this set is called +// AnnotationSpecSet. AnnotationSpecSet is immutable upon creation. +message AnnotationSpecSet { + // Output only. + // AnnotationSpecSet resource name, format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string name = 1; + + // Required. The display name for AnnotationSpecSet defined by user. + // Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the annotation specification set. + // The description can be up to 10000 characters long. + string description = 3; + + // Required. The actual spec set defined by the users. + repeated AnnotationSpec annotation_specs = 4; +} + +// Container of information related to one annotation spec. +message AnnotationSpec { + // Required. The display name of the AnnotationSpec. Maximum of 64 characters. + string display_name = 1; + + // Optional. User-provided description of the annotation specification. + // The description can be up to 10000 characters long. + string description = 2; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py new file mode 100644 index 000000000000..001a2deea144 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py @@ -0,0 +1,243 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\nAgoogle/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto"\x99\x01\n\x11\x41nnotationSpecSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12K\n\x10\x61nnotation_specs\x18\x04 \x03(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec";\n\x0e\x41nnotationSpec\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\tBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], +) + + +_ANNOTATIONSPECSET = _descriptor.Descriptor( + name="AnnotationSpecSet", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.display_name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.description", + index=2, + number=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_specs", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.annotation_specs", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=135, + serialized_end=288, +) + + +_ANNOTATIONSPEC = _descriptor.Descriptor( + name="AnnotationSpec", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpec", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datalabeling.v1beta1.AnnotationSpec.description", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=290, + serialized_end=349, +) + +_ANNOTATIONSPECSET.fields_by_name["annotation_specs"].message_type = _ANNOTATIONSPEC +DESCRIPTOR.message_types_by_name["AnnotationSpecSet"] = _ANNOTATIONSPECSET +DESCRIPTOR.message_types_by_name["AnnotationSpec"] = _ANNOTATIONSPEC +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +AnnotationSpecSet = _reflection.GeneratedProtocolMessageType( + "AnnotationSpecSet", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATIONSPECSET, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_spec_set_pb2", + __doc__="""AnnotationSpecSet is a collection of label definitions. For example, in + image classification tasks, we define a set of labels, this set is + called AnnotationSpecSet. AnnotationSpecSet is immutable upon creation. + + + Attributes: + name: + Output only. AnnotationSpecSet resource name, format: projects + /{project\_id}/annotationSpecSets/{annotation\_spec\_set\_id} + display_name: + Required. The display name for AnnotationSpecSet defined by + user. Maximum of 64 characters. + description: + Optional. User-provided description of the annotation + specification set. The description can be up to 10000 + characters long. + annotation_specs: + Required. The actual spec set defined by the users. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationSpecSet) + ), +) +_sym_db.RegisterMessage(AnnotationSpecSet) + +AnnotationSpec = _reflection.GeneratedProtocolMessageType( + "AnnotationSpec", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATIONSPEC, + __module__="google.cloud.datalabeling_v1beta1.proto.annotation_spec_set_pb2", + __doc__="""Container of information related to one annotation spec. + + + Attributes: + display_name: + Required. The display name of the AnnotationSpec. Maximum of + 64 characters. + description: + Optional. User-provided description of the annotation + specification. The description can be up to 10000 characters + long. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationSpec) + ), +) +_sym_db.RegisterMessage(AnnotationSpec) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto new file mode 100644 index 000000000000..22222ab7128a --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto @@ -0,0 +1,728 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/cloud/datalabeling/v1beta1/instruction.proto"; +import "google/cloud/datalabeling/v1beta1/operations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +service DataLabelingService { + // Creates dataset. If success return a Dataset resource. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/datasets" + body: "*" + }; + } + + // Gets dataset by resource name. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*}" + }; + } + + // Lists datasets under a project. Pagination is supported. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/datasets" + }; + } + + // Deletes a dataset by resource name. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/datasets/*}" + }; + } + + // Imports data into dataset based on source locations defined in request. + // It can be called multiple times for the same dataset. Each dataset can + // only have one long running operation running on it. For example, no + // labeling task (also long running operation) can be started while + // importing is still ongoing. Vice versa. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/datasets/*}:importData" + body: "*" + }; + } + + // Exports data and annotations from dataset. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/datasets/*}:exportData" + body: "*" + }; + } + + // Gets a data item in a dataset by resource name. This API can be + // called after data are imported into dataset. + rpc GetDataItem(GetDataItemRequest) returns (DataItem) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/dataItems/*}" + }; + } + + // Lists data items in a dataset. This API can be called after data + // are imported into dataset. Pagination is supported. + rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*}/dataItems" + }; + } + + // Gets an annotated dataset by resource name. + rpc GetAnnotatedDataset(GetAnnotatedDatasetRequest) returns (AnnotatedDataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }; + } + + // Lists annotated datasets for a dataset. Pagination is supported. + rpc ListAnnotatedDatasets(ListAnnotatedDatasetsRequest) returns (ListAnnotatedDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" + }; + } + + // Deletes an annotated dataset by resource name. + rpc DeleteAnnotatedDataset(DeleteAnnotatedDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }; + } + + // Starts a labeling task for image. The type of image labeling task is + // configured by feature in the request. + rpc LabelImage(LabelImageRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/image:label" + body: "*" + }; + } + + // Starts a labeling task for video. The type of video labeling task is + // configured by feature in the request. + rpc LabelVideo(LabelVideoRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/video:label" + body: "*" + }; + } + + // Starts a labeling task for text. The type of text labeling task is + // configured by feature in the request. + rpc LabelText(LabelTextRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/text:label" + body: "*" + }; + } + + // Starts a labeling task for audio. The type of audio labeling task is + // configured by feature in the request. + rpc LabelAudio(LabelAudioRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/audio:label" + body: "*" + }; + } + + // Gets an example by resource name, including both data and annotation. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" + }; + } + + // Lists examples in an annotated dataset. Pagination is supported. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" + }; + } + + // Creates an annotation spec set by providing a set of labels. + rpc CreateAnnotationSpecSet(CreateAnnotationSpecSetRequest) returns (AnnotationSpecSet) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/annotationSpecSets" + body: "*" + }; + } + + // Gets an annotation spec set by resource name. + rpc GetAnnotationSpecSet(GetAnnotationSpecSetRequest) returns (AnnotationSpecSet) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/annotationSpecSets/*}" + }; + } + + // Lists annotation spec sets for a project. Pagination is supported. + rpc ListAnnotationSpecSets(ListAnnotationSpecSetsRequest) returns (ListAnnotationSpecSetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/annotationSpecSets" + }; + } + + // Deletes an annotation spec set by resource name. + rpc DeleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/annotationSpecSets/*}" + }; + } + + // Creates an instruction for how data should be labeled. + rpc CreateInstruction(CreateInstructionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/instructions" + body: "*" + }; + } + + // Gets an instruction by resource name. + rpc GetInstruction(GetInstructionRequest) returns (Instruction) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/instructions/*}" + }; + } + + // Lists instructions for a project. Pagination is supported. + rpc ListInstructions(ListInstructionsRequest) returns (ListInstructionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/instructions" + }; + } + + // Deletes an instruction object by resource name. + rpc DeleteInstruction(DeleteInstructionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/instructions/*}" + }; + } +} + +// Request message for CreateDataset. +message CreateDatasetRequest { + // Required. Dataset resource parent, format: + // projects/{project_id} + string parent = 1; + + // Required. The dataset to be created. + Dataset dataset = 2; +} + +// Request message for GetDataSet. +message GetDatasetRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; +} + +// Request message for ListDataset. +message ListDatasetsRequest { + // Required. Dataset resource parent, format: + // projects/{project_id} + string parent = 1; + + // Optional. Filter on dataset is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token] of the previous + // [DataLabelingService.ListDatasets] call. + // Returns the first page if empty. + string page_token = 4; +} + +// Results of listing datasets within a project. +message ListDatasetsResponse { + // The list of datasets to return. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteDataset. +message DeleteDatasetRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; +} + +// Request message for ImportData API. +message ImportDataRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. Specify the input source of the data. + InputConfig input_config = 2; +} + +// Request message for ExportData API. +message ExportDataRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. Annotated dataset resource name. DataItem in + // Dataset and their annotations in specified annotated dataset will be + // exported. It's in format of + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string annotated_dataset = 2; + + // Optional. Filter is not supported at this moment. + string filter = 3; + + // Required. Specify the output destination. + OutputConfig output_config = 4; +} + +// Request message for GetDataItem. +message GetDataItemRequest { + // Required. The name of the data item to get, format: + // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + string name = 1; +} + +// Request message for ListDataItems. +message ListDataItemsRequest { + // Required. Name of the dataset to list data items, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListDataItemsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token] of the previous + // [DataLabelingService.ListDataItems] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing data items in a dataset. +message ListDataItemsResponse { + // The list of data items to return. + repeated DataItem data_items = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for GetAnnotatedDataset. +message GetAnnotatedDatasetRequest { + // Required. Name of the annotated dataset to get, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; +} + +// Request message for ListAnnotatedDatasets. +message ListAnnotatedDatasetsRequest { + // Required. Name of the dataset to list annotated datasets, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListAnnotatedDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token] of the previous + // [DataLabelingService.ListAnnotatedDatasets] call. + // Return first page if empty. + string page_token = 4; +} + +// Request message for DeleteAnnotatedDataset. +message DeleteAnnotatedDatasetRequest { + // Required. Name of the annotated dataset to delete, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; +} + +// Results of listing annotated datasets for a dataset. +message ListAnnotatedDatasetsResponse { + // The list of annotated datasets to return. + repeated AnnotatedDataset annotated_datasets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for starting an image labeling task. +message LabelImageRequest { + // Image labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label whole image with one or more of labels. + CLASSIFICATION = 1; + + // Label image with bounding boxes for labels. + BOUNDING_BOX = 2; + + // Label oriented bounding box. The box does not have to be parallel to + // horizontal line. + ORIENTED_BOUNDING_BOX = 6; + + // Label images with bounding poly. A bounding poly is a plane figure that + // is bounded by a finite chain of straight line segments closing in a loop. + BOUNDING_POLY = 3; + + // Label images with polyline. Polyline is formed by connected line segments + // which are not in closed form. + POLYLINE = 4; + + // Label images with segmentation. Segmentation is different from bounding + // poly since it is more fine-grained, pixel level annotation. + SEGMENTATION = 5; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for image classification task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + ImageClassificationConfig image_classification_config = 4; + + // Configuration for bounding box and bounding poly task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + BoundingPolyConfig bounding_poly_config = 5; + + // Configuration for polyline task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + PolylineConfig polyline_config = 6; + + // Configuration for segmentation task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + SegmentationConfig segmentation_config = 7; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of image labeling task. + Feature feature = 3; +} + +// Request message for LabelVideo. +message LabelVideoRequest { + // Video labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label whole video or video segment with one or more labels. + CLASSIFICATION = 1; + + // Label objects with bounding box on image frames extracted from the video. + OBJECT_DETECTION = 2; + + // Label and track objects in video. + OBJECT_TRACKING = 3; + + // Label the range of video for the specified events. + EVENT = 4; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for video classification task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + VideoClassificationConfig video_classification_config = 4; + + // Configuration for video object detection task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + ObjectDetectionConfig object_detection_config = 5; + + // Configuration for video object tracking task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + ObjectTrackingConfig object_tracking_config = 6; + + // Configuration for video event task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + EventConfig event_config = 7; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of video labeling task. + Feature feature = 3; +} + +// Request message for LabelText. +message LabelTextRequest { + // Text labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label text content to one of more labels. + TEXT_CLASSIFICATION = 1; + + // Label entities and their span in text. + TEXT_ENTITY_EXTRACTION = 2; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for text classification task. + // One of text_classification_config and text_entity_extraction_config + // is required. + TextClassificationConfig text_classification_config = 4; + + // Configuration for entity extraction task. + // One of text_classification_config and text_entity_extraction_config + // is required. + TextEntityExtractionConfig text_entity_extraction_config = 5; + } + + // Required. Name of the data set to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of text labeling task. + Feature feature = 6; +} + +// Request message for LabelAudio. +message LabelAudioRequest { + // Audio labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Transcribe the audios into text. + AUDIO_TRANSCRIPTION = 1; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of audio labeling task. + Feature feature = 3; +} + +// Request message for GetExample +message GetExampleRequest { + // Required. Name of example, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id}/examples/{example_id} + string name = 1; + + // Optional. An expression for filtering Examples. Filter by + // annotation_spec.display_name is supported. Format + // "annotation_spec.display_name = {display_name}" + string filter = 2; +} + +// Request message for ListExamples. +message ListExamplesRequest { + // Required. Example resource parent. + string parent = 1; + + // Optional. An expression for filtering Examples. For annotated datasets that + // have annotation spec set, filter by + // annotation_spec.display_name is supported. Format + // "annotation_spec.display_name = {display_name}" + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListExamplesResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token] of the previous + // [DataLabelingService.ListExamples] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing Examples in and annotated dataset. +message ListExamplesResponse { + // The list of examples to return. + repeated Example examples = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for CreateAnnotationSpecSet. +message CreateAnnotationSpecSetRequest { + // Required. AnnotationSpecSet resource parent, format: + // projects/{project_id} + string parent = 1; + + // Required. Annotation spec set to create. Annotation specs must be included. + // Only one annotation spec will be accepted for annotation specs with same + // display_name. + AnnotationSpecSet annotation_spec_set = 2; +} + +// Request message for GetAnnotationSpecSet. +message GetAnnotationSpecSetRequest { + // Required. AnnotationSpecSet resource name, format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string name = 1; +} + +// Request message for ListAnnotationSpecSets. +message ListAnnotationSpecSetsRequest { + // Required. Parent of AnnotationSpecSet resource, format: + // projects/{project_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListAnnotationSpecSetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token] of the previous + // [DataLabelingService.ListAnnotationSpecSets] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing annotation spec set under a project. +message ListAnnotationSpecSetsResponse { + // The list of annotation spec sets. + repeated AnnotationSpecSet annotation_spec_sets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteAnnotationSpecSet. +message DeleteAnnotationSpecSetRequest { + // Required. AnnotationSpec resource name, format: + // `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. + string name = 1; +} + +// Request message for CreateInstruction. +message CreateInstructionRequest { + // Required. Instruction resource parent, format: + // projects/{project_id} + string parent = 1; + + // Required. Instruction of how to perform the labeling task. + Instruction instruction = 2; +} + +// Request message for GetInstruction. +message GetInstructionRequest { + // Required. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; +} + +// Request message for DeleteInstruction. +message DeleteInstructionRequest { + // Required. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; +} + +// Request message for ListInstructions. +message ListInstructionsRequest { + // Required. Instruction resource parent, format: + // projects/{project_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListInstructionsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token] of the previous + // [DataLabelingService.ListInstructions] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing instructions under a project. +message ListInstructionsResponse { + // The list of Instructions to return. + repeated Instruction instructions = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py new file mode 100644 index 000000000000..f112dd83d90c --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py @@ -0,0 +1,3641 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.cloud.datalabeling_v1beta1.proto import ( + annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + instruction_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + operations_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_operations__pb2, +) +from google.longrunning import ( + operations_pb2 as google_dot_longrunning_dot_operations__pb2, +) +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\nCgoogle/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x41google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x1a\x35google/cloud/datalabeling_v1beta1/proto/dataset.proto\x1a\x45google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x1a\x39google/cloud/datalabeling_v1beta1/proto/instruction.proto\x1a\x38google/cloud/datalabeling_v1beta1/proto/operations.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"c\n\x14\x43reateDatasetRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12;\n\x07\x64\x61taset\x18\x02 \x01(\x0b\x32*.google.cloud.datalabeling.v1beta1.Dataset"!\n\x11GetDatasetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\\\n\x13ListDatasetsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"m\n\x14ListDatasetsResponse\x12<\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32*.google.cloud.datalabeling.v1beta1.Dataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"$\n\x14\x44\x65leteDatasetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"g\n\x11ImportDataRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x44\n\x0cinput_config\x18\x02 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.InputConfig"\x94\x01\n\x11\x45xportDataRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x11\x61nnotated_dataset\x18\x02 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x46\n\routput_config\x18\x04 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.OutputConfig""\n\x12GetDataItemRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"]\n\x14ListDataItemsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"q\n\x15ListDataItemsResponse\x12?\n\ndata_items\x18\x01 \x03(\x0b\x32+.google.cloud.datalabeling.v1beta1.DataItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"*\n\x1aGetAnnotatedDatasetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"e\n\x1cListAnnotatedDatasetsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"-\n\x1d\x44\x65leteAnnotatedDatasetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x89\x01\n\x1dListAnnotatedDatasetsResponse\x12O\n\x12\x61nnotated_datasets\x18\x01 \x03(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.AnnotatedDataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xcd\x05\n\x11LabelImageRequest\x12\x63\n\x1bimage_classification_config\x18\x04 \x01(\x0b\x32<.google.cloud.datalabeling.v1beta1.ImageClassificationConfigH\x00\x12U\n\x14\x62ounding_poly_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.BoundingPolyConfigH\x00\x12L\n\x0fpolyline_config\x18\x06 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.PolylineConfigH\x00\x12T\n\x13segmentation_config\x18\x07 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.SegmentationConfigH\x00\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12N\n\x0c\x62\x61sic_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig\x12M\n\x07\x66\x65\x61ture\x18\x03 \x01(\x0e\x32<.google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature"\x96\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43LASSIFICATION\x10\x01\x12\x10\n\x0c\x42OUNDING_BOX\x10\x02\x12\x19\n\x15ORIENTED_BOUNDING_BOX\x10\x06\x12\x11\n\rBOUNDING_POLY\x10\x03\x12\x0c\n\x08POLYLINE\x10\x04\x12\x10\n\x0cSEGMENTATION\x10\x05\x42\x10\n\x0erequest_config"\xa7\x05\n\x11LabelVideoRequest\x12\x63\n\x1bvideo_classification_config\x18\x04 \x01(\x0b\x32<.google.cloud.datalabeling.v1beta1.VideoClassificationConfigH\x00\x12[\n\x17object_detection_config\x18\x05 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.ObjectDetectionConfigH\x00\x12Y\n\x16object_tracking_config\x18\x06 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.ObjectTrackingConfigH\x00\x12\x46\n\x0c\x65vent_config\x18\x07 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.EventConfigH\x00\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12N\n\x0c\x62\x61sic_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig\x12M\n\x07\x66\x65\x61ture\x18\x03 \x01(\x0e\x32<.google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature"l\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43LASSIFICATION\x10\x01\x12\x14\n\x10OBJECT_DETECTION\x10\x02\x12\x13\n\x0fOBJECT_TRACKING\x10\x03\x12\t\n\x05\x45VENT\x10\x04\x42\x10\n\x0erequest_config"\xf6\x03\n\x10LabelTextRequest\x12\x61\n\x1atext_classification_config\x18\x04 \x01(\x0b\x32;.google.cloud.datalabeling.v1beta1.TextClassificationConfigH\x00\x12\x66\n\x1dtext_entity_extraction_config\x18\x05 \x01(\x0b\x32=.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfigH\x00\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12N\n\x0c\x62\x61sic_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig\x12L\n\x07\x66\x65\x61ture\x18\x06 \x01(\x0e\x32;.google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature"W\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x17\n\x13TEXT_CLASSIFICATION\x10\x01\x12\x1a\n\x16TEXT_ENTITY_EXTRACTION\x10\x02\x42\x10\n\x0erequest_config"\xff\x01\n\x11LabelAudioRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12N\n\x0c\x62\x61sic_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig\x12M\n\x07\x66\x65\x61ture\x18\x03 \x01(\x0e\x32<.google.cloud.datalabeling.v1beta1.LabelAudioRequest.Feature";\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41UDIO_TRANSCRIPTION\x10\x01"1\n\x11GetExampleRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t"\\\n\x13ListExamplesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"m\n\x14ListExamplesResponse\x12<\n\x08\x65xamples\x18\x01 \x03(\x0b\x32*.google.cloud.datalabeling.v1beta1.Example\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x83\x01\n\x1e\x43reateAnnotationSpecSetRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12Q\n\x13\x61nnotation_spec_set\x18\x02 \x01(\x0b\x32\x34.google.cloud.datalabeling.v1beta1.AnnotationSpecSet"+\n\x1bGetAnnotationSpecSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"f\n\x1dListAnnotationSpecSetsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"\x8d\x01\n\x1eListAnnotationSpecSetsResponse\x12R\n\x14\x61nnotation_spec_sets\x18\x01 \x03(\x0b\x32\x34.google.cloud.datalabeling.v1beta1.AnnotationSpecSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t".\n\x1e\x44\x65leteAnnotationSpecSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"o\n\x18\x43reateInstructionRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x43\n\x0binstruction\x18\x02 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.Instruction"%\n\x15GetInstructionRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"(\n\x18\x44\x65leteInstructionRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"`\n\x17ListInstructionsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"y\n\x18ListInstructionsResponse\x12\x44\n\x0cinstructions\x18\x01 \x03(\x0b\x32..google.cloud.datalabeling.v1beta1.Instruction\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xae#\n\x13\x44\x61taLabelingService\x12\xa6\x01\n\rCreateDataset\x12\x37.google.cloud.datalabeling.v1beta1.CreateDatasetRequest\x1a*.google.cloud.datalabeling.v1beta1.Dataset"0\x82\xd3\xe4\x93\x02*"%/v1beta1/{parent=projects/*}/datasets:\x01*\x12\x9d\x01\n\nGetDataset\x12\x34.google.cloud.datalabeling.v1beta1.GetDatasetRequest\x1a*.google.cloud.datalabeling.v1beta1.Dataset"-\x82\xd3\xe4\x93\x02\'\x12%/v1beta1/{name=projects/*/datasets/*}\x12\xae\x01\n\x0cListDatasets\x12\x36.google.cloud.datalabeling.v1beta1.ListDatasetsRequest\x1a\x37.google.cloud.datalabeling.v1beta1.ListDatasetsResponse"-\x82\xd3\xe4\x93\x02\'\x12%/v1beta1/{parent=projects/*}/datasets\x12\x8f\x01\n\rDeleteDataset\x12\x37.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest\x1a\x16.google.protobuf.Empty"-\x82\xd3\xe4\x93\x02\'*%/v1beta1/{name=projects/*/datasets/*}\x12\x9e\x01\n\nImportData\x12\x34.google.cloud.datalabeling.v1beta1.ImportDataRequest\x1a\x1d.google.longrunning.Operation";\x82\xd3\xe4\x93\x02\x35"0/v1beta1/{name=projects/*/datasets/*}:importData:\x01*\x12\x9e\x01\n\nExportData\x12\x34.google.cloud.datalabeling.v1beta1.ExportDataRequest\x1a\x1d.google.longrunning.Operation";\x82\xd3\xe4\x93\x02\x35"0/v1beta1/{name=projects/*/datasets/*}:exportData:\x01*\x12\xac\x01\n\x0bGetDataItem\x12\x35.google.cloud.datalabeling.v1beta1.GetDataItemRequest\x1a+.google.cloud.datalabeling.v1beta1.DataItem"9\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/datasets/*/dataItems/*}\x12\xbd\x01\n\rListDataItems\x12\x37.google.cloud.datalabeling.v1beta1.ListDataItemsRequest\x1a\x38.google.cloud.datalabeling.v1beta1.ListDataItemsResponse"9\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/datasets/*}/dataItems\x12\xcc\x01\n\x13GetAnnotatedDataset\x12=.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest\x1a\x33.google.cloud.datalabeling.v1beta1.AnnotatedDataset"A\x82\xd3\xe4\x93\x02;\x12\x39/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}\x12\xdd\x01\n\x15ListAnnotatedDatasets\x12?.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest\x1a@.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse"A\x82\xd3\xe4\x93\x02;\x12\x39/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets\x12\xb5\x01\n\x16\x44\x65leteAnnotatedDataset\x12@.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest\x1a\x16.google.protobuf.Empty"A\x82\xd3\xe4\x93\x02;*9/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}\x12\xa1\x01\n\nLabelImage\x12\x34.google.cloud.datalabeling.v1beta1.LabelImageRequest\x1a\x1d.google.longrunning.Operation">\x82\xd3\xe4\x93\x02\x38"3/v1beta1/{parent=projects/*/datasets/*}/image:label:\x01*\x12\xa1\x01\n\nLabelVideo\x12\x34.google.cloud.datalabeling.v1beta1.LabelVideoRequest\x1a\x1d.google.longrunning.Operation">\x82\xd3\xe4\x93\x02\x38"3/v1beta1/{parent=projects/*/datasets/*}/video:label:\x01*\x12\x9e\x01\n\tLabelText\x12\x33.google.cloud.datalabeling.v1beta1.LabelTextRequest\x1a\x1d.google.longrunning.Operation"=\x82\xd3\xe4\x93\x02\x37"2/v1beta1/{parent=projects/*/datasets/*}/text:label:\x01*\x12\xa1\x01\n\nLabelAudio\x12\x34.google.cloud.datalabeling.v1beta1.LabelAudioRequest\x1a\x1d.google.longrunning.Operation">\x82\xd3\xe4\x93\x02\x38"3/v1beta1/{parent=projects/*/datasets/*}/audio:label:\x01*\x12\xbc\x01\n\nGetExample\x12\x34.google.cloud.datalabeling.v1beta1.GetExampleRequest\x1a*.google.cloud.datalabeling.v1beta1.Example"L\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}\x12\xcd\x01\n\x0cListExamples\x12\x36.google.cloud.datalabeling.v1beta1.ListExamplesRequest\x1a\x37.google.cloud.datalabeling.v1beta1.ListExamplesResponse"L\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples\x12\xce\x01\n\x17\x43reateAnnotationSpecSet\x12\x41.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest\x1a\x34.google.cloud.datalabeling.v1beta1.AnnotationSpecSet":\x82\xd3\xe4\x93\x02\x34"//v1beta1/{parent=projects/*}/annotationSpecSets:\x01*\x12\xc5\x01\n\x14GetAnnotationSpecSet\x12>.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest\x1a\x34.google.cloud.datalabeling.v1beta1.AnnotationSpecSet"7\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{name=projects/*/annotationSpecSets/*}\x12\xd6\x01\n\x16ListAnnotationSpecSets\x12@.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest\x1a\x41.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse"7\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{parent=projects/*}/annotationSpecSets\x12\xad\x01\n\x17\x44\x65leteAnnotationSpecSet\x12\x41.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest\x1a\x16.google.protobuf.Empty"7\x82\xd3\xe4\x93\x02\x31*//v1beta1/{name=projects/*/annotationSpecSets/*}\x12\xa5\x01\n\x11\x43reateInstruction\x12;.google.cloud.datalabeling.v1beta1.CreateInstructionRequest\x1a\x1d.google.longrunning.Operation"4\x82\xd3\xe4\x93\x02.")/v1beta1/{parent=projects/*}/instructions:\x01*\x12\xad\x01\n\x0eGetInstruction\x12\x38.google.cloud.datalabeling.v1beta1.GetInstructionRequest\x1a..google.cloud.datalabeling.v1beta1.Instruction"1\x82\xd3\xe4\x93\x02+\x12)/v1beta1/{name=projects/*/instructions/*}\x12\xbe\x01\n\x10ListInstructions\x12:.google.cloud.datalabeling.v1beta1.ListInstructionsRequest\x1a;.google.cloud.datalabeling.v1beta1.ListInstructionsResponse"1\x82\xd3\xe4\x93\x02+\x12)/v1beta1/{parent=projects/*}/instructions\x12\x9b\x01\n\x11\x44\x65leteInstruction\x12;.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest\x1a\x16.google.protobuf.Empty"1\x82\xd3\xe4\x93\x02+*)/v1beta1/{name=projects/*/instructions/*}Bx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_operations__pb2.DESCRIPTOR, + google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, + google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, + google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, + ], +) + + +_LABELIMAGEREQUEST_FEATURE = _descriptor.EnumDescriptor( + name="Feature", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="FEATURE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="CLASSIFICATION", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="BOUNDING_BOX", index=2, number=2, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="ORIENTED_BOUNDING_BOX", + index=3, + number=6, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="BOUNDING_POLY", index=4, number=3, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="POLYLINE", index=5, number=4, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="SEGMENTATION", index=6, number=5, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=2311, + serialized_end=2461, +) +_sym_db.RegisterEnumDescriptor(_LABELIMAGEREQUEST_FEATURE) + +_LABELVIDEOREQUEST_FEATURE = _descriptor.EnumDescriptor( + name="Feature", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="FEATURE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="CLASSIFICATION", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="OBJECT_DETECTION", + index=2, + number=2, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="OBJECT_TRACKING", + index=3, + number=3, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="EVENT", index=4, number=4, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=3035, + serialized_end=3143, +) +_sym_db.RegisterEnumDescriptor(_LABELVIDEOREQUEST_FEATURE) + +_LABELTEXTREQUEST_FEATURE = _descriptor.EnumDescriptor( + name="Feature", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="FEATURE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="TEXT_CLASSIFICATION", + index=1, + number=1, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="TEXT_ENTITY_EXTRACTION", + index=2, + number=2, + serialized_options=None, + type=None, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=3561, + serialized_end=3648, +) +_sym_db.RegisterEnumDescriptor(_LABELTEXTREQUEST_FEATURE) + +_LABELAUDIOREQUEST_FEATURE = _descriptor.EnumDescriptor( + name="Feature", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioRequest.Feature", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="FEATURE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="AUDIO_TRANSCRIPTION", + index=1, + number=1, + serialized_options=None, + type=None, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=3865, + serialized_end=3924, +) +_sym_db.RegisterEnumDescriptor(_LABELAUDIOREQUEST_FEATURE) + + +_CREATEDATASETREQUEST = _descriptor.Descriptor( + name="CreateDatasetRequest", + full_name="google.cloud.datalabeling.v1beta1.CreateDatasetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.CreateDatasetRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="dataset", + full_name="google.cloud.datalabeling.v1beta1.CreateDatasetRequest.dataset", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=546, + serialized_end=645, +) + + +_GETDATASETREQUEST = _descriptor.Descriptor( + name="GetDatasetRequest", + full_name="google.cloud.datalabeling.v1beta1.GetDatasetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.GetDatasetRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=647, + serialized_end=680, +) + + +_LISTDATASETSREQUEST = _descriptor.Descriptor( + name="ListDatasetsRequest", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.page_size", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=682, + serialized_end=774, +) + + +_LISTDATASETSRESPONSE = _descriptor.Descriptor( + name="ListDatasetsResponse", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="datasets", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsResponse.datasets", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=776, + serialized_end=885, +) + + +_DELETEDATASETREQUEST = _descriptor.Descriptor( + name="DeleteDatasetRequest", + full_name="google.cloud.datalabeling.v1beta1.DeleteDatasetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.DeleteDatasetRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=887, + serialized_end=923, +) + + +_IMPORTDATAREQUEST = _descriptor.Descriptor( + name="ImportDataRequest", + full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="input_config", + full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest.input_config", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=925, + serialized_end=1028, +) + + +_EXPORTDATAREQUEST = _descriptor.Descriptor( + name="ExportDataRequest", + full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotated_dataset", + full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.annotated_dataset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.filter", + index=2, + number=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="output_config", + full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.output_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1031, + serialized_end=1179, +) + + +_GETDATAITEMREQUEST = _descriptor.Descriptor( + name="GetDataItemRequest", + full_name="google.cloud.datalabeling.v1beta1.GetDataItemRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.GetDataItemRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1181, + serialized_end=1215, +) + + +_LISTDATAITEMSREQUEST = _descriptor.Descriptor( + name="ListDataItemsRequest", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.page_size", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1217, + serialized_end=1310, +) + + +_LISTDATAITEMSRESPONSE = _descriptor.Descriptor( + name="ListDataItemsResponse", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="data_items", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsResponse.data_items", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1312, + serialized_end=1425, +) + + +_GETANNOTATEDDATASETREQUEST = _descriptor.Descriptor( + name="GetAnnotatedDatasetRequest", + full_name="google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1427, + serialized_end=1469, +) + + +_LISTANNOTATEDDATASETSREQUEST = _descriptor.Descriptor( + name="ListAnnotatedDatasetsRequest", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.page_size", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1471, + serialized_end=1572, +) + + +_DELETEANNOTATEDDATASETREQUEST = _descriptor.Descriptor( + name="DeleteAnnotatedDatasetRequest", + full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1574, + serialized_end=1619, +) + + +_LISTANNOTATEDDATASETSRESPONSE = _descriptor.Descriptor( + name="ListAnnotatedDatasetsResponse", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotated_datasets", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.annotated_datasets", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1622, + serialized_end=1759, +) + + +_LABELIMAGEREQUEST = _descriptor.Descriptor( + name="LabelImageRequest", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="image_classification_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.image_classification_config", + index=0, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="bounding_poly_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.bounding_poly_config", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="polyline_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.polyline_config", + index=2, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="segmentation_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.segmentation_config", + index=3, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.parent", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.basic_config", + index=5, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="feature", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.feature", + index=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_LABELIMAGEREQUEST_FEATURE], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="request_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.request_config", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=1762, + serialized_end=2479, +) + + +_LABELVIDEOREQUEST = _descriptor.Descriptor( + name="LabelVideoRequest", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="video_classification_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.video_classification_config", + index=0, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="object_detection_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.object_detection_config", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="object_tracking_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.object_tracking_config", + index=2, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="event_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.event_config", + index=3, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.parent", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.basic_config", + index=5, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="feature", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.feature", + index=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_LABELVIDEOREQUEST_FEATURE], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="request_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.request_config", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=2482, + serialized_end=3161, +) + + +_LABELTEXTREQUEST = _descriptor.Descriptor( + name="LabelTextRequest", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="text_classification_config", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.text_classification_config", + index=0, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_entity_extraction_config", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.text_entity_extraction_config", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.parent", + index=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.basic_config", + index=3, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="feature", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.feature", + index=4, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_LABELTEXTREQUEST_FEATURE], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="request_config", + full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.request_config", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=3164, + serialized_end=3666, +) + + +_LABELAUDIOREQUEST = _descriptor.Descriptor( + name="LabelAudioRequest", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioRequest.basic_config", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="feature", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioRequest.feature", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[_LABELAUDIOREQUEST_FEATURE], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3669, + serialized_end=3924, +) + + +_GETEXAMPLEREQUEST = _descriptor.Descriptor( + name="GetExampleRequest", + full_name="google.cloud.datalabeling.v1beta1.GetExampleRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.GetExampleRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.GetExampleRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3926, + serialized_end=3975, +) + + +_LISTEXAMPLESREQUEST = _descriptor.Descriptor( + name="ListExamplesRequest", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.page_size", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3977, + serialized_end=4069, +) + + +_LISTEXAMPLESRESPONSE = _descriptor.Descriptor( + name="ListExamplesResponse", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="examples", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesResponse.examples", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4071, + serialized_end=4180, +) + + +_CREATEANNOTATIONSPECSETREQUEST = _descriptor.Descriptor( + name="CreateAnnotationSpecSetRequest", + full_name="google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.annotation_spec_set", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4183, + serialized_end=4314, +) + + +_GETANNOTATIONSPECSETREQUEST = _descriptor.Descriptor( + name="GetAnnotationSpecSetRequest", + full_name="google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4316, + serialized_end=4359, +) + + +_LISTANNOTATIONSPECSETSREQUEST = _descriptor.Descriptor( + name="ListAnnotationSpecSetsRequest", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.page_size", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4361, + serialized_end=4463, +) + + +_LISTANNOTATIONSPECSETSRESPONSE = _descriptor.Descriptor( + name="ListAnnotationSpecSetsResponse", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_sets", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.annotation_spec_sets", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4466, + serialized_end=4607, +) + + +_DELETEANNOTATIONSPECSETREQUEST = _descriptor.Descriptor( + name="DeleteAnnotationSpecSetRequest", + full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4609, + serialized_end=4655, +) + + +_CREATEINSTRUCTIONREQUEST = _descriptor.Descriptor( + name="CreateInstructionRequest", + full_name="google.cloud.datalabeling.v1beta1.CreateInstructionRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.CreateInstructionRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="instruction", + full_name="google.cloud.datalabeling.v1beta1.CreateInstructionRequest.instruction", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4657, + serialized_end=4768, +) + + +_GETINSTRUCTIONREQUEST = _descriptor.Descriptor( + name="GetInstructionRequest", + full_name="google.cloud.datalabeling.v1beta1.GetInstructionRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.GetInstructionRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4770, + serialized_end=4807, +) + + +_DELETEINSTRUCTIONREQUEST = _descriptor.Descriptor( + name="DeleteInstructionRequest", + full_name="google.cloud.datalabeling.v1beta1.DeleteInstructionRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.DeleteInstructionRequest.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4809, + serialized_end=4849, +) + + +_LISTINSTRUCTIONSREQUEST = _descriptor.Descriptor( + name="ListInstructionsRequest", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.parent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.filter", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.page_size", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4851, + serialized_end=4947, +) + + +_LISTINSTRUCTIONSRESPONSE = _descriptor.Descriptor( + name="ListInstructionsResponse", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="instructions", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsResponse.instructions", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4949, + serialized_end=5070, +) + +_CREATEDATASETREQUEST.fields_by_name[ + "dataset" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET +) +_LISTDATASETSRESPONSE.fields_by_name[ + "datasets" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET +) +_IMPORTDATAREQUEST.fields_by_name[ + "input_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._INPUTCONFIG +) +_EXPORTDATAREQUEST.fields_by_name[ + "output_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._OUTPUTCONFIG +) +_LISTDATAITEMSRESPONSE.fields_by_name[ + "data_items" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATAITEM +) +_LISTANNOTATEDDATASETSRESPONSE.fields_by_name[ + "annotated_datasets" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._ANNOTATEDDATASET +) +_LABELIMAGEREQUEST.fields_by_name[ + "image_classification_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._IMAGECLASSIFICATIONCONFIG +) +_LABELIMAGEREQUEST.fields_by_name[ + "bounding_poly_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._BOUNDINGPOLYCONFIG +) +_LABELIMAGEREQUEST.fields_by_name[ + "polyline_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._POLYLINECONFIG +) +_LABELIMAGEREQUEST.fields_by_name[ + "segmentation_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._SEGMENTATIONCONFIG +) +_LABELIMAGEREQUEST.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELIMAGEREQUEST.fields_by_name["feature"].enum_type = _LABELIMAGEREQUEST_FEATURE +_LABELIMAGEREQUEST_FEATURE.containing_type = _LABELIMAGEREQUEST +_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELIMAGEREQUEST.fields_by_name["image_classification_config"] +) +_LABELIMAGEREQUEST.fields_by_name[ + "image_classification_config" +].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] +_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELIMAGEREQUEST.fields_by_name["bounding_poly_config"] +) +_LABELIMAGEREQUEST.fields_by_name[ + "bounding_poly_config" +].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] +_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELIMAGEREQUEST.fields_by_name["polyline_config"] +) +_LABELIMAGEREQUEST.fields_by_name[ + "polyline_config" +].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] +_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELIMAGEREQUEST.fields_by_name["segmentation_config"] +) +_LABELIMAGEREQUEST.fields_by_name[ + "segmentation_config" +].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] +_LABELVIDEOREQUEST.fields_by_name[ + "video_classification_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._VIDEOCLASSIFICATIONCONFIG +) +_LABELVIDEOREQUEST.fields_by_name[ + "object_detection_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTDETECTIONCONFIG +) +_LABELVIDEOREQUEST.fields_by_name[ + "object_tracking_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTTRACKINGCONFIG +) +_LABELVIDEOREQUEST.fields_by_name[ + "event_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._EVENTCONFIG +) +_LABELVIDEOREQUEST.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELVIDEOREQUEST.fields_by_name["feature"].enum_type = _LABELVIDEOREQUEST_FEATURE +_LABELVIDEOREQUEST_FEATURE.containing_type = _LABELVIDEOREQUEST +_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELVIDEOREQUEST.fields_by_name["video_classification_config"] +) +_LABELVIDEOREQUEST.fields_by_name[ + "video_classification_config" +].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] +_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELVIDEOREQUEST.fields_by_name["object_detection_config"] +) +_LABELVIDEOREQUEST.fields_by_name[ + "object_detection_config" +].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] +_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELVIDEOREQUEST.fields_by_name["object_tracking_config"] +) +_LABELVIDEOREQUEST.fields_by_name[ + "object_tracking_config" +].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] +_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELVIDEOREQUEST.fields_by_name["event_config"] +) +_LABELVIDEOREQUEST.fields_by_name[ + "event_config" +].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] +_LABELTEXTREQUEST.fields_by_name[ + "text_classification_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTCLASSIFICATIONCONFIG +) +_LABELTEXTREQUEST.fields_by_name[ + "text_entity_extraction_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTENTITYEXTRACTIONCONFIG +) +_LABELTEXTREQUEST.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELTEXTREQUEST.fields_by_name["feature"].enum_type = _LABELTEXTREQUEST_FEATURE +_LABELTEXTREQUEST_FEATURE.containing_type = _LABELTEXTREQUEST +_LABELTEXTREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELTEXTREQUEST.fields_by_name["text_classification_config"] +) +_LABELTEXTREQUEST.fields_by_name[ + "text_classification_config" +].containing_oneof = _LABELTEXTREQUEST.oneofs_by_name["request_config"] +_LABELTEXTREQUEST.oneofs_by_name["request_config"].fields.append( + _LABELTEXTREQUEST.fields_by_name["text_entity_extraction_config"] +) +_LABELTEXTREQUEST.fields_by_name[ + "text_entity_extraction_config" +].containing_oneof = _LABELTEXTREQUEST.oneofs_by_name["request_config"] +_LABELAUDIOREQUEST.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELAUDIOREQUEST.fields_by_name["feature"].enum_type = _LABELAUDIOREQUEST_FEATURE +_LABELAUDIOREQUEST_FEATURE.containing_type = _LABELAUDIOREQUEST +_LISTEXAMPLESRESPONSE.fields_by_name[ + "examples" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._EXAMPLE +) +_CREATEANNOTATIONSPECSETREQUEST.fields_by_name[ + "annotation_spec_set" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET +) +_LISTANNOTATIONSPECSETSRESPONSE.fields_by_name[ + "annotation_spec_sets" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET +) +_CREATEINSTRUCTIONREQUEST.fields_by_name[ + "instruction" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2._INSTRUCTION +) +_LISTINSTRUCTIONSRESPONSE.fields_by_name[ + "instructions" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2._INSTRUCTION +) +DESCRIPTOR.message_types_by_name["CreateDatasetRequest"] = _CREATEDATASETREQUEST +DESCRIPTOR.message_types_by_name["GetDatasetRequest"] = _GETDATASETREQUEST +DESCRIPTOR.message_types_by_name["ListDatasetsRequest"] = _LISTDATASETSREQUEST +DESCRIPTOR.message_types_by_name["ListDatasetsResponse"] = _LISTDATASETSRESPONSE +DESCRIPTOR.message_types_by_name["DeleteDatasetRequest"] = _DELETEDATASETREQUEST +DESCRIPTOR.message_types_by_name["ImportDataRequest"] = _IMPORTDATAREQUEST +DESCRIPTOR.message_types_by_name["ExportDataRequest"] = _EXPORTDATAREQUEST +DESCRIPTOR.message_types_by_name["GetDataItemRequest"] = _GETDATAITEMREQUEST +DESCRIPTOR.message_types_by_name["ListDataItemsRequest"] = _LISTDATAITEMSREQUEST +DESCRIPTOR.message_types_by_name["ListDataItemsResponse"] = _LISTDATAITEMSRESPONSE +DESCRIPTOR.message_types_by_name[ + "GetAnnotatedDatasetRequest" +] = _GETANNOTATEDDATASETREQUEST +DESCRIPTOR.message_types_by_name[ + "ListAnnotatedDatasetsRequest" +] = _LISTANNOTATEDDATASETSREQUEST +DESCRIPTOR.message_types_by_name[ + "DeleteAnnotatedDatasetRequest" +] = _DELETEANNOTATEDDATASETREQUEST +DESCRIPTOR.message_types_by_name[ + "ListAnnotatedDatasetsResponse" +] = _LISTANNOTATEDDATASETSRESPONSE +DESCRIPTOR.message_types_by_name["LabelImageRequest"] = _LABELIMAGEREQUEST +DESCRIPTOR.message_types_by_name["LabelVideoRequest"] = _LABELVIDEOREQUEST +DESCRIPTOR.message_types_by_name["LabelTextRequest"] = _LABELTEXTREQUEST +DESCRIPTOR.message_types_by_name["LabelAudioRequest"] = _LABELAUDIOREQUEST +DESCRIPTOR.message_types_by_name["GetExampleRequest"] = _GETEXAMPLEREQUEST +DESCRIPTOR.message_types_by_name["ListExamplesRequest"] = _LISTEXAMPLESREQUEST +DESCRIPTOR.message_types_by_name["ListExamplesResponse"] = _LISTEXAMPLESRESPONSE +DESCRIPTOR.message_types_by_name[ + "CreateAnnotationSpecSetRequest" +] = _CREATEANNOTATIONSPECSETREQUEST +DESCRIPTOR.message_types_by_name[ + "GetAnnotationSpecSetRequest" +] = _GETANNOTATIONSPECSETREQUEST +DESCRIPTOR.message_types_by_name[ + "ListAnnotationSpecSetsRequest" +] = _LISTANNOTATIONSPECSETSREQUEST +DESCRIPTOR.message_types_by_name[ + "ListAnnotationSpecSetsResponse" +] = _LISTANNOTATIONSPECSETSRESPONSE +DESCRIPTOR.message_types_by_name[ + "DeleteAnnotationSpecSetRequest" +] = _DELETEANNOTATIONSPECSETREQUEST +DESCRIPTOR.message_types_by_name["CreateInstructionRequest"] = _CREATEINSTRUCTIONREQUEST +DESCRIPTOR.message_types_by_name["GetInstructionRequest"] = _GETINSTRUCTIONREQUEST +DESCRIPTOR.message_types_by_name["DeleteInstructionRequest"] = _DELETEINSTRUCTIONREQUEST +DESCRIPTOR.message_types_by_name["ListInstructionsRequest"] = _LISTINSTRUCTIONSREQUEST +DESCRIPTOR.message_types_by_name["ListInstructionsResponse"] = _LISTINSTRUCTIONSRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CreateDatasetRequest = _reflection.GeneratedProtocolMessageType( + "CreateDatasetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_CREATEDATASETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for CreateDataset. + + + Attributes: + parent: + Required. Dataset resource parent, format: + projects/{project\_id} + dataset: + Required. The dataset to be created. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateDatasetRequest) + ), +) +_sym_db.RegisterMessage(CreateDatasetRequest) + +GetDatasetRequest = _reflection.GeneratedProtocolMessageType( + "GetDatasetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETDATASETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for GetDataSet. + + + Attributes: + name: + Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetDatasetRequest) + ), +) +_sym_db.RegisterMessage(GetDatasetRequest) + +ListDatasetsRequest = _reflection.GeneratedProtocolMessageType( + "ListDatasetsRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTDATASETSREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ListDataset. + + + Attributes: + parent: + Required. Dataset resource parent, format: + projects/{project\_id} + filter: + Optional. Filter on dataset is not supported at this moment. + page_size: + Optional. Requested page size. Server may return fewer results + than requested. Default value is 100. + page_token: + Optional. A token identifying a page of results for the server + to return. Typically obtained by [ListDatasetsResponse.next\_p + age\_token][google.cloud.datalabeling.v1beta1.ListDatasetsResp + onse.next\_page\_token] of the previous + [DataLabelingService.ListDatasets] call. Returns the first + page if empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDatasetsRequest) + ), +) +_sym_db.RegisterMessage(ListDatasetsRequest) + +ListDatasetsResponse = _reflection.GeneratedProtocolMessageType( + "ListDatasetsResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTDATASETSRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Results of listing datasets within a project. + + + Attributes: + datasets: + The list of datasets to return. + next_page_token: + A token to retrieve next page of results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDatasetsResponse) + ), +) +_sym_db.RegisterMessage(ListDatasetsResponse) + +DeleteDatasetRequest = _reflection.GeneratedProtocolMessageType( + "DeleteDatasetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETEDATASETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for DeleteDataset. + + + Attributes: + name: + Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteDatasetRequest) + ), +) +_sym_db.RegisterMessage(DeleteDatasetRequest) + +ImportDataRequest = _reflection.GeneratedProtocolMessageType( + "ImportDataRequest", + (_message.Message,), + dict( + DESCRIPTOR=_IMPORTDATAREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ImportData API. + + + Attributes: + name: + Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + input_config: + Required. Specify the input source of the data. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImportDataRequest) + ), +) +_sym_db.RegisterMessage(ImportDataRequest) + +ExportDataRequest = _reflection.GeneratedProtocolMessageType( + "ExportDataRequest", + (_message.Message,), + dict( + DESCRIPTOR=_EXPORTDATAREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ExportData API. + + + Attributes: + name: + Required. Dataset resource name, format: + projects/{project\_id}/datasets/{dataset\_id} + annotated_dataset: + Required. Annotated dataset resource name. DataItem in Dataset + and their annotations in specified annotated dataset will be + exported. It's in format of projects/{project\_id}/datasets/{d + ataset\_id}/annotatedDatasets/ {annotated\_dataset\_id} + filter: + Optional. Filter is not supported at this moment. + output_config: + Required. Specify the output destination. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ExportDataRequest) + ), +) +_sym_db.RegisterMessage(ExportDataRequest) + +GetDataItemRequest = _reflection.GeneratedProtocolMessageType( + "GetDataItemRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETDATAITEMREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for GetDataItem. + + + Attributes: + name: + Required. The name of the data item to get, format: projects/{ + project\_id}/datasets/{dataset\_id}/dataItems/{data\_item\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetDataItemRequest) + ), +) +_sym_db.RegisterMessage(GetDataItemRequest) + +ListDataItemsRequest = _reflection.GeneratedProtocolMessageType( + "ListDataItemsRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTDATAITEMSREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ListDataItems. + + + Attributes: + parent: + Required. Name of the dataset to list data items, format: + projects/{project\_id}/datasets/{dataset\_id} + filter: + Optional. Filter is not supported at this moment. + page_size: + Optional. Requested page size. Server may return fewer results + than requested. Default value is 100. + page_token: + Optional. A token identifying a page of results for the server + to return. Typically obtained by [ListDataItemsResponse.next\_ + page\_token][google.cloud.datalabeling.v1beta1.ListDataItemsRe + sponse.next\_page\_token] of the previous + [DataLabelingService.ListDataItems] call. Return first page if + empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDataItemsRequest) + ), +) +_sym_db.RegisterMessage(ListDataItemsRequest) + +ListDataItemsResponse = _reflection.GeneratedProtocolMessageType( + "ListDataItemsResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTDATAITEMSRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Results of listing data items in a dataset. + + + Attributes: + data_items: + The list of data items to return. + next_page_token: + A token to retrieve next page of results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDataItemsResponse) + ), +) +_sym_db.RegisterMessage(ListDataItemsResponse) + +GetAnnotatedDatasetRequest = _reflection.GeneratedProtocolMessageType( + "GetAnnotatedDatasetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETANNOTATEDDATASETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for GetAnnotatedDataset. + + + Attributes: + name: + Required. Name of the annotated dataset to get, format: projec + ts/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest) + ), +) +_sym_db.RegisterMessage(GetAnnotatedDatasetRequest) + +ListAnnotatedDatasetsRequest = _reflection.GeneratedProtocolMessageType( + "ListAnnotatedDatasetsRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTANNOTATEDDATASETSREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ListAnnotatedDatasets. + + + Attributes: + parent: + Required. Name of the dataset to list annotated datasets, + format: projects/{project\_id}/datasets/{dataset\_id} + filter: + Optional. Filter is not supported at this moment. + page_size: + Optional. Requested page size. Server may return fewer results + than requested. Default value is 100. + page_token: + Optional. A token identifying a page of results for the server + to return. Typically obtained by [ListAnnotatedDatasetsRespons + e.next\_page\_token][google.cloud.datalabeling.v1beta1.ListAnn + otatedDatasetsResponse.next\_page\_token] of the previous + [DataLabelingService.ListAnnotatedDatasets] call. Return first + page if empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest) + ), +) +_sym_db.RegisterMessage(ListAnnotatedDatasetsRequest) + +DeleteAnnotatedDatasetRequest = _reflection.GeneratedProtocolMessageType( + "DeleteAnnotatedDatasetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETEANNOTATEDDATASETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for DeleteAnnotatedDataset. + + + Attributes: + name: + Required. Name of the annotated dataset to delete, format: pro + jects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest) + ), +) +_sym_db.RegisterMessage(DeleteAnnotatedDatasetRequest) + +ListAnnotatedDatasetsResponse = _reflection.GeneratedProtocolMessageType( + "ListAnnotatedDatasetsResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTANNOTATEDDATASETSRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Results of listing annotated datasets for a dataset. + + + Attributes: + annotated_datasets: + The list of annotated datasets to return. + next_page_token: + A token to retrieve next page of results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse) + ), +) +_sym_db.RegisterMessage(ListAnnotatedDatasetsResponse) + +LabelImageRequest = _reflection.GeneratedProtocolMessageType( + "LabelImageRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGEREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for starting an image labeling task. + + + Attributes: + request_config: + Required. Config for labeling tasks. The type of request + config must match the selected feature. + image_classification_config: + Configuration for image classification task. One of + image\_classification\_config, bounding\_poly\_config, + polyline\_config and segmentation\_config is required. + bounding_poly_config: + Configuration for bounding box and bounding poly task. One of + image\_classification\_config, bounding\_poly\_config, + polyline\_config and segmentation\_config is required. + polyline_config: + Configuration for polyline task. One of + image\_classification\_config, bounding\_poly\_config, + polyline\_config and segmentation\_config is required. + segmentation_config: + Configuration for segmentation task. One of + image\_classification\_config, bounding\_poly\_config, + polyline\_config and segmentation\_config is required. + parent: + Required. Name of the dataset to request labeling task, + format: projects/{project\_id}/datasets/{dataset\_id} + basic_config: + Required. Basic human annotation config. + feature: + Required. The type of image labeling task. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageRequest) + ), +) +_sym_db.RegisterMessage(LabelImageRequest) + +LabelVideoRequest = _reflection.GeneratedProtocolMessageType( + "LabelVideoRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LABELVIDEOREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for LabelVideo. + + + Attributes: + request_config: + Required. Config for labeling tasks. The type of request + config must match the selected feature. + video_classification_config: + Configuration for video classification task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + object_detection_config: + Configuration for video object detection task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + object_tracking_config: + Configuration for video object tracking task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + event_config: + Configuration for video event task. One of + video\_classification\_config, object\_detection\_config, + object\_tracking\_config and event\_config is required. + parent: + Required. Name of the dataset to request labeling task, + format: projects/{project\_id}/datasets/{dataset\_id} + basic_config: + Required. Basic human annotation config. + feature: + Required. The type of video labeling task. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoRequest) + ), +) +_sym_db.RegisterMessage(LabelVideoRequest) + +LabelTextRequest = _reflection.GeneratedProtocolMessageType( + "LabelTextRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LABELTEXTREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for LabelText. + + + Attributes: + request_config: + Required. Config for labeling tasks. The type of request + config must match the selected feature. + text_classification_config: + Configuration for text classification task. One of + text\_classification\_config and + text\_entity\_extraction\_config is required. + text_entity_extraction_config: + Configuration for entity extraction task. One of + text\_classification\_config and + text\_entity\_extraction\_config is required. + parent: + Required. Name of the data set to request labeling task, + format: projects/{project\_id}/datasets/{dataset\_id} + basic_config: + Required. Basic human annotation config. + feature: + Required. The type of text labeling task. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelTextRequest) + ), +) +_sym_db.RegisterMessage(LabelTextRequest) + +LabelAudioRequest = _reflection.GeneratedProtocolMessageType( + "LabelAudioRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LABELAUDIOREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for LabelAudio. + + + Attributes: + parent: + Required. Name of the dataset to request labeling task, + format: projects/{project\_id}/datasets/{dataset\_id} + basic_config: + Required. Basic human annotation config. + feature: + Required. The type of audio labeling task. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelAudioRequest) + ), +) +_sym_db.RegisterMessage(LabelAudioRequest) + +GetExampleRequest = _reflection.GeneratedProtocolMessageType( + "GetExampleRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETEXAMPLEREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for GetExample + + + Attributes: + name: + Required. Name of example, format: projects/{project\_id}/data + sets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id}/examples/{example\_id} + filter: + Optional. An expression for filtering Examples. Filter by + annotation\_spec.display\_name is supported. Format + "annotation\_spec.display\_name = {display\_name}" + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetExampleRequest) + ), +) +_sym_db.RegisterMessage(GetExampleRequest) + +ListExamplesRequest = _reflection.GeneratedProtocolMessageType( + "ListExamplesRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTEXAMPLESREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ListExamples. + + + Attributes: + parent: + Required. Example resource parent. + filter: + Optional. An expression for filtering Examples. For annotated + datasets that have annotation spec set, filter by + annotation\_spec.display\_name is supported. Format + "annotation\_spec.display\_name = {display\_name}" + page_size: + Optional. Requested page size. Server may return fewer results + than requested. Default value is 100. + page_token: + Optional. A token identifying a page of results for the server + to return. Typically obtained by [ListExamplesResponse.next\_p + age\_token][google.cloud.datalabeling.v1beta1.ListExamplesResp + onse.next\_page\_token] of the previous + [DataLabelingService.ListExamples] call. Return first page if + empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListExamplesRequest) + ), +) +_sym_db.RegisterMessage(ListExamplesRequest) + +ListExamplesResponse = _reflection.GeneratedProtocolMessageType( + "ListExamplesResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTEXAMPLESRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Results of listing Examples in and annotated dataset. + + + Attributes: + examples: + The list of examples to return. + next_page_token: + A token to retrieve next page of results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListExamplesResponse) + ), +) +_sym_db.RegisterMessage(ListExamplesResponse) + +CreateAnnotationSpecSetRequest = _reflection.GeneratedProtocolMessageType( + "CreateAnnotationSpecSetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_CREATEANNOTATIONSPECSETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for CreateAnnotationSpecSet. + + + Attributes: + parent: + Required. AnnotationSpecSet resource parent, format: + projects/{project\_id} + annotation_spec_set: + Required. Annotation spec set to create. Annotation specs must + be included. Only one annotation spec will be accepted for + annotation specs with same display\_name. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest) + ), +) +_sym_db.RegisterMessage(CreateAnnotationSpecSetRequest) + +GetAnnotationSpecSetRequest = _reflection.GeneratedProtocolMessageType( + "GetAnnotationSpecSetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETANNOTATIONSPECSETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for GetAnnotationSpecSet. + + + Attributes: + name: + Required. AnnotationSpecSet resource name, format: projects/{p + roject\_id}/annotationSpecSets/{annotation\_spec\_set\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest) + ), +) +_sym_db.RegisterMessage(GetAnnotationSpecSetRequest) + +ListAnnotationSpecSetsRequest = _reflection.GeneratedProtocolMessageType( + "ListAnnotationSpecSetsRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTANNOTATIONSPECSETSREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ListAnnotationSpecSets. + + + Attributes: + parent: + Required. Parent of AnnotationSpecSet resource, format: + projects/{project\_id} + filter: + Optional. Filter is not supported at this moment. + page_size: + Optional. Requested page size. Server may return fewer results + than requested. Default value is 100. + page_token: + Optional. A token identifying a page of results for the server + to return. Typically obtained by [ListAnnotationSpecSetsRespon + se.next\_page\_token][google.cloud.datalabeling.v1beta1.ListAn + notationSpecSetsResponse.next\_page\_token] of the previous + [DataLabelingService.ListAnnotationSpecSets] call. Return + first page if empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest) + ), +) +_sym_db.RegisterMessage(ListAnnotationSpecSetsRequest) + +ListAnnotationSpecSetsResponse = _reflection.GeneratedProtocolMessageType( + "ListAnnotationSpecSetsResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTANNOTATIONSPECSETSRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Results of listing annotation spec set under a project. + + + Attributes: + annotation_spec_sets: + The list of annotation spec sets. + next_page_token: + A token to retrieve next page of results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse) + ), +) +_sym_db.RegisterMessage(ListAnnotationSpecSetsResponse) + +DeleteAnnotationSpecSetRequest = _reflection.GeneratedProtocolMessageType( + "DeleteAnnotationSpecSetRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETEANNOTATIONSPECSETREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for DeleteAnnotationSpecSet. + + + Attributes: + name: + Required. AnnotationSpec resource name, format: ``projects/{pr + oject_id}/annotationSpecSets/{annotation_spec_set_id}``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest) + ), +) +_sym_db.RegisterMessage(DeleteAnnotationSpecSetRequest) + +CreateInstructionRequest = _reflection.GeneratedProtocolMessageType( + "CreateInstructionRequest", + (_message.Message,), + dict( + DESCRIPTOR=_CREATEINSTRUCTIONREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for CreateInstruction. + + + Attributes: + parent: + Required. Instruction resource parent, format: + projects/{project\_id} + instruction: + Required. Instruction of how to perform the labeling task. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateInstructionRequest) + ), +) +_sym_db.RegisterMessage(CreateInstructionRequest) + +GetInstructionRequest = _reflection.GeneratedProtocolMessageType( + "GetInstructionRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETINSTRUCTIONREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for GetInstruction. + + + Attributes: + name: + Required. Instruction resource name, format: + projects/{project\_id}/instructions/{instruction\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetInstructionRequest) + ), +) +_sym_db.RegisterMessage(GetInstructionRequest) + +DeleteInstructionRequest = _reflection.GeneratedProtocolMessageType( + "DeleteInstructionRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETEINSTRUCTIONREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for DeleteInstruction. + + + Attributes: + name: + Required. Instruction resource name, format: + projects/{project\_id}/instructions/{instruction\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteInstructionRequest) + ), +) +_sym_db.RegisterMessage(DeleteInstructionRequest) + +ListInstructionsRequest = _reflection.GeneratedProtocolMessageType( + "ListInstructionsRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTINSTRUCTIONSREQUEST, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Request message for ListInstructions. + + + Attributes: + parent: + Required. Instruction resource parent, format: + projects/{project\_id} + filter: + Optional. Filter is not supported at this moment. + page_size: + Optional. Requested page size. Server may return fewer results + than requested. Default value is 100. + page_token: + Optional. A token identifying a page of results for the server + to return. Typically obtained by [ListInstructionsResponse.nex + t\_page\_token][google.cloud.datalabeling.v1beta1.ListInstruct + ionsResponse.next\_page\_token] of the previous + [DataLabelingService.ListInstructions] call. Return first page + if empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListInstructionsRequest) + ), +) +_sym_db.RegisterMessage(ListInstructionsRequest) + +ListInstructionsResponse = _reflection.GeneratedProtocolMessageType( + "ListInstructionsResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTINSTRUCTIONSRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", + __doc__="""Results of listing instructions under a project. + + + Attributes: + instructions: + The list of Instructions to return. + next_page_token: + A token to retrieve next page of results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListInstructionsResponse) + ), +) +_sym_db.RegisterMessage(ListInstructionsResponse) + + +DESCRIPTOR._options = None + +_DATALABELINGSERVICE = _descriptor.ServiceDescriptor( + name="DataLabelingService", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService", + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=5073, + serialized_end=9599, + methods=[ + _descriptor.MethodDescriptor( + name="CreateDataset", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateDataset", + index=0, + containing_service=None, + input_type=_CREATEDATASETREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET, + serialized_options=_b( + '\202\323\344\223\002*"%/v1beta1/{parent=projects/*}/datasets:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="GetDataset", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataset", + index=1, + containing_service=None, + input_type=_GETDATASETREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET, + serialized_options=_b( + "\202\323\344\223\002'\022%/v1beta1/{name=projects/*/datasets/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListDatasets", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListDatasets", + index=2, + containing_service=None, + input_type=_LISTDATASETSREQUEST, + output_type=_LISTDATASETSRESPONSE, + serialized_options=_b( + "\202\323\344\223\002'\022%/v1beta1/{parent=projects/*}/datasets" + ), + ), + _descriptor.MethodDescriptor( + name="DeleteDataset", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteDataset", + index=3, + containing_service=None, + input_type=_DELETEDATASETREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\002'*%/v1beta1/{name=projects/*/datasets/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ImportData", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ImportData", + index=4, + containing_service=None, + input_type=_IMPORTDATAREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\0025"0/v1beta1/{name=projects/*/datasets/*}:importData:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="ExportData", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ExportData", + index=5, + containing_service=None, + input_type=_EXPORTDATAREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\0025"0/v1beta1/{name=projects/*/datasets/*}:exportData:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="GetDataItem", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataItem", + index=6, + containing_service=None, + input_type=_GETDATAITEMREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATAITEM, + serialized_options=_b( + "\202\323\344\223\0023\0221/v1beta1/{name=projects/*/datasets/*/dataItems/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListDataItems", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListDataItems", + index=7, + containing_service=None, + input_type=_LISTDATAITEMSREQUEST, + output_type=_LISTDATAITEMSRESPONSE, + serialized_options=_b( + "\202\323\344\223\0023\0221/v1beta1/{parent=projects/*/datasets/*}/dataItems" + ), + ), + _descriptor.MethodDescriptor( + name="GetAnnotatedDataset", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotatedDataset", + index=8, + containing_service=None, + input_type=_GETANNOTATEDDATASETREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._ANNOTATEDDATASET, + serialized_options=_b( + "\202\323\344\223\002;\0229/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListAnnotatedDatasets", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotatedDatasets", + index=9, + containing_service=None, + input_type=_LISTANNOTATEDDATASETSREQUEST, + output_type=_LISTANNOTATEDDATASETSRESPONSE, + serialized_options=_b( + "\202\323\344\223\002;\0229/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" + ), + ), + _descriptor.MethodDescriptor( + name="DeleteAnnotatedDataset", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotatedDataset", + index=10, + containing_service=None, + input_type=_DELETEANNOTATEDDATASETREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\002;*9/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + ), + ), + _descriptor.MethodDescriptor( + name="LabelImage", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelImage", + index=11, + containing_service=None, + input_type=_LABELIMAGEREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\0028"3/v1beta1/{parent=projects/*/datasets/*}/image:label:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="LabelVideo", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelVideo", + index=12, + containing_service=None, + input_type=_LABELVIDEOREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\0028"3/v1beta1/{parent=projects/*/datasets/*}/video:label:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="LabelText", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelText", + index=13, + containing_service=None, + input_type=_LABELTEXTREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\0027"2/v1beta1/{parent=projects/*/datasets/*}/text:label:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="LabelAudio", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelAudio", + index=14, + containing_service=None, + input_type=_LABELAUDIOREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\0028"3/v1beta1/{parent=projects/*/datasets/*}/audio:label:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="GetExample", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetExample", + index=15, + containing_service=None, + input_type=_GETEXAMPLEREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._EXAMPLE, + serialized_options=_b( + "\202\323\344\223\002F\022D/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListExamples", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListExamples", + index=16, + containing_service=None, + input_type=_LISTEXAMPLESREQUEST, + output_type=_LISTEXAMPLESRESPONSE, + serialized_options=_b( + "\202\323\344\223\002F\022D/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" + ), + ), + _descriptor.MethodDescriptor( + name="CreateAnnotationSpecSet", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateAnnotationSpecSet", + index=17, + containing_service=None, + input_type=_CREATEANNOTATIONSPECSETREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET, + serialized_options=_b( + '\202\323\344\223\0024"//v1beta1/{parent=projects/*}/annotationSpecSets:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="GetAnnotationSpecSet", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotationSpecSet", + index=18, + containing_service=None, + input_type=_GETANNOTATIONSPECSETREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET, + serialized_options=_b( + "\202\323\344\223\0021\022//v1beta1/{name=projects/*/annotationSpecSets/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListAnnotationSpecSets", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotationSpecSets", + index=19, + containing_service=None, + input_type=_LISTANNOTATIONSPECSETSREQUEST, + output_type=_LISTANNOTATIONSPECSETSRESPONSE, + serialized_options=_b( + "\202\323\344\223\0021\022//v1beta1/{parent=projects/*}/annotationSpecSets" + ), + ), + _descriptor.MethodDescriptor( + name="DeleteAnnotationSpecSet", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotationSpecSet", + index=20, + containing_service=None, + input_type=_DELETEANNOTATIONSPECSETREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\0021*//v1beta1/{name=projects/*/annotationSpecSets/*}" + ), + ), + _descriptor.MethodDescriptor( + name="CreateInstruction", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateInstruction", + index=21, + containing_service=None, + input_type=_CREATEINSTRUCTIONREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=_b( + '\202\323\344\223\002.")/v1beta1/{parent=projects/*}/instructions:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="GetInstruction", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetInstruction", + index=22, + containing_service=None, + input_type=_GETINSTRUCTIONREQUEST, + output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2._INSTRUCTION, + serialized_options=_b( + "\202\323\344\223\002+\022)/v1beta1/{name=projects/*/instructions/*}" + ), + ), + _descriptor.MethodDescriptor( + name="ListInstructions", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListInstructions", + index=23, + containing_service=None, + input_type=_LISTINSTRUCTIONSREQUEST, + output_type=_LISTINSTRUCTIONSRESPONSE, + serialized_options=_b( + "\202\323\344\223\002+\022)/v1beta1/{parent=projects/*}/instructions" + ), + ), + _descriptor.MethodDescriptor( + name="DeleteInstruction", + full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteInstruction", + index=24, + containing_service=None, + input_type=_DELETEINSTRUCTIONREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\002+*)/v1beta1/{name=projects/*/instructions/*}" + ), + ), + ], +) +_sym_db.RegisterServiceDescriptor(_DATALABELINGSERVICE) + +DESCRIPTOR.services_by_name["DataLabelingService"] = _DATALABELINGSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py new file mode 100644 index 000000000000..2ae337110cc5 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py @@ -0,0 +1,480 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from google.cloud.datalabeling_v1beta1.proto import ( + annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + data_labeling_service_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + instruction_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2, +) +from google.longrunning import ( + operations_pb2 as google_dot_longrunning_dot_operations__pb2, +) +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class DataLabelingServiceStub(object): + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateDataset = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateDataset", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateDatasetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, + ) + self.GetDataset = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetDataset", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDatasetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, + ) + self.ListDatasets = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListDatasets", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsResponse.FromString, + ) + self.DeleteDataset = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteDataset", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteDatasetRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.ImportData = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ImportData", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ImportDataRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.ExportData = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ExportData", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ExportDataRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.GetDataItem = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetDataItem", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDataItemRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DataItem.FromString, + ) + self.ListDataItems = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListDataItems", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsResponse.FromString, + ) + self.GetAnnotatedDataset = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetAnnotatedDataset", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotatedDatasetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.AnnotatedDataset.FromString, + ) + self.ListAnnotatedDatasets = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListAnnotatedDatasets", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsResponse.FromString, + ) + self.DeleteAnnotatedDataset = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteAnnotatedDataset", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotatedDatasetRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.LabelImage = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelImage", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelImageRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.LabelVideo = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelVideo", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelVideoRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.LabelText = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelText", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelTextRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.LabelAudio = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelAudio", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelAudioRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.GetExample = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetExample", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetExampleRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Example.FromString, + ) + self.ListExamples = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListExamples", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesResponse.FromString, + ) + self.CreateAnnotationSpecSet = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateAnnotationSpecSet", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateAnnotationSpecSetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.FromString, + ) + self.GetAnnotationSpecSet = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetAnnotationSpecSet", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotationSpecSetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.FromString, + ) + self.ListAnnotationSpecSets = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListAnnotationSpecSets", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsResponse.FromString, + ) + self.DeleteAnnotationSpecSet = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteAnnotationSpecSet", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotationSpecSetRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.CreateInstruction = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateInstruction", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateInstructionRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.GetInstruction = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetInstruction", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetInstructionRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.Instruction.FromString, + ) + self.ListInstructions = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListInstructions", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsResponse.FromString, + ) + self.DeleteInstruction = channel.unary_unary( + "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteInstruction", + request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteInstructionRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + + +class DataLabelingServiceServicer(object): + # missing associated documentation comment in .proto file + pass + + def CreateDataset(self, request, context): + """Creates dataset. If success return a Dataset resource. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetDataset(self, request, context): + """Gets dataset by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListDatasets(self, request, context): + """Lists datasets under a project. Pagination is supported. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteDataset(self, request, context): + """Deletes a dataset by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ImportData(self, request, context): + """Imports data into dataset based on source locations defined in request. + It can be called multiple times for the same dataset. Each dataset can + only have one long running operation running on it. For example, no + labeling task (also long running operation) can be started while + importing is still ongoing. Vice versa. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ExportData(self, request, context): + """Exports data and annotations from dataset. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetDataItem(self, request, context): + """Gets a data item in a dataset by resource name. This API can be + called after data are imported into dataset. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListDataItems(self, request, context): + """Lists data items in a dataset. This API can be called after data + are imported into dataset. Pagination is supported. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetAnnotatedDataset(self, request, context): + """Gets an annotated dataset by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListAnnotatedDatasets(self, request, context): + """Lists annotated datasets for a dataset. Pagination is supported. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteAnnotatedDataset(self, request, context): + """Deletes an annotated dataset by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def LabelImage(self, request, context): + """Starts a labeling task for image. The type of image labeling task is + configured by feature in the request. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def LabelVideo(self, request, context): + """Starts a labeling task for video. The type of video labeling task is + configured by feature in the request. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def LabelText(self, request, context): + """Starts a labeling task for text. The type of text labeling task is + configured by feature in the request. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def LabelAudio(self, request, context): + """Starts a labeling task for audio. The type of audio labeling task is + configured by feature in the request. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetExample(self, request, context): + """Gets an example by resource name, including both data and annotation. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListExamples(self, request, context): + """Lists examples in an annotated dataset. Pagination is supported. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def CreateAnnotationSpecSet(self, request, context): + """Creates an annotation spec set by providing a set of labels. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetAnnotationSpecSet(self, request, context): + """Gets an annotation spec set by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListAnnotationSpecSets(self, request, context): + """Lists annotation spec sets for a project. Pagination is supported. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteAnnotationSpecSet(self, request, context): + """Deletes an annotation spec set by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def CreateInstruction(self, request, context): + """Creates an instruction for how data should be labeled. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetInstruction(self, request, context): + """Gets an instruction by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListInstructions(self, request, context): + """Lists instructions for a project. Pagination is supported. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteInstruction(self, request, context): + """Deletes an instruction object by resource name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_DataLabelingServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + "CreateDataset": grpc.unary_unary_rpc_method_handler( + servicer.CreateDataset, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateDatasetRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, + ), + "GetDataset": grpc.unary_unary_rpc_method_handler( + servicer.GetDataset, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDatasetRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, + ), + "ListDatasets": grpc.unary_unary_rpc_method_handler( + servicer.ListDatasets, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsResponse.SerializeToString, + ), + "DeleteDataset": grpc.unary_unary_rpc_method_handler( + servicer.DeleteDataset, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteDatasetRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + "ImportData": grpc.unary_unary_rpc_method_handler( + servicer.ImportData, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ImportDataRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "ExportData": grpc.unary_unary_rpc_method_handler( + servicer.ExportData, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ExportDataRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "GetDataItem": grpc.unary_unary_rpc_method_handler( + servicer.GetDataItem, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDataItemRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DataItem.SerializeToString, + ), + "ListDataItems": grpc.unary_unary_rpc_method_handler( + servicer.ListDataItems, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsResponse.SerializeToString, + ), + "GetAnnotatedDataset": grpc.unary_unary_rpc_method_handler( + servicer.GetAnnotatedDataset, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotatedDatasetRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.AnnotatedDataset.SerializeToString, + ), + "ListAnnotatedDatasets": grpc.unary_unary_rpc_method_handler( + servicer.ListAnnotatedDatasets, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsResponse.SerializeToString, + ), + "DeleteAnnotatedDataset": grpc.unary_unary_rpc_method_handler( + servicer.DeleteAnnotatedDataset, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotatedDatasetRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + "LabelImage": grpc.unary_unary_rpc_method_handler( + servicer.LabelImage, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelImageRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "LabelVideo": grpc.unary_unary_rpc_method_handler( + servicer.LabelVideo, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelVideoRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "LabelText": grpc.unary_unary_rpc_method_handler( + servicer.LabelText, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelTextRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "LabelAudio": grpc.unary_unary_rpc_method_handler( + servicer.LabelAudio, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelAudioRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "GetExample": grpc.unary_unary_rpc_method_handler( + servicer.GetExample, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetExampleRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Example.SerializeToString, + ), + "ListExamples": grpc.unary_unary_rpc_method_handler( + servicer.ListExamples, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesResponse.SerializeToString, + ), + "CreateAnnotationSpecSet": grpc.unary_unary_rpc_method_handler( + servicer.CreateAnnotationSpecSet, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateAnnotationSpecSetRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.SerializeToString, + ), + "GetAnnotationSpecSet": grpc.unary_unary_rpc_method_handler( + servicer.GetAnnotationSpecSet, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotationSpecSetRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.SerializeToString, + ), + "ListAnnotationSpecSets": grpc.unary_unary_rpc_method_handler( + servicer.ListAnnotationSpecSets, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsResponse.SerializeToString, + ), + "DeleteAnnotationSpecSet": grpc.unary_unary_rpc_method_handler( + servicer.DeleteAnnotationSpecSet, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotationSpecSetRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + "CreateInstruction": grpc.unary_unary_rpc_method_handler( + servicer.CreateInstruction, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateInstructionRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + "GetInstruction": grpc.unary_unary_rpc_method_handler( + servicer.GetInstruction, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetInstructionRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.Instruction.SerializeToString, + ), + "ListInstructions": grpc.unary_unary_rpc_method_handler( + servicer.ListInstructions, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsRequest.FromString, + response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsResponse.SerializeToString, + ), + "DeleteInstruction": grpc.unary_unary_rpc_method_handler( + servicer.DeleteInstruction, + request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteInstructionRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "google.cloud.datalabeling.v1beta1.DataLabelingService", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto new file mode 100644 index 000000000000..952daf38d626 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto @@ -0,0 +1,306 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/annotation.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +enum DataType { + DATA_TYPE_UNSPECIFIED = 0; + + IMAGE = 1; + + VIDEO = 2; + + TEXT = 4; + + AUDIO = 5; +} + +// Dataset is the resource to hold your data. You can request multiple labeling +// tasks for a dataset while each one will generate an AnnotatedDataset. +message Dataset { + // Output only. + // Dataset resource name, format is: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. The display name of the dataset. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the annotation specification set. + // The description can be up to 10000 characters long. + string description = 3; + + // Output only. Time the dataset is created. + google.protobuf.Timestamp create_time = 4; + + // Output only. This is populated with the original input configs + // where ImportData is called. It is available only after the clients + // import data to this dataset. + repeated InputConfig input_configs = 5; +} + +// The configuration of input data, including data type, location, etc. +message InputConfig { + // Required. Where the data is from. + oneof source { + GcsSource gcs_source = 2; + } + + // Required. Data type must be specifed when user tries to import data. + DataType data_type = 1; +} + +// Source of the GCS file to be imported. Only gcs path is allowed in +// input_uri. +message GcsSource { + // Required. The input uri of source file. + string input_uri = 1; + + // Required. The format of the gcs source. Only "text/csv" is supported. + string mime_type = 2; +} + +// The configuration of output data. +message OutputConfig { + // Required. Location to output data to. + oneof destination { + // Output to a GCS file. Should be used for labeling output other than Audio + // transcription. + GcsDestination gcs_destination = 1; + + // Output to a GCS folder. Should be used for Audio transcription + // labeling output. + GcsFolderDestination gcs_folder_destination = 2; + } +} + +// Export destination of the data.Only gcs path is allowed in +// output_uri. +message GcsDestination { + // Required. The output uri of destination file. + string output_uri = 1; + + // Required. The format of the gcs destination. Only "text/csv" and + // "application/json" + // are supported. + string mime_type = 2; +} + +// Export folder destination of the data. +message GcsFolderDestination { + // Required. GCS folder to export data to. + string output_folder_uri = 1; +} + +// DataItem is a piece of data, without annotation. For example, an image. +message DataItem { + // Output only. + oneof payload { + // The image payload, a container of the image bytes/uri. + ImagePayload image_payload = 2; + + // The text payload, a container of text content. + TextPayload text_payload = 3; + + // The video payload, a container of the video uri. + VideoPayload video_payload = 4; + + // The audio payload, a container of the audio uri. + AudioPayload audio_payload = 5; + } + + // Output only. Name of the data item, in format of: + // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + string name = 1; +} + +// AnnotatedDataset is a set holding annotations for data in a Dataset. Each +// labeling task will generate an AnnotatedDataset under the Dataset that the +// task is requested for. +message AnnotatedDataset { + // Output only. + // AnnotatedDataset resource name in format of: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; + + // Output only. The display name of the AnnotatedDataset. It is specified in + // HumanAnnotationConfig when user starts a labeling task. Maximum of 64 + // characters. + string display_name = 2; + + // Output only. The description of the AnnotatedDataset. It is specified in + // HumanAnnotationConfig when user starts a labeling task. Maximum of 10000 + // characters. + string description = 9; + + // Output only. Source of the annotation. + AnnotationSource annotation_source = 3; + + // Output only. Type of the annotation. It is specified when starting labeling + // task. + AnnotationType annotation_type = 8; + + // Output only. Number of examples in the annotated dataset. + int64 example_count = 4; + + // Output only. Number of examples that have annotation in the annotated + // dataset. + int64 completed_example_count = 5; + + // Output only. Per label statistics. + LabelStats label_stats = 6; + + // Output only. Time the AnnotatedDataset was created. + google.protobuf.Timestamp create_time = 7; + + // Output only. Additional information about AnnotatedDataset. + AnnotatedDatasetMetadata metadata = 10; +} + +// Metadata on AnnotatedDataset. +message AnnotatedDatasetMetadata { + // HumanAnnotationConfig used when requesting the human labeling task for this + // AnnotatedDataset. + HumanAnnotationConfig human_annotation_config = 1; + + // Specific request configuration used when requesting the labeling task. + oneof annotation_request_config { + // Configuration for image classification task. + ImageClassificationConfig image_classification_config = 2; + // Configuration for image bounding box and bounding poly task. + BoundingPolyConfig bounding_poly_config = 3; + // Configuration for image polyline task. + PolylineConfig polyline_config = 4; + // Configuration for image segmentation task. + SegmentationConfig segmentation_config = 5; + // Configuration for video classification task. + VideoClassificationConfig video_classification_config = 6; + // Configuration for video object detection task. + ObjectDetectionConfig object_detection_config = 7; + // Configuration for video object tracking task. + ObjectTrackingConfig object_tracking_config = 8; + // Configuration for video event labeling task. + EventConfig event_config = 9; + // Configuration for text classification task. + TextClassificationConfig text_classification_config = 10; + // Configuration for text entity extraction task. + TextEntityExtractionConfig text_entity_extraction_config = 11; + } +} + +// Statistics about annotation specs. +message LabelStats { + // Map of each annotation spec's example count. Key is the annotation spec + // name and value is the number of examples for that annotation spec. + map example_count = 1; +} + +// An Example is a piece of data and its annotation. For example, an image with +// label "house". +message Example { + // Output only. The data part of Example. + oneof payload { + // The image payload, a container of the image bytes/uri. + ImagePayload image_payload = 2; + + // The text payload, a container of the text content. + TextPayload text_payload = 6; + + // The video payload, a container of the video uri. + VideoPayload video_payload = 7; + + // The audio payload, a container of the audio uri. + AudioPayload audio_payload = 8; + } + + // Output only. Name of the example, in format of: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id}/examples/{example_id} + string name = 1; + + // Output only. Annotations for the piece of data in Example. + // One piece of data can have multiple annotations. + repeated Annotation annotations = 5; +} + +// Container of information about an image. +message ImagePayload { + // Image format. + string mime_type = 1; + + // A byte string of a full image. + bytes image_thumbnail = 2; + + // Image uri from the user bucket. + string image_uri = 3; +} + +// Container of information about a piece of text. +message TextPayload { + // Text content. + string text_content = 1; +} + +// Container of information of a video thumbnail. +message VideoThumbnail { + // A byte string of the video frame. + bytes thumbnail = 1; + + // Time offset relative to the beginning of the video, corresponding to the + // video frame where the thumbnail has been extracted from. + google.protobuf.Duration time_offset = 2; +} + +// Container of information of a video. +message VideoPayload { + // Video format. + string mime_type = 1; + + // Video uri from the user bucket. + string video_uri = 2; + + // The list of video thumbnails. + repeated VideoThumbnail video_thumbnails = 3; + + // FPS of the video. + float frame_rate = 4; +} + +// Container of information of an audio. +message AudioPayload { + // Audio uri in user bucket. + string audio_uri = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. This field is optional for `FLAC` and `WAV` + // audio files and required for all other audio formats. For details, + // see [AudioEncoding][google.cloud.datalabeling.v1beta1.AudioPayload.AudioEncoding]. + int32 sample_rate_hertz = 3; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py new file mode 100644 index 000000000000..30106e6a100c --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py @@ -0,0 +1,2282 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/dataset.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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.cloud.datalabeling_v1beta1.proto import ( + annotation_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, +) +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/dataset.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\n5google/cloud/datalabeling_v1beta1/proto/dataset.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x38google/cloud/datalabeling_v1beta1/proto/annotation.proto\x1a\x45google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xba\x01\n\x07\x44\x61taset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x45\n\rinput_configs\x18\x05 \x03(\x0b\x32..google.cloud.datalabeling.v1beta1.InputConfig"\x9b\x01\n\x0bInputConfig\x12\x42\n\ngcs_source\x18\x02 \x01(\x0b\x32,.google.cloud.datalabeling.v1beta1.GcsSourceH\x00\x12>\n\tdata_type\x18\x01 \x01(\x0e\x32+.google.cloud.datalabeling.v1beta1.DataTypeB\x08\n\x06source"1\n\tGcsSource\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t"\xc6\x01\n\x0cOutputConfig\x12L\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.GcsDestinationH\x00\x12Y\n\x16gcs_folder_destination\x18\x02 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.GcsFolderDestinationH\x00\x42\r\n\x0b\x64\x65stination"7\n\x0eGcsDestination\x12\x12\n\noutput_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t"1\n\x14GcsFolderDestination\x12\x19\n\x11output_folder_uri\x18\x01 \x01(\t"\xc9\x02\n\x08\x44\x61taItem\x12H\n\rimage_payload\x18\x02 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.ImagePayloadH\x00\x12\x46\n\x0ctext_payload\x18\x03 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TextPayloadH\x00\x12H\n\rvideo_payload\x18\x04 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.VideoPayloadH\x00\x12H\n\raudio_payload\x18\x05 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.AudioPayloadH\x00\x12\x0c\n\x04name\x18\x01 \x01(\tB\t\n\x07payload"\xe3\x03\n\x10\x41nnotatedDataset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12N\n\x11\x61nnotation_source\x18\x03 \x01(\x0e\x32\x33.google.cloud.datalabeling.v1beta1.AnnotationSource\x12J\n\x0f\x61nnotation_type\x18\x08 \x01(\x0e\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationType\x12\x15\n\rexample_count\x18\x04 \x01(\x03\x12\x1f\n\x17\x63ompleted_example_count\x18\x05 \x01(\x03\x12\x42\n\x0blabel_stats\x18\x06 \x01(\x0b\x32-.google.cloud.datalabeling.v1beta1.LabelStats\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12M\n\x08metadata\x18\n \x01(\x0b\x32;.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata"\xa2\x08\n\x18\x41nnotatedDatasetMetadata\x12Y\n\x17human_annotation_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig\x12\x63\n\x1bimage_classification_config\x18\x02 \x01(\x0b\x32<.google.cloud.datalabeling.v1beta1.ImageClassificationConfigH\x00\x12U\n\x14\x62ounding_poly_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.BoundingPolyConfigH\x00\x12L\n\x0fpolyline_config\x18\x04 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.PolylineConfigH\x00\x12T\n\x13segmentation_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.SegmentationConfigH\x00\x12\x63\n\x1bvideo_classification_config\x18\x06 \x01(\x0b\x32<.google.cloud.datalabeling.v1beta1.VideoClassificationConfigH\x00\x12[\n\x17object_detection_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.ObjectDetectionConfigH\x00\x12Y\n\x16object_tracking_config\x18\x08 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.ObjectTrackingConfigH\x00\x12\x46\n\x0c\x65vent_config\x18\t \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.EventConfigH\x00\x12\x61\n\x1atext_classification_config\x18\n \x01(\x0b\x32;.google.cloud.datalabeling.v1beta1.TextClassificationConfigH\x00\x12\x66\n\x1dtext_entity_extraction_config\x18\x0b \x01(\x0b\x32=.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfigH\x00\x42\x1b\n\x19\x61nnotation_request_config"\x99\x01\n\nLabelStats\x12V\n\rexample_count\x18\x01 \x03(\x0b\x32?.google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry\x1a\x33\n\x11\x45xampleCountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01"\x8c\x03\n\x07\x45xample\x12H\n\rimage_payload\x18\x02 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.ImagePayloadH\x00\x12\x46\n\x0ctext_payload\x18\x06 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TextPayloadH\x00\x12H\n\rvideo_payload\x18\x07 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.VideoPayloadH\x00\x12H\n\raudio_payload\x18\x08 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.AudioPayloadH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x42\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32-.google.cloud.datalabeling.v1beta1.AnnotationB\t\n\x07payload"M\n\x0cImagePayload\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x17\n\x0fimage_thumbnail\x18\x02 \x01(\x0c\x12\x11\n\timage_uri\x18\x03 \x01(\t"#\n\x0bTextPayload\x12\x14\n\x0ctext_content\x18\x01 \x01(\t"S\n\x0eVideoThumbnail\x12\x11\n\tthumbnail\x18\x01 \x01(\x0c\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\x95\x01\n\x0cVideoPayload\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x11\n\tvideo_uri\x18\x02 \x01(\t\x12K\n\x10video_thumbnails\x18\x03 \x03(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.VideoThumbnail\x12\x12\n\nframe_rate\x18\x04 \x01(\x02"<\n\x0c\x41udioPayload\x12\x11\n\taudio_uri\x18\x01 \x01(\t\x12\x19\n\x11sample_rate_hertz\x18\x03 \x01(\x05*P\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05IMAGE\x10\x01\x12\t\n\x05VIDEO\x10\x02\x12\x08\n\x04TEXT\x10\x04\x12\t\n\x05\x41UDIO\x10\x05\x42x\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[ + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2.DESCRIPTOR, + google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, + google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + +_DATATYPE = _descriptor.EnumDescriptor( + name="DataType", + full_name="google.cloud.datalabeling.v1beta1.DataType", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="DATA_TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="IMAGE", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="VIDEO", index=2, number=2, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="TEXT", index=3, number=4, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="AUDIO", index=4, number=5, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=3902, + serialized_end=3982, +) +_sym_db.RegisterEnumDescriptor(_DATATYPE) + +DataType = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) +DATA_TYPE_UNSPECIFIED = 0 +IMAGE = 1 +VIDEO = 2 +TEXT = 4 +AUDIO = 5 + + +_DATASET = _descriptor.Descriptor( + name="Dataset", + full_name="google.cloud.datalabeling.v1beta1.Dataset", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.Dataset.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datalabeling.v1beta1.Dataset.display_name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datalabeling.v1beta1.Dataset.description", + index=2, + number=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="create_time", + full_name="google.cloud.datalabeling.v1beta1.Dataset.create_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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="input_configs", + full_name="google.cloud.datalabeling.v1beta1.Dataset.input_configs", + index=4, + number=5, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=347, + serialized_end=533, +) + + +_INPUTCONFIG = _descriptor.Descriptor( + name="InputConfig", + full_name="google.cloud.datalabeling.v1beta1.InputConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_source", + full_name="google.cloud.datalabeling.v1beta1.InputConfig.gcs_source", + index=0, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="data_type", + full_name="google.cloud.datalabeling.v1beta1.InputConfig.data_type", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="source", + full_name="google.cloud.datalabeling.v1beta1.InputConfig.source", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=536, + serialized_end=691, +) + + +_GCSSOURCE = _descriptor.Descriptor( + name="GcsSource", + full_name="google.cloud.datalabeling.v1beta1.GcsSource", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="input_uri", + full_name="google.cloud.datalabeling.v1beta1.GcsSource.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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.datalabeling.v1beta1.GcsSource.mime_type", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=693, + serialized_end=742, +) + + +_OUTPUTCONFIG = _descriptor.Descriptor( + name="OutputConfig", + full_name="google.cloud.datalabeling.v1beta1.OutputConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_destination", + full_name="google.cloud.datalabeling.v1beta1.OutputConfig.gcs_destination", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="gcs_folder_destination", + full_name="google.cloud.datalabeling.v1beta1.OutputConfig.gcs_folder_destination", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="destination", + full_name="google.cloud.datalabeling.v1beta1.OutputConfig.destination", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=745, + serialized_end=943, +) + + +_GCSDESTINATION = _descriptor.Descriptor( + name="GcsDestination", + full_name="google.cloud.datalabeling.v1beta1.GcsDestination", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="output_uri", + full_name="google.cloud.datalabeling.v1beta1.GcsDestination.output_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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.datalabeling.v1beta1.GcsDestination.mime_type", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=945, + serialized_end=1000, +) + + +_GCSFOLDERDESTINATION = _descriptor.Descriptor( + name="GcsFolderDestination", + full_name="google.cloud.datalabeling.v1beta1.GcsFolderDestination", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="output_folder_uri", + full_name="google.cloud.datalabeling.v1beta1.GcsFolderDestination.output_folder_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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1002, + serialized_end=1051, +) + + +_DATAITEM = _descriptor.Descriptor( + name="DataItem", + full_name="google.cloud.datalabeling.v1beta1.DataItem", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="image_payload", + full_name="google.cloud.datalabeling.v1beta1.DataItem.image_payload", + index=0, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_payload", + full_name="google.cloud.datalabeling.v1beta1.DataItem.text_payload", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_payload", + full_name="google.cloud.datalabeling.v1beta1.DataItem.video_payload", + index=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="audio_payload", + full_name="google.cloud.datalabeling.v1beta1.DataItem.audio_payload", + index=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.DataItem.name", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="payload", + full_name="google.cloud.datalabeling.v1beta1.DataItem.payload", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=1054, + serialized_end=1383, +) + + +_ANNOTATEDDATASET = _descriptor.Descriptor( + name="AnnotatedDataset", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.display_name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.description", + index=2, + number=9, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_source", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.annotation_source", + index=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_type", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.annotation_type", + index=4, + number=8, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="example_count", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.example_count", + index=5, + number=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="completed_example_count", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.completed_example_count", + index=6, + number=5, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="label_stats", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.label_stats", + index=7, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="create_time", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.create_time", + index=8, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="metadata", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.metadata", + index=9, + number=10, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1386, + serialized_end=1869, +) + + +_ANNOTATEDDATASETMETADATA = _descriptor.Descriptor( + name="AnnotatedDatasetMetadata", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="human_annotation_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.human_annotation_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_classification_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.image_classification_config", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="bounding_poly_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.bounding_poly_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="polyline_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.polyline_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="segmentation_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.segmentation_config", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_classification_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.video_classification_config", + index=5, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="object_detection_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.object_detection_config", + index=6, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="object_tracking_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.object_tracking_config", + index=7, + number=8, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="event_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.event_config", + index=8, + number=9, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_classification_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.text_classification_config", + index=9, + number=10, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_entity_extraction_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.text_entity_extraction_config", + index=10, + number=11, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="annotation_request_config", + full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.annotation_request_config", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=1872, + serialized_end=2930, +) + + +_LABELSTATS_EXAMPLECOUNTENTRY = _descriptor.Descriptor( + name="ExampleCountEntry", + full_name="google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry.key", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry.value", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=_b("8\001"), + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3035, + serialized_end=3086, +) + +_LABELSTATS = _descriptor.Descriptor( + name="LabelStats", + full_name="google.cloud.datalabeling.v1beta1.LabelStats", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="example_count", + full_name="google.cloud.datalabeling.v1beta1.LabelStats.example_count", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[_LABELSTATS_EXAMPLECOUNTENTRY], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2933, + serialized_end=3086, +) + + +_EXAMPLE = _descriptor.Descriptor( + name="Example", + full_name="google.cloud.datalabeling.v1beta1.Example", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="image_payload", + full_name="google.cloud.datalabeling.v1beta1.Example.image_payload", + index=0, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_payload", + full_name="google.cloud.datalabeling.v1beta1.Example.text_payload", + index=1, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_payload", + full_name="google.cloud.datalabeling.v1beta1.Example.video_payload", + index=2, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="audio_payload", + full_name="google.cloud.datalabeling.v1beta1.Example.audio_payload", + index=3, + number=8, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.Example.name", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotations", + full_name="google.cloud.datalabeling.v1beta1.Example.annotations", + index=5, + number=5, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="payload", + full_name="google.cloud.datalabeling.v1beta1.Example.payload", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=3089, + serialized_end=3485, +) + + +_IMAGEPAYLOAD = _descriptor.Descriptor( + name="ImagePayload", + full_name="google.cloud.datalabeling.v1beta1.ImagePayload", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.datalabeling.v1beta1.ImagePayload.mime_type", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_thumbnail", + full_name="google.cloud.datalabeling.v1beta1.ImagePayload.image_thumbnail", + index=1, + number=2, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b(""), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_uri", + full_name="google.cloud.datalabeling.v1beta1.ImagePayload.image_uri", + index=2, + number=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3487, + serialized_end=3564, +) + + +_TEXTPAYLOAD = _descriptor.Descriptor( + name="TextPayload", + full_name="google.cloud.datalabeling.v1beta1.TextPayload", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="text_content", + full_name="google.cloud.datalabeling.v1beta1.TextPayload.text_content", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3566, + serialized_end=3601, +) + + +_VIDEOTHUMBNAIL = _descriptor.Descriptor( + name="VideoThumbnail", + full_name="google.cloud.datalabeling.v1beta1.VideoThumbnail", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="thumbnail", + full_name="google.cloud.datalabeling.v1beta1.VideoThumbnail.thumbnail", + index=0, + number=1, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b(""), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="time_offset", + full_name="google.cloud.datalabeling.v1beta1.VideoThumbnail.time_offset", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3603, + serialized_end=3686, +) + + +_VIDEOPAYLOAD = _descriptor.Descriptor( + name="VideoPayload", + full_name="google.cloud.datalabeling.v1beta1.VideoPayload", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="mime_type", + full_name="google.cloud.datalabeling.v1beta1.VideoPayload.mime_type", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_uri", + full_name="google.cloud.datalabeling.v1beta1.VideoPayload.video_uri", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_thumbnails", + full_name="google.cloud.datalabeling.v1beta1.VideoPayload.video_thumbnails", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="frame_rate", + full_name="google.cloud.datalabeling.v1beta1.VideoPayload.frame_rate", + index=3, + number=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3689, + serialized_end=3838, +) + + +_AUDIOPAYLOAD = _descriptor.Descriptor( + name="AudioPayload", + full_name="google.cloud.datalabeling.v1beta1.AudioPayload", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="audio_uri", + full_name="google.cloud.datalabeling.v1beta1.AudioPayload.audio_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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="sample_rate_hertz", + full_name="google.cloud.datalabeling.v1beta1.AudioPayload.sample_rate_hertz", + index=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3840, + serialized_end=3900, +) + +_DATASET.fields_by_name[ + "create_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_DATASET.fields_by_name["input_configs"].message_type = _INPUTCONFIG +_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE +_INPUTCONFIG.fields_by_name["data_type"].enum_type = _DATATYPE +_INPUTCONFIG.oneofs_by_name["source"].fields.append( + _INPUTCONFIG.fields_by_name["gcs_source"] +) +_INPUTCONFIG.fields_by_name[ + "gcs_source" +].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] +_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION +_OUTPUTCONFIG.fields_by_name[ + "gcs_folder_destination" +].message_type = _GCSFOLDERDESTINATION +_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( + _OUTPUTCONFIG.fields_by_name["gcs_destination"] +) +_OUTPUTCONFIG.fields_by_name[ + "gcs_destination" +].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] +_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( + _OUTPUTCONFIG.fields_by_name["gcs_folder_destination"] +) +_OUTPUTCONFIG.fields_by_name[ + "gcs_folder_destination" +].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] +_DATAITEM.fields_by_name["image_payload"].message_type = _IMAGEPAYLOAD +_DATAITEM.fields_by_name["text_payload"].message_type = _TEXTPAYLOAD +_DATAITEM.fields_by_name["video_payload"].message_type = _VIDEOPAYLOAD +_DATAITEM.fields_by_name["audio_payload"].message_type = _AUDIOPAYLOAD +_DATAITEM.oneofs_by_name["payload"].fields.append( + _DATAITEM.fields_by_name["image_payload"] +) +_DATAITEM.fields_by_name["image_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ + "payload" +] +_DATAITEM.oneofs_by_name["payload"].fields.append( + _DATAITEM.fields_by_name["text_payload"] +) +_DATAITEM.fields_by_name["text_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ + "payload" +] +_DATAITEM.oneofs_by_name["payload"].fields.append( + _DATAITEM.fields_by_name["video_payload"] +) +_DATAITEM.fields_by_name["video_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ + "payload" +] +_DATAITEM.oneofs_by_name["payload"].fields.append( + _DATAITEM.fields_by_name["audio_payload"] +) +_DATAITEM.fields_by_name["audio_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ + "payload" +] +_ANNOTATEDDATASET.fields_by_name[ + "annotation_source" +].enum_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATIONSOURCE +) +_ANNOTATEDDATASET.fields_by_name[ + "annotation_type" +].enum_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATIONTYPE +) +_ANNOTATEDDATASET.fields_by_name["label_stats"].message_type = _LABELSTATS +_ANNOTATEDDATASET.fields_by_name[ + "create_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_ANNOTATEDDATASET.fields_by_name["metadata"].message_type = _ANNOTATEDDATASETMETADATA +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "human_annotation_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "image_classification_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._IMAGECLASSIFICATIONCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "bounding_poly_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._BOUNDINGPOLYCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "polyline_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._POLYLINECONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "segmentation_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._SEGMENTATIONCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "video_classification_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._VIDEOCLASSIFICATIONCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "object_detection_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTDETECTIONCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "object_tracking_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTTRACKINGCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "event_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._EVENTCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "text_classification_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTCLASSIFICATIONCONFIG +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "text_entity_extraction_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTENTITYEXTRACTIONCONFIG +) +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["image_classification_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "image_classification_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["bounding_poly_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "bounding_poly_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["polyline_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "polyline_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["segmentation_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "segmentation_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["video_classification_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "video_classification_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["object_detection_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "object_detection_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["object_tracking_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "object_tracking_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["event_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "event_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["text_classification_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "text_classification_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( + _ANNOTATEDDATASETMETADATA.fields_by_name["text_entity_extraction_config"] +) +_ANNOTATEDDATASETMETADATA.fields_by_name[ + "text_entity_extraction_config" +].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ + "annotation_request_config" +] +_LABELSTATS_EXAMPLECOUNTENTRY.containing_type = _LABELSTATS +_LABELSTATS.fields_by_name["example_count"].message_type = _LABELSTATS_EXAMPLECOUNTENTRY +_EXAMPLE.fields_by_name["image_payload"].message_type = _IMAGEPAYLOAD +_EXAMPLE.fields_by_name["text_payload"].message_type = _TEXTPAYLOAD +_EXAMPLE.fields_by_name["video_payload"].message_type = _VIDEOPAYLOAD +_EXAMPLE.fields_by_name["audio_payload"].message_type = _AUDIOPAYLOAD +_EXAMPLE.fields_by_name[ + "annotations" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATION +) +_EXAMPLE.oneofs_by_name["payload"].fields.append( + _EXAMPLE.fields_by_name["image_payload"] +) +_EXAMPLE.fields_by_name["image_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ + "payload" +] +_EXAMPLE.oneofs_by_name["payload"].fields.append( + _EXAMPLE.fields_by_name["text_payload"] +) +_EXAMPLE.fields_by_name["text_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ + "payload" +] +_EXAMPLE.oneofs_by_name["payload"].fields.append( + _EXAMPLE.fields_by_name["video_payload"] +) +_EXAMPLE.fields_by_name["video_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ + "payload" +] +_EXAMPLE.oneofs_by_name["payload"].fields.append( + _EXAMPLE.fields_by_name["audio_payload"] +) +_EXAMPLE.fields_by_name["audio_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ + "payload" +] +_VIDEOTHUMBNAIL.fields_by_name[ + "time_offset" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_VIDEOPAYLOAD.fields_by_name["video_thumbnails"].message_type = _VIDEOTHUMBNAIL +DESCRIPTOR.message_types_by_name["Dataset"] = _DATASET +DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG +DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE +DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG +DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION +DESCRIPTOR.message_types_by_name["GcsFolderDestination"] = _GCSFOLDERDESTINATION +DESCRIPTOR.message_types_by_name["DataItem"] = _DATAITEM +DESCRIPTOR.message_types_by_name["AnnotatedDataset"] = _ANNOTATEDDATASET +DESCRIPTOR.message_types_by_name["AnnotatedDatasetMetadata"] = _ANNOTATEDDATASETMETADATA +DESCRIPTOR.message_types_by_name["LabelStats"] = _LABELSTATS +DESCRIPTOR.message_types_by_name["Example"] = _EXAMPLE +DESCRIPTOR.message_types_by_name["ImagePayload"] = _IMAGEPAYLOAD +DESCRIPTOR.message_types_by_name["TextPayload"] = _TEXTPAYLOAD +DESCRIPTOR.message_types_by_name["VideoThumbnail"] = _VIDEOTHUMBNAIL +DESCRIPTOR.message_types_by_name["VideoPayload"] = _VIDEOPAYLOAD +DESCRIPTOR.message_types_by_name["AudioPayload"] = _AUDIOPAYLOAD +DESCRIPTOR.enum_types_by_name["DataType"] = _DATATYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Dataset = _reflection.GeneratedProtocolMessageType( + "Dataset", + (_message.Message,), + dict( + DESCRIPTOR=_DATASET, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Dataset is the resource to hold your data. You can request multiple + labeling tasks for a dataset while each one will generate an + AnnotatedDataset. + + + Attributes: + name: + Output only. Dataset resource name, format is: + projects/{project\_id}/datasets/{dataset\_id} + display_name: + Required. The display name of the dataset. Maximum of 64 + characters. + description: + Optional. User-provided description of the annotation + specification set. The description can be up to 10000 + characters long. + create_time: + Output only. Time the dataset is created. + input_configs: + Output only. This is populated with the original input configs + where ImportData is called. It is available only after the + clients import data to this dataset. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Dataset) + ), +) +_sym_db.RegisterMessage(Dataset) + +InputConfig = _reflection.GeneratedProtocolMessageType( + "InputConfig", + (_message.Message,), + dict( + DESCRIPTOR=_INPUTCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""The configuration of input data, including data type, location, etc. + + + Attributes: + source: + Required. Where the data is from. + data_type: + Required. Data type must be specifed when user tries to import + data. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.InputConfig) + ), +) +_sym_db.RegisterMessage(InputConfig) + +GcsSource = _reflection.GeneratedProtocolMessageType( + "GcsSource", + (_message.Message,), + dict( + DESCRIPTOR=_GCSSOURCE, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Source of the GCS file to be imported. Only gcs path is allowed in + input\_uri. + + + Attributes: + input_uri: + Required. The input uri of source file. + mime_type: + Required. The format of the gcs source. Only "text/csv" is + supported. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GcsSource) + ), +) +_sym_db.RegisterMessage(GcsSource) + +OutputConfig = _reflection.GeneratedProtocolMessageType( + "OutputConfig", + (_message.Message,), + dict( + DESCRIPTOR=_OUTPUTCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""The configuration of output data. + + + Attributes: + destination: + Required. Location to output data to. + gcs_destination: + Output to a GCS file. Should be used for labeling output other + than Audio transcription. + gcs_folder_destination: + Output to a GCS folder. Should be used for Audio transcription + labeling output. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.OutputConfig) + ), +) +_sym_db.RegisterMessage(OutputConfig) + +GcsDestination = _reflection.GeneratedProtocolMessageType( + "GcsDestination", + (_message.Message,), + dict( + DESCRIPTOR=_GCSDESTINATION, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Export destination of the data.Only gcs path is allowed in output\_uri. + + + Attributes: + output_uri: + Required. The output uri of destination file. + mime_type: + Required. The format of the gcs destination. Only "text/csv" + and "application/json" are supported. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GcsDestination) + ), +) +_sym_db.RegisterMessage(GcsDestination) + +GcsFolderDestination = _reflection.GeneratedProtocolMessageType( + "GcsFolderDestination", + (_message.Message,), + dict( + DESCRIPTOR=_GCSFOLDERDESTINATION, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Export folder destination of the data. + + + Attributes: + output_folder_uri: + Required. GCS folder to export data to. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GcsFolderDestination) + ), +) +_sym_db.RegisterMessage(GcsFolderDestination) + +DataItem = _reflection.GeneratedProtocolMessageType( + "DataItem", + (_message.Message,), + dict( + DESCRIPTOR=_DATAITEM, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""DataItem is a piece of data, without annotation. For example, an image. + + + Attributes: + payload: + Output only. + image_payload: + The image payload, a container of the image bytes/uri. + text_payload: + The text payload, a container of text content. + video_payload: + The video payload, a container of the video uri. + audio_payload: + The audio payload, a container of the audio uri. + name: + Output only. Name of the data item, in format of: projects/{pr + oject\_id}/datasets/{dataset\_id}/dataItems/{data\_item\_id} + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DataItem) + ), +) +_sym_db.RegisterMessage(DataItem) + +AnnotatedDataset = _reflection.GeneratedProtocolMessageType( + "AnnotatedDataset", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATEDDATASET, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""AnnotatedDataset is a set holding annotations for data in a Dataset. + Each labeling task will generate an AnnotatedDataset under the Dataset + that the task is requested for. + + + Attributes: + name: + Output only. AnnotatedDataset resource name in format of: proj + ects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id} + display_name: + Output only. The display name of the AnnotatedDataset. It is + specified in HumanAnnotationConfig when user starts a labeling + task. Maximum of 64 characters. + description: + Output only. The description of the AnnotatedDataset. It is + specified in HumanAnnotationConfig when user starts a labeling + task. Maximum of 10000 characters. + annotation_source: + Output only. Source of the annotation. + annotation_type: + Output only. Type of the annotation. It is specified when + starting labeling task. + example_count: + Output only. Number of examples in the annotated dataset. + completed_example_count: + Output only. Number of examples that have annotation in the + annotated dataset. + label_stats: + Output only. Per label statistics. + create_time: + Output only. Time the AnnotatedDataset was created. + metadata: + Output only. Additional information about AnnotatedDataset. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotatedDataset) + ), +) +_sym_db.RegisterMessage(AnnotatedDataset) + +AnnotatedDatasetMetadata = _reflection.GeneratedProtocolMessageType( + "AnnotatedDatasetMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_ANNOTATEDDATASETMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Metadata on AnnotatedDataset. + + + Attributes: + human_annotation_config: + HumanAnnotationConfig used when requesting the human labeling + task for this AnnotatedDataset. + annotation_request_config: + Specific request configuration used when requesting the + labeling task. + image_classification_config: + Configuration for image classification task. + bounding_poly_config: + Configuration for image bounding box and bounding poly task. + polyline_config: + Configuration for image polyline task. + segmentation_config: + Configuration for image segmentation task. + video_classification_config: + Configuration for video classification task. + object_detection_config: + Configuration for video object detection task. + object_tracking_config: + Configuration for video object tracking task. + event_config: + Configuration for video event labeling task. + text_classification_config: + Configuration for text classification task. + text_entity_extraction_config: + Configuration for text entity extraction task. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata) + ), +) +_sym_db.RegisterMessage(AnnotatedDatasetMetadata) + +LabelStats = _reflection.GeneratedProtocolMessageType( + "LabelStats", + (_message.Message,), + dict( + ExampleCountEntry=_reflection.GeneratedProtocolMessageType( + "ExampleCountEntry", + (_message.Message,), + dict( + DESCRIPTOR=_LABELSTATS_EXAMPLECOUNTENTRY, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2" + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry) + ), + ), + DESCRIPTOR=_LABELSTATS, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Statistics about annotation specs. + + + Attributes: + example_count: + Map of each annotation spec's example count. Key is the + annotation spec name and value is the number of examples for + that annotation spec. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelStats) + ), +) +_sym_db.RegisterMessage(LabelStats) +_sym_db.RegisterMessage(LabelStats.ExampleCountEntry) + +Example = _reflection.GeneratedProtocolMessageType( + "Example", + (_message.Message,), + dict( + DESCRIPTOR=_EXAMPLE, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""An Example is a piece of data and its annotation. For example, an image + with label "house". + + + Attributes: + payload: + Output only. The data part of Example. + image_payload: + The image payload, a container of the image bytes/uri. + text_payload: + The text payload, a container of the text content. + video_payload: + The video payload, a container of the video uri. + audio_payload: + The audio payload, a container of the audio uri. + name: + Output only. Name of the example, in format of: projects/{proj + ect\_id}/datasets/{dataset\_id}/annotatedDatasets/ + {annotated\_dataset\_id}/examples/{example\_id} + annotations: + Output only. Annotations for the piece of data in Example. One + piece of data can have multiple annotations. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Example) + ), +) +_sym_db.RegisterMessage(Example) + +ImagePayload = _reflection.GeneratedProtocolMessageType( + "ImagePayload", + (_message.Message,), + dict( + DESCRIPTOR=_IMAGEPAYLOAD, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Container of information about an image. + + + Attributes: + mime_type: + Image format. + image_thumbnail: + A byte string of a full image. + image_uri: + Image uri from the user bucket. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImagePayload) + ), +) +_sym_db.RegisterMessage(ImagePayload) + +TextPayload = _reflection.GeneratedProtocolMessageType( + "TextPayload", + (_message.Message,), + dict( + DESCRIPTOR=_TEXTPAYLOAD, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Container of information about a piece of text. + + + Attributes: + text_content: + Text content. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextPayload) + ), +) +_sym_db.RegisterMessage(TextPayload) + +VideoThumbnail = _reflection.GeneratedProtocolMessageType( + "VideoThumbnail", + (_message.Message,), + dict( + DESCRIPTOR=_VIDEOTHUMBNAIL, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Container of information of a video thumbnail. + + + Attributes: + thumbnail: + A byte string of the video frame. + time_offset: + Time offset relative to the beginning of the video, + corresponding to the video frame where the thumbnail has been + extracted from. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoThumbnail) + ), +) +_sym_db.RegisterMessage(VideoThumbnail) + +VideoPayload = _reflection.GeneratedProtocolMessageType( + "VideoPayload", + (_message.Message,), + dict( + DESCRIPTOR=_VIDEOPAYLOAD, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Container of information of a video. + + + Attributes: + mime_type: + Video format. + video_uri: + Video uri from the user bucket. + video_thumbnails: + The list of video thumbnails. + frame_rate: + FPS of the video. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoPayload) + ), +) +_sym_db.RegisterMessage(VideoPayload) + +AudioPayload = _reflection.GeneratedProtocolMessageType( + "AudioPayload", + (_message.Message,), + dict( + DESCRIPTOR=_AUDIOPAYLOAD, + __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", + __doc__="""Container of information of an audio. + + + Attributes: + audio_uri: + Audio uri in user bucket. + sample_rate_hertz: + Sample rate in Hertz of the audio data sent in all + ``RecognitionAudio`` messages. This field is optional for + ``FLAC`` and ``WAV`` audio files and required for all other + audio formats. For details, see [AudioEncoding][google.cloud.d + atalabeling.v1beta1.AudioPayload.AudioEncoding]. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AudioPayload) + ), +) +_sym_db.RegisterMessage(AudioPayload) + + +DESCRIPTOR._options = None +_LABELSTATS_EXAMPLECOUNTENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto new file mode 100644 index 000000000000..96672aedaf53 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto @@ -0,0 +1,208 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +enum StringAggregationType { + STRING_AGGREGATION_TYPE_UNSPECIFIED = 0; + + // Majority vote to aggregate answers. + MAJORITY_VOTE = 1; + + // Unanimous answers will be adopted. + UNANIMOUS_VOTE = 2; + + // Preserve all answers by crowd compute. + NO_AGGREGATION = 3; +} + +// Configuration for how human labeling task should be done. +message HumanAnnotationConfig { + // Required except for LabelAudio case. Instruction resource name. + string instruction = 1; + + // Required. A human-readable name for AnnotatedDataset defined by + // users. Maximum of 64 characters + // . + string annotated_dataset_display_name = 2; + + // Optional. A human-readable description for AnnotatedDataset. + // The description can be up to 10000 characters long. + string annotated_dataset_description = 3; + + // Optional. A human-readable label used to logically group labeling tasks. + // This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + string label_group = 4; + + // Optional. The Language of this question, as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // Default value is en-US. + // Only need to set this when task is language related. For example, French + // text classification or Chinese audio transcription. + string language_code = 5; + + // Optional. Replication of questions. Each question will be sent to up to + // this number of contributors to label. Aggregated answers will be returned. + // Default is set to 1. + // For image related labeling, valid values are 1, 3, 5. + int32 replica_count = 6; + + // Optional. Maximum duration for contributors to answer a question. Default + // is 1800 seconds. + google.protobuf.Duration question_duration = 7; + + // Optional. If you want your own labeling contributors to manage and work on + // this labeling request, you can set these contributors here. We will give + // them access to the question types in crowdcompute. Note that these + // emails must be registered in crowdcompute worker UI: + // https://crowd-compute.appspot.com/ + repeated string contributor_emails = 9; +} + +// Config for image classification human labeling task. +message ImageClassificationConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. If allow_multi_label is true, contributors are able to choose + // multiple labels for one image. + bool allow_multi_label = 2; + + // Optional. The type of how to aggregate answers. + StringAggregationType answer_aggregation_type = 3; +} + +// Config for image bounding poly (and bounding box) human labeling task. +message BoundingPolyConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. Instruction message showed on contributors UI. + string instruction_message = 2; +} + +// Config for image polyline human labeling task. +message PolylineConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. Instruction message showed on contributors UI. + string instruction_message = 2; +} + +// Config for image segmentation +message SegmentationConfig { + // Required. Annotation spec set resource name. format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string annotation_spec_set = 1; + + // Instruction message showed on labelers UI. + string instruction_message = 2; +} + +// Config for video classification human labeling task. +// Currently two types of video classification are supported: +// 1. Assign labels on the entire video. +// 2. Split the video into multiple video clips based on camera shot, and +// assign labels on each video clip. +message VideoClassificationConfig { + // Annotation spec set with the setting of allowing multi labels or not. + message AnnotationSpecSetConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. If allow_multi_label is true, contributors are able to + // choose multiple labels from one annotation spec set. + bool allow_multi_label = 2; + } + + // Required. The list of annotation spec set configs. + // Since watching a video clip takes much longer time than an image, we + // support label with multiple AnnotationSpecSet at the same time. Labels + // in each AnnotationSpecSet will be shown in a group to contributors. + // Contributors can select one or more (depending on whether to allow multi + // label) from each group. + repeated AnnotationSpecSetConfig annotation_spec_set_configs = 1; + + // Optional. Option to apply shot detection on the video. + bool apply_shot_detection = 2; +} + +// Config for video object detection human labeling task. +// Object detection will be conducted on the images extracted from the video, +// and those objects will be labeled with bounding boxes. +// User need to specify the number of images to be extracted per second as the +// extraction frame rate. +message ObjectDetectionConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. Instruction message showed on labelers UI. + string instruction_message = 2; + + // Required. Number of frames per second to be extracted from the video. + double extraction_frame_rate = 3; +} + +// Config for video object tracking human labeling task. +message ObjectTrackingConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; +} + +// Config for video event human labeling task. +message EventConfig { + // Required. The list of annotation spec set resource name. Similar to video + // classification, we support selecting event from multiple AnnotationSpecSet + // at the same time. + repeated string annotation_spec_sets = 1; +} + +// Config for text classification human labeling task. +message TextClassificationConfig { + // Optional. If allow_multi_label is true, contributors are able to choose + // multiple labels for one text segment. + bool allow_multi_label = 1; + + // Required. Annotation spec set resource name. + string annotation_spec_set = 2; + + // Optional. Configs for sentiment selection. + SentimentConfig sentiment_config = 3; +} + +// Config for setting up sentiments. +message SentimentConfig { + // If set to true, contributors will have the option to select sentiment of + // the label they selected, to mark it as negative or positive label. Default + // is false. + bool enable_label_sentiment_selection = 1; +} + +// Config for text entity extraction human labeling task. +message TextEntityExtractionConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py new file mode 100644 index 000000000000..6691d710dcf3 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py @@ -0,0 +1,1250 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/human_annotation_config.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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\nEgoogle/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto"\x90\x02\n\x15HumanAnnotationConfig\x12\x13\n\x0binstruction\x18\x01 \x01(\t\x12&\n\x1e\x61nnotated_dataset_display_name\x18\x02 \x01(\t\x12%\n\x1d\x61nnotated_dataset_description\x18\x03 \x01(\t\x12\x13\n\x0blabel_group\x18\x04 \x01(\t\x12\x15\n\rlanguage_code\x18\x05 \x01(\t\x12\x15\n\rreplica_count\x18\x06 \x01(\x05\x12\x34\n\x11question_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\x12\x63ontributor_emails\x18\t \x03(\t"\xae\x01\n\x19ImageClassificationConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t\x12\x19\n\x11\x61llow_multi_label\x18\x02 \x01(\x08\x12Y\n\x17\x61nswer_aggregation_type\x18\x03 \x01(\x0e\x32\x38.google.cloud.datalabeling.v1beta1.StringAggregationType"N\n\x12\x42oundingPolyConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t\x12\x1b\n\x13instruction_message\x18\x02 \x01(\t"J\n\x0ePolylineConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t\x12\x1b\n\x13instruction_message\x18\x02 \x01(\t"N\n\x12SegmentationConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t\x12\x1b\n\x13instruction_message\x18\x02 \x01(\t"\x87\x02\n\x19VideoClassificationConfig\x12y\n\x1b\x61nnotation_spec_set_configs\x18\x01 \x03(\x0b\x32T.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig\x12\x1c\n\x14\x61pply_shot_detection\x18\x02 \x01(\x08\x1aQ\n\x17\x41nnotationSpecSetConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t\x12\x19\n\x11\x61llow_multi_label\x18\x02 \x01(\x08"p\n\x15ObjectDetectionConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t\x12\x1b\n\x13instruction_message\x18\x02 \x01(\t\x12\x1d\n\x15\x65xtraction_frame_rate\x18\x03 \x01(\x01"3\n\x14ObjectTrackingConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t"+\n\x0b\x45ventConfig\x12\x1c\n\x14\x61nnotation_spec_sets\x18\x01 \x03(\t"\xa0\x01\n\x18TextClassificationConfig\x12\x19\n\x11\x61llow_multi_label\x18\x01 \x01(\x08\x12\x1b\n\x13\x61nnotation_spec_set\x18\x02 \x01(\t\x12L\n\x10sentiment_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.datalabeling.v1beta1.SentimentConfig";\n\x0fSentimentConfig\x12(\n enable_label_sentiment_selection\x18\x01 \x01(\x08"9\n\x1aTextEntityExtractionConfig\x12\x1b\n\x13\x61nnotation_spec_set\x18\x01 \x01(\t*{\n\x15StringAggregationType\x12\'\n#STRING_AGGREGATION_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rMAJORITY_VOTE\x10\x01\x12\x12\n\x0eUNANIMOUS_VOTE\x10\x02\x12\x12\n\x0eNO_AGGREGATION\x10\x03\x42x\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[ + google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + +_STRINGAGGREGATIONTYPE = _descriptor.EnumDescriptor( + name="StringAggregationType", + full_name="google.cloud.datalabeling.v1beta1.StringAggregationType", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="STRING_AGGREGATION_TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="MAJORITY_VOTE", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="UNANIMOUS_VOTE", index=2, number=2, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="NO_AGGREGATION", index=3, number=3, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=1619, + serialized_end=1742, +) +_sym_db.RegisterEnumDescriptor(_STRINGAGGREGATIONTYPE) + +StringAggregationType = enum_type_wrapper.EnumTypeWrapper(_STRINGAGGREGATIONTYPE) +STRING_AGGREGATION_TYPE_UNSPECIFIED = 0 +MAJORITY_VOTE = 1 +UNANIMOUS_VOTE = 2 +NO_AGGREGATION = 3 + + +_HUMANANNOTATIONCONFIG = _descriptor.Descriptor( + name="HumanAnnotationConfig", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="instruction", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.instruction", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotated_dataset_display_name", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.annotated_dataset_display_name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotated_dataset_description", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.annotated_dataset_description", + index=2, + number=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="label_group", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.label_group", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="language_code", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.language_code", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="replica_count", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.replica_count", + index=5, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="question_duration", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.question_duration", + index=6, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="contributor_emails", + full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.contributor_emails", + index=7, + number=9, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=171, + serialized_end=443, +) + + +_IMAGECLASSIFICATIONCONFIG = _descriptor.Descriptor( + name="ImageClassificationConfig", + full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="allow_multi_label", + full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig.allow_multi_label", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="answer_aggregation_type", + full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig.answer_aggregation_type", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=446, + serialized_end=620, +) + + +_BOUNDINGPOLYCONFIG = _descriptor.Descriptor( + name="BoundingPolyConfig", + full_name="google.cloud.datalabeling.v1beta1.BoundingPolyConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.BoundingPolyConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="instruction_message", + full_name="google.cloud.datalabeling.v1beta1.BoundingPolyConfig.instruction_message", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=622, + serialized_end=700, +) + + +_POLYLINECONFIG = _descriptor.Descriptor( + name="PolylineConfig", + full_name="google.cloud.datalabeling.v1beta1.PolylineConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.PolylineConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="instruction_message", + full_name="google.cloud.datalabeling.v1beta1.PolylineConfig.instruction_message", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=702, + serialized_end=776, +) + + +_SEGMENTATIONCONFIG = _descriptor.Descriptor( + name="SegmentationConfig", + full_name="google.cloud.datalabeling.v1beta1.SegmentationConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.SegmentationConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="instruction_message", + full_name="google.cloud.datalabeling.v1beta1.SegmentationConfig.instruction_message", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=778, + serialized_end=856, +) + + +_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG = _descriptor.Descriptor( + name="AnnotationSpecSetConfig", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="allow_multi_label", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.allow_multi_label", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1041, + serialized_end=1122, +) + +_VIDEOCLASSIFICATIONCONFIG = _descriptor.Descriptor( + name="VideoClassificationConfig", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set_configs", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.annotation_spec_set_configs", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="apply_shot_detection", + full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.apply_shot_detection", + index=1, + number=2, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=859, + serialized_end=1122, +) + + +_OBJECTDETECTIONCONFIG = _descriptor.Descriptor( + name="ObjectDetectionConfig", + full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="instruction_message", + full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.instruction_message", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="extraction_frame_rate", + full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.extraction_frame_rate", + index=2, + number=3, + type=1, + cpp_type=5, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1124, + serialized_end=1236, +) + + +_OBJECTTRACKINGCONFIG = _descriptor.Descriptor( + name="ObjectTrackingConfig", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1238, + serialized_end=1289, +) + + +_EVENTCONFIG = _descriptor.Descriptor( + name="EventConfig", + full_name="google.cloud.datalabeling.v1beta1.EventConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_sets", + full_name="google.cloud.datalabeling.v1beta1.EventConfig.annotation_spec_sets", + index=0, + number=1, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1291, + serialized_end=1334, +) + + +_TEXTCLASSIFICATIONCONFIG = _descriptor.Descriptor( + name="TextClassificationConfig", + full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="allow_multi_label", + full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig.allow_multi_label", + index=0, + number=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="sentiment_config", + full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig.sentiment_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1337, + serialized_end=1497, +) + + +_SENTIMENTCONFIG = _descriptor.Descriptor( + name="SentimentConfig", + full_name="google.cloud.datalabeling.v1beta1.SentimentConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="enable_label_sentiment_selection", + full_name="google.cloud.datalabeling.v1beta1.SentimentConfig.enable_label_sentiment_selection", + index=0, + number=1, + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1499, + serialized_end=1558, +) + + +_TEXTENTITYEXTRACTIONCONFIG = _descriptor.Descriptor( + name="TextEntityExtractionConfig", + full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="annotation_spec_set", + full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.annotation_spec_set", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1560, + serialized_end=1617, +) + +_HUMANANNOTATIONCONFIG.fields_by_name[ + "question_duration" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_IMAGECLASSIFICATIONCONFIG.fields_by_name[ + "answer_aggregation_type" +].enum_type = _STRINGAGGREGATIONTYPE +_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG.containing_type = ( + _VIDEOCLASSIFICATIONCONFIG +) +_VIDEOCLASSIFICATIONCONFIG.fields_by_name[ + "annotation_spec_set_configs" +].message_type = _VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG +_TEXTCLASSIFICATIONCONFIG.fields_by_name[ + "sentiment_config" +].message_type = _SENTIMENTCONFIG +DESCRIPTOR.message_types_by_name["HumanAnnotationConfig"] = _HUMANANNOTATIONCONFIG +DESCRIPTOR.message_types_by_name[ + "ImageClassificationConfig" +] = _IMAGECLASSIFICATIONCONFIG +DESCRIPTOR.message_types_by_name["BoundingPolyConfig"] = _BOUNDINGPOLYCONFIG +DESCRIPTOR.message_types_by_name["PolylineConfig"] = _POLYLINECONFIG +DESCRIPTOR.message_types_by_name["SegmentationConfig"] = _SEGMENTATIONCONFIG +DESCRIPTOR.message_types_by_name[ + "VideoClassificationConfig" +] = _VIDEOCLASSIFICATIONCONFIG +DESCRIPTOR.message_types_by_name["ObjectDetectionConfig"] = _OBJECTDETECTIONCONFIG +DESCRIPTOR.message_types_by_name["ObjectTrackingConfig"] = _OBJECTTRACKINGCONFIG +DESCRIPTOR.message_types_by_name["EventConfig"] = _EVENTCONFIG +DESCRIPTOR.message_types_by_name["TextClassificationConfig"] = _TEXTCLASSIFICATIONCONFIG +DESCRIPTOR.message_types_by_name["SentimentConfig"] = _SENTIMENTCONFIG +DESCRIPTOR.message_types_by_name[ + "TextEntityExtractionConfig" +] = _TEXTENTITYEXTRACTIONCONFIG +DESCRIPTOR.enum_types_by_name["StringAggregationType"] = _STRINGAGGREGATIONTYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +HumanAnnotationConfig = _reflection.GeneratedProtocolMessageType( + "HumanAnnotationConfig", + (_message.Message,), + dict( + DESCRIPTOR=_HUMANANNOTATIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Configuration for how human labeling task should be done. + + + Attributes: + instruction: + Required except for LabelAudio case. Instruction resource + name. + annotated_dataset_display_name: + Required. A human-readable name for AnnotatedDataset defined + by users. Maximum of 64 characters . + annotated_dataset_description: + Optional. A human-readable description for AnnotatedDataset. + The description can be up to 10000 characters long. + label_group: + Optional. A human-readable label used to logically group + labeling tasks. This string must match the regular expression + ``[a-zA-Z\\d_-]{0,128}``. + language_code: + Optional. The Language of this question, as a `BCP-47 + `__. Default + value is en-US. Only need to set this when task is language + related. For example, French text classification or Chinese + audio transcription. + replica_count: + Optional. Replication of questions. Each question will be sent + to up to this number of contributors to label. Aggregated + answers will be returned. Default is set to 1. For image + related labeling, valid values are 1, 3, 5. + question_duration: + Optional. Maximum duration for contributors to answer a + question. Default is 1800 seconds. + contributor_emails: + Optional. If you want your own labeling contributors to manage + and work on this labeling request, you can set these + contributors here. We will give them access to the question + types in crowdcompute. Note that these emails must be + registered in crowdcompute worker UI: https://crowd- + compute.appspot.com/ + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.HumanAnnotationConfig) + ), +) +_sym_db.RegisterMessage(HumanAnnotationConfig) + +ImageClassificationConfig = _reflection.GeneratedProtocolMessageType( + "ImageClassificationConfig", + (_message.Message,), + dict( + DESCRIPTOR=_IMAGECLASSIFICATIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for image classification human labeling task. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + allow_multi_label: + Optional. If allow\_multi\_label is true, contributors are + able to choose multiple labels for one image. + answer_aggregation_type: + Optional. The type of how to aggregate answers. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageClassificationConfig) + ), +) +_sym_db.RegisterMessage(ImageClassificationConfig) + +BoundingPolyConfig = _reflection.GeneratedProtocolMessageType( + "BoundingPolyConfig", + (_message.Message,), + dict( + DESCRIPTOR=_BOUNDINGPOLYCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for image bounding poly (and bounding box) human labeling task. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + instruction_message: + Optional. Instruction message showed on contributors UI. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.BoundingPolyConfig) + ), +) +_sym_db.RegisterMessage(BoundingPolyConfig) + +PolylineConfig = _reflection.GeneratedProtocolMessageType( + "PolylineConfig", + (_message.Message,), + dict( + DESCRIPTOR=_POLYLINECONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for image polyline human labeling task. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + instruction_message: + Optional. Instruction message showed on contributors UI. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PolylineConfig) + ), +) +_sym_db.RegisterMessage(PolylineConfig) + +SegmentationConfig = _reflection.GeneratedProtocolMessageType( + "SegmentationConfig", + (_message.Message,), + dict( + DESCRIPTOR=_SEGMENTATIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for image segmentation + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. format: projects/ + {project\_id}/annotationSpecSets/{annotation\_spec\_set\_id} + instruction_message: + Instruction message showed on labelers UI. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SegmentationConfig) + ), +) +_sym_db.RegisterMessage(SegmentationConfig) + +VideoClassificationConfig = _reflection.GeneratedProtocolMessageType( + "VideoClassificationConfig", + (_message.Message,), + dict( + AnnotationSpecSetConfig=_reflection.GeneratedProtocolMessageType( + "AnnotationSpecSetConfig", + (_message.Message,), + dict( + DESCRIPTOR=_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Annotation spec set with the setting of allowing multi labels or not. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + allow_multi_label: + Optional. If allow\_multi\_label is true, contributors are + able to choose multiple labels from one annotation spec set. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig) + ), + ), + DESCRIPTOR=_VIDEOCLASSIFICATIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for video classification human labeling task. Currently two types + of video classification are supported: 1. Assign labels on the entire + video. 2. Split the video into multiple video clips based on camera + shot, and assign labels on each video clip. + + + Attributes: + annotation_spec_set_configs: + Required. The list of annotation spec set configs. Since + watching a video clip takes much longer time than an image, we + support label with multiple AnnotationSpecSet at the same + time. Labels in each AnnotationSpecSet will be shown in a + group to contributors. Contributors can select one or more + (depending on whether to allow multi label) from each group. + apply_shot_detection: + Optional. Option to apply shot detection on the video. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoClassificationConfig) + ), +) +_sym_db.RegisterMessage(VideoClassificationConfig) +_sym_db.RegisterMessage(VideoClassificationConfig.AnnotationSpecSetConfig) + +ObjectDetectionConfig = _reflection.GeneratedProtocolMessageType( + "ObjectDetectionConfig", + (_message.Message,), + dict( + DESCRIPTOR=_OBJECTDETECTIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for video object detection human labeling task. Object detection + will be conducted on the images extracted from the video, and those + objects will be labeled with bounding boxes. User need to specify the + number of images to be extracted per second as the extraction frame + rate. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + instruction_message: + Optional. Instruction message showed on labelers UI. + extraction_frame_rate: + Required. Number of frames per second to be extracted from the + video. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectDetectionConfig) + ), +) +_sym_db.RegisterMessage(ObjectDetectionConfig) + +ObjectTrackingConfig = _reflection.GeneratedProtocolMessageType( + "ObjectTrackingConfig", + (_message.Message,), + dict( + DESCRIPTOR=_OBJECTTRACKINGCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for video object tracking human labeling task. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectTrackingConfig) + ), +) +_sym_db.RegisterMessage(ObjectTrackingConfig) + +EventConfig = _reflection.GeneratedProtocolMessageType( + "EventConfig", + (_message.Message,), + dict( + DESCRIPTOR=_EVENTCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for video event human labeling task. + + + Attributes: + annotation_spec_sets: + Required. The list of annotation spec set resource name. + Similar to video classification, we support selecting event + from multiple AnnotationSpecSet at the same time. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EventConfig) + ), +) +_sym_db.RegisterMessage(EventConfig) + +TextClassificationConfig = _reflection.GeneratedProtocolMessageType( + "TextClassificationConfig", + (_message.Message,), + dict( + DESCRIPTOR=_TEXTCLASSIFICATIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for text classification human labeling task. + + + Attributes: + allow_multi_label: + Optional. If allow\_multi\_label is true, contributors are + able to choose multiple labels for one text segment. + annotation_spec_set: + Required. Annotation spec set resource name. + sentiment_config: + Optional. Configs for sentiment selection. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextClassificationConfig) + ), +) +_sym_db.RegisterMessage(TextClassificationConfig) + +SentimentConfig = _reflection.GeneratedProtocolMessageType( + "SentimentConfig", + (_message.Message,), + dict( + DESCRIPTOR=_SENTIMENTCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for setting up sentiments. + + + Attributes: + enable_label_sentiment_selection: + If set to true, contributors will have the option to select + sentiment of the label they selected, to mark it as negative + or positive label. Default is false. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SentimentConfig) + ), +) +_sym_db.RegisterMessage(SentimentConfig) + +TextEntityExtractionConfig = _reflection.GeneratedProtocolMessageType( + "TextEntityExtractionConfig", + (_message.Message,), + dict( + DESCRIPTOR=_TEXTENTITYEXTRACTIONCONFIG, + __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", + __doc__="""Config for text entity extraction human labeling task. + + + Attributes: + annotation_spec_set: + Required. Annotation spec set resource name. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig) + ), +) +_sym_db.RegisterMessage(TextEntityExtractionConfig) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto new file mode 100644 index 000000000000..d1a1e751c9a3 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto @@ -0,0 +1,78 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +// Instruction of how to perform the labeling task for human operators. +// Currently two types of instruction are supported - CSV file and PDF. +// One of the two types instruction must be provided. +// CSV file is only supported for image classification task. Instructions for +// other task should be provided as PDF. +// For image classification, CSV and PDF can be provided at the same time. +message Instruction { + // Output only. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; + + // Required. The display name of the instruction. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the instruction. + // The description can be up to 10000 characters long. + string description = 3; + + // Output only. Creation time of instruction. + google.protobuf.Timestamp create_time = 4; + + // Output only. Last update time of instruction. + google.protobuf.Timestamp update_time = 5; + + // Required. The data type of this instruction. + DataType data_type = 6; + + // One of CSV and PDF instruction is required. + // Instruction from a csv file, such as for classification task. + // Csv file should have exact two columns, in the format of: + // The first column is labeled data, such as image reference, text. + // The second column is comma separated labels associated with data. + CsvInstruction csv_instruction = 7; + + // One of CSV and PDF instruction is required. + // Instruction from a PDF doc. The PDF doc should be in GCS bucket. + PdfInstruction pdf_instruction = 9; +} + +// Instruction from a CSV file. +message CsvInstruction { + // CSV file for the instruction. Only gcs path is allowed. + string gcs_file_uri = 1; +} + +// Instruction from a PDF file. +message PdfInstruction { + // PDF file for the instruction. Only gcs path is allowed. + string gcs_file_uri = 1; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py new file mode 100644 index 000000000000..560eae2a3909 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py @@ -0,0 +1,385 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/instruction.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.cloud.datalabeling_v1beta1.proto import ( + dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, +) +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/instruction.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\n9google/cloud/datalabeling_v1beta1/proto/instruction.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x35google/cloud/datalabeling_v1beta1/proto/dataset.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x80\x03\n\x0bInstruction\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12>\n\tdata_type\x18\x06 \x01(\x0e\x32+.google.cloud.datalabeling.v1beta1.DataType\x12J\n\x0f\x63sv_instruction\x18\x07 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.CsvInstruction\x12J\n\x0fpdf_instruction\x18\t \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.PdfInstruction"&\n\x0e\x43svInstruction\x12\x14\n\x0cgcs_file_uri\x18\x01 \x01(\t"&\n\x0ePdfInstruction\x12\x14\n\x0cgcs_file_uri\x18\x01 \x01(\tBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[ + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + + +_INSTRUCTION = _descriptor.Descriptor( + name="Instruction", + full_name="google.cloud.datalabeling.v1beta1.Instruction", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.datalabeling.v1beta1.Instruction.name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datalabeling.v1beta1.Instruction.display_name", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datalabeling.v1beta1.Instruction.description", + index=2, + number=3, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="create_time", + full_name="google.cloud.datalabeling.v1beta1.Instruction.create_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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="update_time", + full_name="google.cloud.datalabeling.v1beta1.Instruction.update_time", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="data_type", + full_name="google.cloud.datalabeling.v1beta1.Instruction.data_type", + index=5, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="csv_instruction", + full_name="google.cloud.datalabeling.v1beta1.Instruction.csv_instruction", + index=6, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="pdf_instruction", + full_name="google.cloud.datalabeling.v1beta1.Instruction.pdf_instruction", + index=7, + number=9, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=215, + serialized_end=599, +) + + +_CSVINSTRUCTION = _descriptor.Descriptor( + name="CsvInstruction", + full_name="google.cloud.datalabeling.v1beta1.CsvInstruction", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_file_uri", + full_name="google.cloud.datalabeling.v1beta1.CsvInstruction.gcs_file_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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=601, + serialized_end=639, +) + + +_PDFINSTRUCTION = _descriptor.Descriptor( + name="PdfInstruction", + full_name="google.cloud.datalabeling.v1beta1.PdfInstruction", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="gcs_file_uri", + full_name="google.cloud.datalabeling.v1beta1.PdfInstruction.gcs_file_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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=641, + serialized_end=679, +) + +_INSTRUCTION.fields_by_name[ + "create_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_INSTRUCTION.fields_by_name[ + "update_time" +].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_INSTRUCTION.fields_by_name[ + "data_type" +].enum_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATATYPE +) +_INSTRUCTION.fields_by_name["csv_instruction"].message_type = _CSVINSTRUCTION +_INSTRUCTION.fields_by_name["pdf_instruction"].message_type = _PDFINSTRUCTION +DESCRIPTOR.message_types_by_name["Instruction"] = _INSTRUCTION +DESCRIPTOR.message_types_by_name["CsvInstruction"] = _CSVINSTRUCTION +DESCRIPTOR.message_types_by_name["PdfInstruction"] = _PDFINSTRUCTION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Instruction = _reflection.GeneratedProtocolMessageType( + "Instruction", + (_message.Message,), + dict( + DESCRIPTOR=_INSTRUCTION, + __module__="google.cloud.datalabeling_v1beta1.proto.instruction_pb2", + __doc__="""Instruction of how to perform the labeling task for human operators. + Currently two types of instruction are supported - CSV file and PDF. One + of the two types instruction must be provided. CSV file is only + supported for image classification task. Instructions for other task + should be provided as PDF. For image classification, CSV and PDF can be + provided at the same time. + + + Attributes: + name: + Output only. Instruction resource name, format: + projects/{project\_id}/instructions/{instruction\_id} + display_name: + Required. The display name of the instruction. Maximum of 64 + characters. + description: + Optional. User-provided description of the instruction. The + description can be up to 10000 characters long. + create_time: + Output only. Creation time of instruction. + update_time: + Output only. Last update time of instruction. + data_type: + Required. The data type of this instruction. + csv_instruction: + One of CSV and PDF instruction is required. Instruction from a + csv file, such as for classification task. Csv file should + have exact two columns, in the format of: The first column is + labeled data, such as image reference, text. The second column + is comma separated labels associated with data. + pdf_instruction: + One of CSV and PDF instruction is required. Instruction from a + PDF doc. The PDF doc should be in GCS bucket. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Instruction) + ), +) +_sym_db.RegisterMessage(Instruction) + +CsvInstruction = _reflection.GeneratedProtocolMessageType( + "CsvInstruction", + (_message.Message,), + dict( + DESCRIPTOR=_CSVINSTRUCTION, + __module__="google.cloud.datalabeling_v1beta1.proto.instruction_pb2", + __doc__="""Instruction from a CSV file. + + + Attributes: + gcs_file_uri: + CSV file for the instruction. Only gcs path is allowed. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CsvInstruction) + ), +) +_sym_db.RegisterMessage(CsvInstruction) + +PdfInstruction = _reflection.GeneratedProtocolMessageType( + "PdfInstruction", + (_message.Message,), + dict( + DESCRIPTOR=_PDFINSTRUCTION, + __module__="google.cloud.datalabeling_v1beta1.proto.instruction_pb2", + __doc__="""Instruction from a PDF file. + + + Attributes: + gcs_file_uri: + PDF file for the instruction. Only gcs path is allowed. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PdfInstruction) + ), +) +_sym_db.RegisterMessage(PdfInstruction) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto new file mode 100644 index 000000000000..71815e5310e3 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto @@ -0,0 +1,206 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/cloud/datalabeling/v1beta1/instruction.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + +// Response used for ImportData longrunning operation. +message ImportDataOperationResponse { + // Ouptut only. The name of imported dataset. + string dataset = 1; + + // Output only. Total number of examples requested to import + int32 total_count = 2; + + // Output only. Number of examples imported successfully. + int32 import_count = 3; +} + +// Response used for ExportDataset longrunning operation. +message ExportDataOperationResponse { + // Ouptut only. The name of dataset. + // "projects/*/datasets/*/Datasets/*" + string dataset = 1; + + // Output only. Total number of examples requested to export + int32 total_count = 2; + + // Output only. Number of examples exported successfully. + int32 export_count = 3; + + // Output only. Statistic infos of labels in the exported dataset. + LabelStats label_stats = 4; + + // Output only. output_config in the ExportData request. + OutputConfig output_config = 5; +} + +// Metadata of an ImportData operation. +message ImportDataOperationMetadata { + // Ouptut only. The name of imported dataset. + // "projects/*/datasets/*" + string dataset = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; +} + +// Metadata of an ExportData operation. +message ExportDataOperationMetadata { + // Output only. The name of dataset to be exported. + // "projects/*/datasets/*/Datasets/*" + string dataset = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; +} + +// Metadata of a labeling operation, such as LabelImage or LabelVideo. +// Next tag: 16 +message LabelOperationMetadata { + // Output only. Progress of label operation. Range: [0, 100]. + // Currently not supported. + int32 progress_percent = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Ouptut only. Details of specific label operation. + oneof details { + LabelImageClassificationOperationMetadata image_classification_details = 3; + LabelImageBoundingBoxOperationMetadata image_bounding_box_details = 4; + LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11; + LabelImageOrientedBoundingBoxOperationMetadata + image_oriented_bounding_box_details = 14; + LabelImagePolylineOperationMetadata image_polyline_details = 12; + LabelImageSegmentationOperationMetadata image_segmentation_details = 15; + LabelVideoClassificationOperationMetadata video_classification_details = 5; + LabelVideoObjectDetectionOperationMetadata video_object_detection_details = + 6; + LabelVideoObjectTrackingOperationMetadata video_object_tracking_details = 7; + LabelVideoEventOperationMetadata video_event_details = 8; + LabelTextClassificationOperationMetadata text_classification_details = 9; + LabelAudioTranscriptionOperationMetadata audio_transcription_details = 10; + LabelTextEntityExtractionOperationMetadata text_entity_extraction_details = + 13; + } +} + +// Metadata of a LabelImageClassification operation. +message LabelImageClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageBoundingBox operation metadata. +message LabelImageBoundingBoxOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageOrientedBoundingBox operation metadata. +message LabelImageOrientedBoundingBoxOperationMetadata { + // Basic human annotation config. + HumanAnnotationConfig basic_config = 1; +} + +// Details of LabelImageBoundingPoly operation metadata. +message LabelImageBoundingPolyOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of LabelImagePolyline operation metadata. +message LabelImagePolylineOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageSegmentation operation metadata. +message LabelImageSegmentationOperationMetadata { + // Basic human annotation config. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoClassification operation metadata. +message LabelVideoClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoObjectDetection operation metadata. +message LabelVideoObjectDetectionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoObjectTracking operation metadata. +message LabelVideoObjectTrackingOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoEvent operation metadata. +message LabelVideoEventOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelTextClassification operation metadata. +message LabelTextClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +message LabelAudioTranscriptionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelTextEntityExtraction operation metadata. +message LabelTextEntityExtractionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Metadata of a CreateInstruction operation. +message CreateInstructionMetadata { + // Output only. The name of the created Instruction. + // projects/{project_id}/instructions/{instruction_id} + string instruction = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; +} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py new file mode 100644 index 000000000000..e8dcd2ae93e4 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py @@ -0,0 +1,1853 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datalabeling_v1beta1/proto/operations.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +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 + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.cloud.datalabeling_v1beta1.proto import ( + dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, +) +from google.cloud.datalabeling_v1beta1.proto import ( + instruction_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__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 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datalabeling_v1beta1/proto/operations.proto", + package="google.cloud.datalabeling.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" + ), + serialized_pb=_b( + '\n8google/cloud/datalabeling_v1beta1/proto/operations.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x35google/cloud/datalabeling_v1beta1/proto/dataset.proto\x1a\x45google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x1a\x39google/cloud/datalabeling_v1beta1/proto/instruction.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1cgoogle/api/annotations.proto"Y\n\x1bImportDataOperationResponse\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12\x13\n\x0btotal_count\x18\x02 \x01(\x05\x12\x14\n\x0cimport_count\x18\x03 \x01(\x05"\xe5\x01\n\x1b\x45xportDataOperationResponse\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12\x13\n\x0btotal_count\x18\x02 \x01(\x05\x12\x14\n\x0c\x65xport_count\x18\x03 \x01(\x05\x12\x42\n\x0blabel_stats\x18\x04 \x01(\x0b\x32-.google.cloud.datalabeling.v1beta1.LabelStats\x12\x46\n\routput_config\x18\x05 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.OutputConfig"\\\n\x1bImportDataOperationMetadata\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status"\\\n\x1b\x45xportDataOperationMetadata\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status"\xcf\x0c\n\x16LabelOperationMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12t\n\x1cimage_classification_details\x18\x03 \x01(\x0b\x32L.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadataH\x00\x12o\n\x1aimage_bounding_box_details\x18\x04 \x01(\x0b\x32I.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadataH\x00\x12q\n\x1bimage_bounding_poly_details\x18\x0b \x01(\x0b\x32J.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadataH\x00\x12\x80\x01\n#image_oriented_bounding_box_details\x18\x0e \x01(\x0b\x32Q.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadataH\x00\x12h\n\x16image_polyline_details\x18\x0c \x01(\x0b\x32\x46.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadataH\x00\x12p\n\x1aimage_segmentation_details\x18\x0f \x01(\x0b\x32J.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadataH\x00\x12t\n\x1cvideo_classification_details\x18\x05 \x01(\x0b\x32L.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadataH\x00\x12w\n\x1evideo_object_detection_details\x18\x06 \x01(\x0b\x32M.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadataH\x00\x12u\n\x1dvideo_object_tracking_details\x18\x07 \x01(\x0b\x32L.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadataH\x00\x12\x62\n\x13video_event_details\x18\x08 \x01(\x0b\x32\x43.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadataH\x00\x12r\n\x1btext_classification_details\x18\t \x01(\x0b\x32K.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadataH\x00\x12r\n\x1b\x61udio_transcription_details\x18\n \x01(\x0b\x32K.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadataH\x00\x12w\n\x1etext_entity_extraction_details\x18\r \x01(\x0b\x32M.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadataH\x00\x42\t\n\x07\x64\x65tails"{\n)LabelImageClassificationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"x\n&LabelImageBoundingBoxOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"\x80\x01\n.LabelImageOrientedBoundingBoxOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"y\n\'LabelImageBoundingPolyOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"u\n#LabelImagePolylineOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"y\n\'LabelImageSegmentationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"{\n)LabelVideoClassificationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"|\n*LabelVideoObjectDetectionOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"{\n)LabelVideoObjectTrackingOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"r\n LabelVideoEventOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"z\n(LabelTextClassificationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"z\n(LabelAudioTranscriptionOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"|\n*LabelTextEntityExtractionOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"^\n\x19\x43reateInstructionMetadata\x12\x13\n\x0binstruction\x18\x01 \x01(\t\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.StatusBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' + ), + dependencies=[ + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2.DESCRIPTOR, + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + google_dot_rpc_dot_status__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + + +_IMPORTDATAOPERATIONRESPONSE = _descriptor.Descriptor( + name="ImportDataOperationResponse", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="dataset", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.dataset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="total_count", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.total_count", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="import_count", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.import_count", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=368, + serialized_end=457, +) + + +_EXPORTDATAOPERATIONRESPONSE = _descriptor.Descriptor( + name="ExportDataOperationResponse", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="dataset", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.dataset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="total_count", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.total_count", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="export_count", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.export_count", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="label_stats", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.label_stats", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="output_config", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.output_config", + index=4, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=460, + serialized_end=689, +) + + +_IMPORTDATAOPERATIONMETADATA = _descriptor.Descriptor( + name="ImportDataOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="dataset", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.dataset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="partial_failures", + full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.partial_failures", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=691, + serialized_end=783, +) + + +_EXPORTDATAOPERATIONMETADATA = _descriptor.Descriptor( + name="ExportDataOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="dataset", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.dataset", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="partial_failures", + full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.partial_failures", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=785, + serialized_end=877, +) + + +_LABELOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="progress_percent", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.progress_percent", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="partial_failures", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.partial_failures", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_classification_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_classification_details", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_bounding_box_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_bounding_box_details", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_bounding_poly_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_bounding_poly_details", + index=4, + number=11, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_oriented_bounding_box_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_oriented_bounding_box_details", + index=5, + number=14, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_polyline_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_polyline_details", + index=6, + number=12, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="image_segmentation_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_segmentation_details", + index=7, + number=15, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_classification_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_classification_details", + index=8, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_object_detection_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_object_detection_details", + index=9, + number=6, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_object_tracking_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_object_tracking_details", + index=10, + number=7, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="video_event_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_event_details", + index=11, + number=8, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_classification_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.text_classification_details", + index=12, + number=9, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="audio_transcription_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.audio_transcription_details", + index=13, + number=10, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="text_entity_extraction_details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.text_entity_extraction_details", + index=14, + number=13, + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="details", + full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.details", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=880, + serialized_end=2495, +) + + +_LABELIMAGECLASSIFICATIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelImageClassificationOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2497, + serialized_end=2620, +) + + +_LABELIMAGEBOUNDINGBOXOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelImageBoundingBoxOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2622, + serialized_end=2742, +) + + +_LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelImageOrientedBoundingBoxOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2745, + serialized_end=2873, +) + + +_LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelImageBoundingPolyOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2875, + serialized_end=2996, +) + + +_LABELIMAGEPOLYLINEOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelImagePolylineOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2998, + serialized_end=3115, +) + + +_LABELIMAGESEGMENTATIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelImageSegmentationOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3117, + serialized_end=3238, +) + + +_LABELVIDEOCLASSIFICATIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelVideoClassificationOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3240, + serialized_end=3363, +) + + +_LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelVideoObjectDetectionOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3365, + serialized_end=3489, +) + + +_LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelVideoObjectTrackingOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3491, + serialized_end=3614, +) + + +_LABELVIDEOEVENTOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelVideoEventOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3616, + serialized_end=3730, +) + + +_LABELTEXTCLASSIFICATIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelTextClassificationOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3732, + serialized_end=3854, +) + + +_LABELAUDIOTRANSCRIPTIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelAudioTranscriptionOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3856, + serialized_end=3978, +) + + +_LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA = _descriptor.Descriptor( + name="LabelTextEntityExtractionOperationMetadata", + full_name="google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="basic_config", + full_name="google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.basic_config", + 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, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3980, + serialized_end=4104, +) + + +_CREATEINSTRUCTIONMETADATA = _descriptor.Descriptor( + name="CreateInstructionMetadata", + full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="instruction", + full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.instruction", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="partial_failures", + full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.partial_failures", + 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, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=4106, + serialized_end=4200, +) + +_EXPORTDATAOPERATIONRESPONSE.fields_by_name[ + "label_stats" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._LABELSTATS +) +_EXPORTDATAOPERATIONRESPONSE.fields_by_name[ + "output_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._OUTPUTCONFIG +) +_IMPORTDATAOPERATIONMETADATA.fields_by_name[ + "partial_failures" +].message_type = google_dot_rpc_dot_status__pb2._STATUS +_EXPORTDATAOPERATIONMETADATA.fields_by_name[ + "partial_failures" +].message_type = google_dot_rpc_dot_status__pb2._STATUS +_LABELOPERATIONMETADATA.fields_by_name[ + "partial_failures" +].message_type = google_dot_rpc_dot_status__pb2._STATUS +_LABELOPERATIONMETADATA.fields_by_name[ + "image_classification_details" +].message_type = _LABELIMAGECLASSIFICATIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "image_bounding_box_details" +].message_type = _LABELIMAGEBOUNDINGBOXOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "image_bounding_poly_details" +].message_type = _LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "image_oriented_bounding_box_details" +].message_type = _LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "image_polyline_details" +].message_type = _LABELIMAGEPOLYLINEOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "image_segmentation_details" +].message_type = _LABELIMAGESEGMENTATIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "video_classification_details" +].message_type = _LABELVIDEOCLASSIFICATIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "video_object_detection_details" +].message_type = _LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "video_object_tracking_details" +].message_type = _LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "video_event_details" +].message_type = _LABELVIDEOEVENTOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "text_classification_details" +].message_type = _LABELTEXTCLASSIFICATIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "audio_transcription_details" +].message_type = _LABELAUDIOTRANSCRIPTIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.fields_by_name[ + "text_entity_extraction_details" +].message_type = _LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["image_classification_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "image_classification_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["image_bounding_box_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "image_bounding_box_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["image_bounding_poly_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "image_bounding_poly_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["image_oriented_bounding_box_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "image_oriented_bounding_box_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["image_polyline_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "image_polyline_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["image_segmentation_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "image_segmentation_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["video_classification_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "video_classification_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["video_object_detection_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "video_object_detection_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["video_object_tracking_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "video_object_tracking_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["video_event_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "video_event_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["text_classification_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "text_classification_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["audio_transcription_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "audio_transcription_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( + _LABELOPERATIONMETADATA.fields_by_name["text_entity_extraction_details"] +) +_LABELOPERATIONMETADATA.fields_by_name[ + "text_entity_extraction_details" +].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] +_LABELIMAGECLASSIFICATIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELIMAGEBOUNDINGBOXOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELIMAGEPOLYLINEOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELIMAGESEGMENTATIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELVIDEOCLASSIFICATIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELVIDEOEVENTOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELTEXTCLASSIFICATIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELAUDIOTRANSCRIPTIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA.fields_by_name[ + "basic_config" +].message_type = ( + google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG +) +_CREATEINSTRUCTIONMETADATA.fields_by_name[ + "partial_failures" +].message_type = google_dot_rpc_dot_status__pb2._STATUS +DESCRIPTOR.message_types_by_name[ + "ImportDataOperationResponse" +] = _IMPORTDATAOPERATIONRESPONSE +DESCRIPTOR.message_types_by_name[ + "ExportDataOperationResponse" +] = _EXPORTDATAOPERATIONRESPONSE +DESCRIPTOR.message_types_by_name[ + "ImportDataOperationMetadata" +] = _IMPORTDATAOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "ExportDataOperationMetadata" +] = _EXPORTDATAOPERATIONMETADATA +DESCRIPTOR.message_types_by_name["LabelOperationMetadata"] = _LABELOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelImageClassificationOperationMetadata" +] = _LABELIMAGECLASSIFICATIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelImageBoundingBoxOperationMetadata" +] = _LABELIMAGEBOUNDINGBOXOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelImageOrientedBoundingBoxOperationMetadata" +] = _LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelImageBoundingPolyOperationMetadata" +] = _LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelImagePolylineOperationMetadata" +] = _LABELIMAGEPOLYLINEOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelImageSegmentationOperationMetadata" +] = _LABELIMAGESEGMENTATIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelVideoClassificationOperationMetadata" +] = _LABELVIDEOCLASSIFICATIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelVideoObjectDetectionOperationMetadata" +] = _LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelVideoObjectTrackingOperationMetadata" +] = _LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelVideoEventOperationMetadata" +] = _LABELVIDEOEVENTOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelTextClassificationOperationMetadata" +] = _LABELTEXTCLASSIFICATIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelAudioTranscriptionOperationMetadata" +] = _LABELAUDIOTRANSCRIPTIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "LabelTextEntityExtractionOperationMetadata" +] = _LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA +DESCRIPTOR.message_types_by_name[ + "CreateInstructionMetadata" +] = _CREATEINSTRUCTIONMETADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ImportDataOperationResponse = _reflection.GeneratedProtocolMessageType( + "ImportDataOperationResponse", + (_message.Message,), + dict( + DESCRIPTOR=_IMPORTDATAOPERATIONRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Response used for ImportData longrunning operation. + + + Attributes: + dataset: + Ouptut only. The name of imported dataset. + total_count: + Output only. Total number of examples requested to import + import_count: + Output only. Number of examples imported successfully. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImportDataOperationResponse) + ), +) +_sym_db.RegisterMessage(ImportDataOperationResponse) + +ExportDataOperationResponse = _reflection.GeneratedProtocolMessageType( + "ExportDataOperationResponse", + (_message.Message,), + dict( + DESCRIPTOR=_EXPORTDATAOPERATIONRESPONSE, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Response used for ExportDataset longrunning operation. + + + Attributes: + dataset: + Ouptut only. The name of dataset. + "projects/*/datasets/*/Datasets/\*" + total_count: + Output only. Total number of examples requested to export + export_count: + Output only. Number of examples exported successfully. + label_stats: + Output only. Statistic infos of labels in the exported + dataset. + output_config: + Output only. output\_config in the ExportData request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ExportDataOperationResponse) + ), +) +_sym_db.RegisterMessage(ExportDataOperationResponse) + +ImportDataOperationMetadata = _reflection.GeneratedProtocolMessageType( + "ImportDataOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_IMPORTDATAOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Metadata of an ImportData operation. + + + Attributes: + dataset: + Ouptut only. The name of imported dataset. + "projects/*/datasets/*" + partial_failures: + Output only. Partial failures encountered. E.g. single files + that couldn't be read. Status details field will contain + standard GCP error details. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata) + ), +) +_sym_db.RegisterMessage(ImportDataOperationMetadata) + +ExportDataOperationMetadata = _reflection.GeneratedProtocolMessageType( + "ExportDataOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_EXPORTDATAOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Metadata of an ExportData operation. + + + Attributes: + dataset: + Output only. The name of dataset to be exported. + "projects/*/datasets/*/Datasets/\*" + partial_failures: + Output only. Partial failures encountered. E.g. single files + that couldn't be read. Status details field will contain + standard GCP error details. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata) + ), +) +_sym_db.RegisterMessage(ExportDataOperationMetadata) + +LabelOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Metadata of a labeling operation, such as LabelImage or LabelVideo. Next + tag: 16 + + + Attributes: + progress_percent: + Output only. Progress of label operation. Range: [0, 100]. + Currently not supported. + partial_failures: + Output only. Partial failures encountered. E.g. single files + that couldn't be read. Status details field will contain + standard GCP error details. + details: + Ouptut only. Details of specific label operation. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelOperationMetadata) + +LabelImageClassificationOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelImageClassificationOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGECLASSIFICATIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Metadata of a LabelImageClassification operation. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelImageClassificationOperationMetadata) + +LabelImageBoundingBoxOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelImageBoundingBoxOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGEBOUNDINGBOXOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelImageBoundingBox operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelImageBoundingBoxOperationMetadata) + +LabelImageOrientedBoundingBoxOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelImageOrientedBoundingBoxOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelImageOrientedBoundingBox operation metadata. + + + Attributes: + basic_config: + Basic human annotation config. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelImageOrientedBoundingBoxOperationMetadata) + +LabelImageBoundingPolyOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelImageBoundingPolyOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of LabelImageBoundingPoly operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelImageBoundingPolyOperationMetadata) + +LabelImagePolylineOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelImagePolylineOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGEPOLYLINEOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of LabelImagePolyline operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelImagePolylineOperationMetadata) + +LabelImageSegmentationOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelImageSegmentationOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELIMAGESEGMENTATIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelImageSegmentation operation metadata. + + + Attributes: + basic_config: + Basic human annotation config. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelImageSegmentationOperationMetadata) + +LabelVideoClassificationOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelVideoClassificationOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELVIDEOCLASSIFICATIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelVideoClassification operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelVideoClassificationOperationMetadata) + +LabelVideoObjectDetectionOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelVideoObjectDetectionOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelVideoObjectDetection operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelVideoObjectDetectionOperationMetadata) + +LabelVideoObjectTrackingOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelVideoObjectTrackingOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelVideoObjectTracking operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelVideoObjectTrackingOperationMetadata) + +LabelVideoEventOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelVideoEventOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELVIDEOEVENTOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelVideoEvent operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelVideoEventOperationMetadata) + +LabelTextClassificationOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelTextClassificationOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELTEXTCLASSIFICATIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelTextClassification operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelTextClassificationOperationMetadata) + +LabelAudioTranscriptionOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelAudioTranscriptionOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELAUDIOTRANSCRIPTIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelAudioTranscriptionOperationMetadata) + +LabelTextEntityExtractionOperationMetadata = _reflection.GeneratedProtocolMessageType( + "LabelTextEntityExtractionOperationMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Details of a LabelTextEntityExtraction operation metadata. + + + Attributes: + basic_config: + Basic human annotation config used in labeling request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata) + ), +) +_sym_db.RegisterMessage(LabelTextEntityExtractionOperationMetadata) + +CreateInstructionMetadata = _reflection.GeneratedProtocolMessageType( + "CreateInstructionMetadata", + (_message.Message,), + dict( + DESCRIPTOR=_CREATEINSTRUCTIONMETADATA, + __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", + __doc__="""Metadata of a CreateInstruction operation. + + + Attributes: + instruction: + Output only. The name of the created Instruction. + projects/{project\_id}/instructions/{instruction\_id} + partial_failures: + Output only. Partial failures encountered. E.g. single files + that couldn't be read. Status details field will contain + standard GCP error details. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateInstructionMetadata) + ), +) +_sym_db.RegisterMessage(CreateInstructionMetadata) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py new file mode 100644 index 000000000000..07cb78fe03a9 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/types.py b/datalabeling/google/cloud/datalabeling_v1beta1/types.py new file mode 100644 index 000000000000..92255ffeec85 --- /dev/null +++ b/datalabeling/google/cloud/datalabeling_v1beta1/types.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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 +import sys + +from google.api_core.protobuf_helpers import get_messages + +from google.cloud.datalabeling_v1beta1.proto import annotation_pb2 +from google.cloud.datalabeling_v1beta1.proto import annotation_spec_set_pb2 +from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2 +from google.cloud.datalabeling_v1beta1.proto import dataset_pb2 +from google.cloud.datalabeling_v1beta1.proto import human_annotation_config_pb2 +from google.cloud.datalabeling_v1beta1.proto import instruction_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import duration_pb2 +from google.protobuf import empty_pb2 +from google.protobuf import timestamp_pb2 +from google.rpc import status_pb2 + +_shared_modules = [ + operations_pb2, + any_pb2, + duration_pb2, + empty_pb2, + timestamp_pb2, + status_pb2, +] + +_local_modules = [ + annotation_pb2, + annotation_spec_set_pb2, + data_labeling_service_pb2, + dataset_pb2, + human_annotation_config_pb2, + instruction_pb2, +] + +names = [] + +for module in _shared_modules: + for name, message in get_messages(module).items(): + setattr(sys.modules[__name__], name, message) + names.append(name) +for module in _local_modules: + for name, message in get_messages(module).items(): + message.__module__ = "google.cloud.datalabeling_v1beta1.types" + setattr(sys.modules[__name__], name, message) + names.append(name) + +__all__ = tuple(sorted(names)) diff --git a/datalabeling/noxfile.py b/datalabeling/noxfile.py new file mode 100644 index 000000000000..9e3b4be9fa0f --- /dev/null +++ b/datalabeling/noxfile.py @@ -0,0 +1,140 @@ +# -*- 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 +import os + +import nox + + +LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) + +@nox.session(python="3.7") +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", "black", *LOCAL_DEPS) + session.run( + "black", + "--check", + "google", + "tests", + "docs", + ) + session.run("flake8", "google", "tests") + + +@nox.session(python="3.6") +def blacken(session): + """Run black. + + Format code to uniform standard. + + This currently uses Python 3.6 due to the automated Kokoro run of synthtool. + That run uses an image that doesn't have 3.6 installed. Before updating this + check the state of the `gcp_ubuntu_config` we use for that Kokoro run. + """ + session.install("black") + session.run( + "black", + "google", + "tests", + "docs", + ) + + +@nox.session(python="3.7") +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") + + +def default(session): + # Install all test dependencies, then install this package in-place. + session.install("mock", "pytest", "pytest-cov") + for local_dep in LOCAL_DEPS: + session.install("-e", local_dep) + session.install("-e", ".") + + # Run py.test against the unit tests. + session.run( + "py.test", + "--quiet", + "--cov=google.cloud", + "--cov=tests.unit", + "--cov-append", + "--cov-config=.coveragerc", + "--cov-report=", + "--cov-fail-under=80", + os.path.join("tests", "unit"), + *session.posargs, + ) + + +@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) +def unit(session): + """Run the unit test suite.""" + default(session) + + +@nox.session(python=["2.7", "3.7"]) +def system(session): + """Run the system test suite.""" + system_test_path = os.path.join("tests", "system.py") + system_test_folder_path = os.path.join("tests", "system") + # Sanity check: Only run tests if the environment variable is set. + if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): + session.skip("Credentials must be set via environment variable") + + system_test_exists = os.path.exists(system_test_path) + system_test_folder_exists = os.path.exists(system_test_folder_path) + # Sanity check: only run tests if found. + if not system_test_exists and not system_test_folder_exists: + session.skip("System tests were not found") + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + # Install all test dependencies, then install this package into the + # virtualenv's dist-packages. + session.install("mock", "pytest") + for local_dep in LOCAL_DEPS: + session.install("-e", local_dep) + session.install("-e", "../test_utils/") + session.install("-e", ".") + + # Run py.test against the system tests. + if system_test_exists: + session.run("py.test", "--quiet", system_test_path, *session.posargs) + if system_test_folder_exists: + session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) + + +@nox.session(python="3.7") +def cover(session): + """Run the final coverage report. + + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=80") + + session.run("coverage", "erase") diff --git a/datalabeling/protos/annotation.proto b/datalabeling/protos/annotation.proto new file mode 100644 index 000000000000..d2f77344bbbc --- /dev/null +++ b/datalabeling/protos/annotation.proto @@ -0,0 +1,294 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +// Specifies where is the answer from. +enum AnnotationSource { + ANNOTATION_SOURCE_UNSPECIFIED = 0; + + // Answer is provided by a human contributor. + OPERATOR = 3; +} + +enum AnnotationSentiment { + ANNOTATION_SENTIMENT_UNSPECIFIED = 0; + + // This annotation describes negatively about the data. + NEGATIVE = 1; + + // This label describes positively about the data. + POSITIVE = 2; +} + +enum AnnotationType { + ANNOTATION_TYPE_UNSPECIFIED = 0; + + // Classification annotations in an image. + IMAGE_CLASSIFICATION_ANNOTATION = 1; + + // Bounding box annotations in an image. + IMAGE_BOUNDING_BOX_ANNOTATION = 2; + + // Bounding poly annotations in an image. + IMAGE_BOUNDING_POLY_ANNOTATION = 10; + + // Polyline annotations in an image. + IMAGE_POLYLINE_ANNOTATION = 11; + + // Classification annotations in video shots. + VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3; + + // Video object tracking annotation. + VIDEO_OBJECT_TRACKING_ANNOTATION = 4; + + // Video object detection annotation. + VIDEO_OBJECT_DETECTION_ANNOTATION = 5; + + // Video event annotation. + VIDEO_EVENT_ANNOTATION = 6; + + // Classification for text. + TEXT_CLASSIFICATION_ANNOTATION = 8; + + // Entity extraction for text. + TEXT_ENTITY_EXTRACTION_ANNOTATION = 9; +} + +// Annotation for Example. Each example may have one or more annotations. For +// example in image classification problem, each image might have one or more +// labels. We call labels binded with this image an Annotation. +message Annotation { + // Output only. Unique name of this annotation, format is: + // + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id} + string name = 1; + + // Output only. The source of the annotation. + AnnotationSource annotation_source = 2; + + // Output only. This is the actual annotation value, e.g classification, + // bounding box values are stored here. + AnnotationValue annotation_value = 3; + + // Output only. Annotation metadata, including information like votes + // for labels. + AnnotationMetadata annotation_metadata = 4; + + // Output only. Sentiment for this annotation. + AnnotationSentiment annotation_sentiment = 6; +} + +// Annotation value for an example. +message AnnotationValue { + oneof value_type { + // Annotation value for image classification case. + ImageClassificationAnnotation image_classification_annotation = 1; + + // Annotation value for image bounding box and polygon cases. + ImageBoundingPolyAnnotation image_bounding_poly_annotation = 2; + + // Annotation value for image polyline cases. + // Polyline here is different from BoundingPoly. It is formed by + // line segments connected to each other but not closed form(Bounding Poly). + // The line segments can cross each other. + ImagePolylineAnnotation image_polyline_annotation = 8; + + // Annotation value for text classification case. + TextClassificationAnnotation text_classification_annotation = 3; + + // Annotation value for video classification case. + VideoClassificationAnnotation video_classification_annotation = 4; + + // Annotation value for video object detection and tracking case. + VideoObjectTrackingAnnotation video_object_tracking_annotation = 5; + + // Annotation value for video event case. + VideoEventAnnotation video_event_annotation = 6; + } +} + +// Image classification annotation definition. +message ImageClassificationAnnotation { + // Label of image. + AnnotationSpec annotation_spec = 1; +} + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +message Vertex { + // X coordinate. + int32 x = 1; + + // Y coordinate. + int32 y = 2; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// A bounding polygon in the image. +message BoundingPoly { + // The bounding polygon vertices. + repeated Vertex vertices = 1; +} + +// Normalized bounding polygon. +message NormalizedBoundingPoly { + // The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 1; +} + +// Image bounding poly annotation. It represents a polygon including +// bounding box in the image. +message ImageBoundingPolyAnnotation { + // The region of the polygon. If it is a bounding box, it is guaranteed to be + // four points. + oneof bounded_area { + BoundingPoly bounding_poly = 2; + + NormalizedBoundingPoly normalized_bounding_poly = 3; + } + + // Label of object in this bounding polygon. + AnnotationSpec annotation_spec = 1; +} + +// A line with multiple line segments. +message Polyline { + // The polyline vertices. + repeated Vertex vertices = 1; +} + +// Normalized polyline. +message NormalizedPolyline { + // The normalized polyline vertices. + repeated NormalizedVertex normalized_vertices = 1; +} + +// A polyline for the image annotation. +message ImagePolylineAnnotation { + oneof poly { + Polyline polyline = 2; + + NormalizedPolyline normalized_polyline = 3; + } + + // Label of this polyline. + AnnotationSpec annotation_spec = 1; +} + +// Text classification annotation. +message TextClassificationAnnotation { + // Label of the text. + AnnotationSpec annotation_spec = 1; +} + +// A time period inside of an example that has a time dimension (e.g. video). +message TimeSegment { + // Start of the time segment (inclusive), represented as the duration since + // the example start. + google.protobuf.Duration start_time_offset = 1; + + // End of the time segment (exclusive), represented as the duration since the + // example start. + google.protobuf.Duration end_time_offset = 2; +} + +// Video classification annotation. +message VideoClassificationAnnotation { + // The time segment of the video to which the annotation applies. + TimeSegment time_segment = 1; + + // Label of the segment specified by time_segment. + AnnotationSpec annotation_spec = 2; +} + +// Video frame level annotation for object detection and tracking. +message ObjectTrackingFrame { + // The bounding box location of this object track for the frame. + oneof bounded_area { + BoundingPoly bounding_poly = 1; + + NormalizedBoundingPoly normalized_bounding_poly = 2; + } + + // The time offset of this frame relative to the beginning of the video. + google.protobuf.Duration time_offset = 3; +} + +// Video object tracking annotation. +message VideoObjectTrackingAnnotation { + // Label of the object tracked in this annotation. + AnnotationSpec annotation_spec = 1; + + // The time segment of the video to which object tracking applies. + TimeSegment time_segment = 2; + + // The list of frames where this object track appears. + repeated ObjectTrackingFrame object_tracking_frames = 3; +} + +// Video event annotation. +message VideoEventAnnotation { + // Label of the event in this annotation. + AnnotationSpec annotation_spec = 1; + + // The time segment of the video to which the annotation applies. + TimeSegment time_segment = 2; +} + +// Additional information associated with the annotation. +message AnnotationMetadata { + // Metadata related to human labeling. + OperatorMetadata operator_metadata = 2; +} + +// General information useful for labels coming from contributors. +message OperatorMetadata { + // Confidence score corresponding to a label. For examle, if 3 contributors + // have answered the question and 2 of them agree on the final label, the + // confidence score will be 0.67 (2/3). + float score = 1; + + // The total number of contributors that answer this question. + int32 total_votes = 2; + + // The total number of contributors that choose this label. + int32 label_votes = 3; + + repeated string comments = 4; +} diff --git a/datalabeling/protos/annotation_spec_set.proto b/datalabeling/protos/annotation_spec_set.proto new file mode 100644 index 000000000000..20fdec73c4d9 --- /dev/null +++ b/datalabeling/protos/annotation_spec_set.proto @@ -0,0 +1,56 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +// AnnotationSpecSet is a collection of label definitions. For example, in +// image classification tasks, we define a set of labels, this set is called +// AnnotationSpecSet. AnnotationSpecSet is immutable upon creation. +message AnnotationSpecSet { + // Output only. + // AnnotationSpecSet resource name, format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string name = 1; + + // Required. The display name for AnnotationSpecSet defined by user. + // Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the annotation specification set. + // The description can be up to 10000 characters long. + string description = 3; + + // Required. The actual spec set defined by the users. + repeated AnnotationSpec annotation_specs = 4; +} + +// Container of information related to one annotation spec. +message AnnotationSpec { + // Required. The display name of the AnnotationSpec. Maximum of 64 characters. + string display_name = 1; + + // Optional. User-provided description of the annotation specification. + // The description can be up to 10000 characters long. + string description = 2; +} diff --git a/datalabeling/protos/data_labeling_service.proto b/datalabeling/protos/data_labeling_service.proto new file mode 100644 index 000000000000..ee044911b874 --- /dev/null +++ b/datalabeling/protos/data_labeling_service.proto @@ -0,0 +1,727 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/cloud/datalabeling/v1beta1/instruction.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +service DataLabelingService { + // Creates dataset. If success return a Dataset resource. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/datasets" + body: "*" + }; + } + + // Gets dataset by resource name. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*}" + }; + } + + // Lists datasets under a project. Pagination is supported. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/datasets" + }; + } + + // Deletes a dataset by resource name. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/datasets/*}" + }; + } + + // Imports data into dataset based on source locations defined in request. + // It can be called multiple times for the same dataset. Each dataset can + // only have one long running operation running on it. For example, no + // labeling task (also long running operation) can be started while + // importing is still ongoing. Vice versa. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/datasets/*}:importData" + body: "*" + }; + } + + // Exports data and annotations from dataset. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/datasets/*}:exportData" + body: "*" + }; + } + + // Gets a data item in a dataset by resource name. This API can be + // called after data are imported into dataset. + rpc GetDataItem(GetDataItemRequest) returns (DataItem) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/dataItems/*}" + }; + } + + // Lists data items in a dataset. This API can be called after data + // are imported into dataset. Pagination is supported. + rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*}/dataItems" + }; + } + + // Gets an annotated dataset by resource name. + rpc GetAnnotatedDataset(GetAnnotatedDatasetRequest) returns (AnnotatedDataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }; + } + + // Lists annotated datasets for a dataset. Pagination is supported. + rpc ListAnnotatedDatasets(ListAnnotatedDatasetsRequest) returns (ListAnnotatedDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" + }; + } + + // Deletes an annotated dataset by resource name. + rpc DeleteAnnotatedDataset(DeleteAnnotatedDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }; + } + + // Starts a labeling task for image. The type of image labeling task is + // configured by feature in the request. + rpc LabelImage(LabelImageRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/image:label" + body: "*" + }; + } + + // Starts a labeling task for video. The type of video labeling task is + // configured by feature in the request. + rpc LabelVideo(LabelVideoRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/video:label" + body: "*" + }; + } + + // Starts a labeling task for text. The type of text labeling task is + // configured by feature in the request. + rpc LabelText(LabelTextRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/text:label" + body: "*" + }; + } + + // Starts a labeling task for audio. The type of audio labeling task is + // configured by feature in the request. + rpc LabelAudio(LabelAudioRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/audio:label" + body: "*" + }; + } + + // Gets an example by resource name, including both data and annotation. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" + }; + } + + // Lists examples in an annotated dataset. Pagination is supported. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" + }; + } + + // Creates an annotation spec set by providing a set of labels. + rpc CreateAnnotationSpecSet(CreateAnnotationSpecSetRequest) returns (AnnotationSpecSet) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/annotationSpecSets" + body: "*" + }; + } + + // Gets an annotation spec set by resource name. + rpc GetAnnotationSpecSet(GetAnnotationSpecSetRequest) returns (AnnotationSpecSet) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/annotationSpecSets/*}" + }; + } + + // Lists annotation spec sets for a project. Pagination is supported. + rpc ListAnnotationSpecSets(ListAnnotationSpecSetsRequest) returns (ListAnnotationSpecSetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/annotationSpecSets" + }; + } + + // Deletes an annotation spec set by resource name. + rpc DeleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/annotationSpecSets/*}" + }; + } + + // Creates an instruction for how data should be labeled. + rpc CreateInstruction(CreateInstructionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/instructions" + body: "*" + }; + } + + // Gets an instruction by resource name. + rpc GetInstruction(GetInstructionRequest) returns (Instruction) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/instructions/*}" + }; + } + + // Lists instructions for a project. Pagination is supported. + rpc ListInstructions(ListInstructionsRequest) returns (ListInstructionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/instructions" + }; + } + + // Deletes an instruction object by resource name. + rpc DeleteInstruction(DeleteInstructionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/instructions/*}" + }; + } +} + +// Request message for CreateDataset. +message CreateDatasetRequest { + // Required. Dataset resource parent, format: + // projects/{project_id} + string parent = 1; + + // Required. The dataset to be created. + Dataset dataset = 2; +} + +// Request message for GetDataSet. +message GetDatasetRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; +} + +// Request message for ListDataset. +message ListDatasetsRequest { + // Required. Dataset resource parent, format: + // projects/{project_id} + string parent = 1; + + // Optional. Filter on dataset is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token] of the previous + // [DataLabelingService.ListDatasets] call. + // Returns the first page if empty. + string page_token = 4; +} + +// Results of listing datasets within a project. +message ListDatasetsResponse { + // The list of datasets to return. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteDataset. +message DeleteDatasetRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; +} + +// Request message for ImportData API. +message ImportDataRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. Specify the input source of the data. + InputConfig input_config = 2; +} + +// Request message for ExportData API. +message ExportDataRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. Annotated dataset resource name. DataItem in + // Dataset and their annotations in specified annotated dataset will be + // exported. It's in format of + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string annotated_dataset = 2; + + // Optional. Filter is not supported at this moment. + string filter = 3; + + // Required. Specify the output destination. + OutputConfig output_config = 4; +} + +// Request message for GetDataItem. +message GetDataItemRequest { + // Required. The name of the data item to get, format: + // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + string name = 1; +} + +// Request message for ListDataItems. +message ListDataItemsRequest { + // Required. Name of the dataset to list data items, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListDataItemsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token] of the previous + // [DataLabelingService.ListDataItems] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing data items in a dataset. +message ListDataItemsResponse { + // The list of data items to return. + repeated DataItem data_items = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for GetAnnotatedDataset. +message GetAnnotatedDatasetRequest { + // Required. Name of the annotated dataset to get, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; +} + +// Request message for ListAnnotatedDatasets. +message ListAnnotatedDatasetsRequest { + // Required. Name of the dataset to list annotated datasets, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListAnnotatedDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token] of the previous + // [DataLabelingService.ListAnnotatedDatasets] call. + // Return first page if empty. + string page_token = 4; +} + +// Request message for DeleteAnnotatedDataset. +message DeleteAnnotatedDatasetRequest { + // Required. Name of the annotated dataset to delete, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; +} + +// Results of listing annotated datasets for a dataset. +message ListAnnotatedDatasetsResponse { + // The list of annotated datasets to return. + repeated AnnotatedDataset annotated_datasets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for starting an image labeling task. +message LabelImageRequest { + // Image labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label whole image with one or more of labels. + CLASSIFICATION = 1; + + // Label image with bounding boxes for labels. + BOUNDING_BOX = 2; + + // Label oriented bounding box. The box does not have to be parallel to + // horizontal line. + ORIENTED_BOUNDING_BOX = 6; + + // Label images with bounding poly. A bounding poly is a plane figure that + // is bounded by a finite chain of straight line segments closing in a loop. + BOUNDING_POLY = 3; + + // Label images with polyline. Polyline is formed by connected line segments + // which are not in closed form. + POLYLINE = 4; + + // Label images with segmentation. Segmentation is different from bounding + // poly since it is more fine-grained, pixel level annotation. + SEGMENTATION = 5; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for image classification task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + ImageClassificationConfig image_classification_config = 4; + + // Configuration for bounding box and bounding poly task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + BoundingPolyConfig bounding_poly_config = 5; + + // Configuration for polyline task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + PolylineConfig polyline_config = 6; + + // Configuration for segmentation task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config is required. + SegmentationConfig segmentation_config = 7; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of image labeling task. + Feature feature = 3; +} + +// Request message for LabelVideo. +message LabelVideoRequest { + // Video labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label whole video or video segment with one or more labels. + CLASSIFICATION = 1; + + // Label objects with bounding box on image frames extracted from the video. + OBJECT_DETECTION = 2; + + // Label and track objects in video. + OBJECT_TRACKING = 3; + + // Label the range of video for the specified events. + EVENT = 4; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for video classification task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + VideoClassificationConfig video_classification_config = 4; + + // Configuration for video object detection task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + ObjectDetectionConfig object_detection_config = 5; + + // Configuration for video object tracking task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + ObjectTrackingConfig object_tracking_config = 6; + + // Configuration for video event task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + EventConfig event_config = 7; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of video labeling task. + Feature feature = 3; +} + +// Request message for LabelText. +message LabelTextRequest { + // Text labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label text content to one of more labels. + TEXT_CLASSIFICATION = 1; + + // Label entities and their span in text. + TEXT_ENTITY_EXTRACTION = 2; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for text classification task. + // One of text_classification_config and text_entity_extraction_config + // is required. + TextClassificationConfig text_classification_config = 4; + + // Configuration for entity extraction task. + // One of text_classification_config and text_entity_extraction_config + // is required. + TextEntityExtractionConfig text_entity_extraction_config = 5; + } + + // Required. Name of the data set to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of text labeling task. + Feature feature = 6; +} + +// Request message for LabelAudio. +message LabelAudioRequest { + // Audio labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Transcribe the audios into text. + AUDIO_TRANSCRIPTION = 1; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2; + + // Required. The type of audio labeling task. + Feature feature = 3; +} + +// Request message for GetExample +message GetExampleRequest { + // Required. Name of example, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id}/examples/{example_id} + string name = 1; + + // Optional. An expression for filtering Examples. Filter by + // annotation_spec.display_name is supported. Format + // "annotation_spec.display_name = {display_name}" + string filter = 2; +} + +// Request message for ListExamples. +message ListExamplesRequest { + // Required. Example resource parent. + string parent = 1; + + // Optional. An expression for filtering Examples. For annotated datasets that + // have annotation spec set, filter by + // annotation_spec.display_name is supported. Format + // "annotation_spec.display_name = {display_name}" + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListExamplesResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token] of the previous + // [DataLabelingService.ListExamples] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing Examples in and annotated dataset. +message ListExamplesResponse { + // The list of examples to return. + repeated Example examples = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for CreateAnnotationSpecSet. +message CreateAnnotationSpecSetRequest { + // Required. AnnotationSpecSet resource parent, format: + // projects/{project_id} + string parent = 1; + + // Required. Annotation spec set to create. Annotation specs must be included. + // Only one annotation spec will be accepted for annotation specs with same + // display_name. + AnnotationSpecSet annotation_spec_set = 2; +} + +// Request message for GetAnnotationSpecSet. +message GetAnnotationSpecSetRequest { + // Required. AnnotationSpecSet resource name, format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string name = 1; +} + +// Request message for ListAnnotationSpecSets. +message ListAnnotationSpecSetsRequest { + // Required. Parent of AnnotationSpecSet resource, format: + // projects/{project_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListAnnotationSpecSetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token] of the previous + // [DataLabelingService.ListAnnotationSpecSets] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing annotation spec set under a project. +message ListAnnotationSpecSetsResponse { + // The list of annotation spec sets. + repeated AnnotationSpecSet annotation_spec_sets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteAnnotationSpecSet. +message DeleteAnnotationSpecSetRequest { + // Required. AnnotationSpec resource name, format: + // `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. + string name = 1; +} + +// Request message for CreateInstruction. +message CreateInstructionRequest { + // Required. Instruction resource parent, format: + // projects/{project_id} + string parent = 1; + + // Required. Instruction of how to perform the labeling task. + Instruction instruction = 2; +} + +// Request message for GetInstruction. +message GetInstructionRequest { + // Required. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; +} + +// Request message for DeleteInstruction. +message DeleteInstructionRequest { + // Required. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; +} + +// Request message for ListInstructions. +message ListInstructionsRequest { + // Required. Instruction resource parent, format: + // projects/{project_id} + string parent = 1; + + // Optional. Filter is not supported at this moment. + string filter = 2; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListInstructionsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token] of the previous + // [DataLabelingService.ListInstructions] call. + // Return first page if empty. + string page_token = 4; +} + +// Results of listing instructions under a project. +message ListInstructionsResponse { + // The list of Instructions to return. + repeated Instruction instructions = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} diff --git a/datalabeling/protos/dataset.proto b/datalabeling/protos/dataset.proto new file mode 100644 index 000000000000..952daf38d626 --- /dev/null +++ b/datalabeling/protos/dataset.proto @@ -0,0 +1,306 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/annotation.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +enum DataType { + DATA_TYPE_UNSPECIFIED = 0; + + IMAGE = 1; + + VIDEO = 2; + + TEXT = 4; + + AUDIO = 5; +} + +// Dataset is the resource to hold your data. You can request multiple labeling +// tasks for a dataset while each one will generate an AnnotatedDataset. +message Dataset { + // Output only. + // Dataset resource name, format is: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. The display name of the dataset. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the annotation specification set. + // The description can be up to 10000 characters long. + string description = 3; + + // Output only. Time the dataset is created. + google.protobuf.Timestamp create_time = 4; + + // Output only. This is populated with the original input configs + // where ImportData is called. It is available only after the clients + // import data to this dataset. + repeated InputConfig input_configs = 5; +} + +// The configuration of input data, including data type, location, etc. +message InputConfig { + // Required. Where the data is from. + oneof source { + GcsSource gcs_source = 2; + } + + // Required. Data type must be specifed when user tries to import data. + DataType data_type = 1; +} + +// Source of the GCS file to be imported. Only gcs path is allowed in +// input_uri. +message GcsSource { + // Required. The input uri of source file. + string input_uri = 1; + + // Required. The format of the gcs source. Only "text/csv" is supported. + string mime_type = 2; +} + +// The configuration of output data. +message OutputConfig { + // Required. Location to output data to. + oneof destination { + // Output to a GCS file. Should be used for labeling output other than Audio + // transcription. + GcsDestination gcs_destination = 1; + + // Output to a GCS folder. Should be used for Audio transcription + // labeling output. + GcsFolderDestination gcs_folder_destination = 2; + } +} + +// Export destination of the data.Only gcs path is allowed in +// output_uri. +message GcsDestination { + // Required. The output uri of destination file. + string output_uri = 1; + + // Required. The format of the gcs destination. Only "text/csv" and + // "application/json" + // are supported. + string mime_type = 2; +} + +// Export folder destination of the data. +message GcsFolderDestination { + // Required. GCS folder to export data to. + string output_folder_uri = 1; +} + +// DataItem is a piece of data, without annotation. For example, an image. +message DataItem { + // Output only. + oneof payload { + // The image payload, a container of the image bytes/uri. + ImagePayload image_payload = 2; + + // The text payload, a container of text content. + TextPayload text_payload = 3; + + // The video payload, a container of the video uri. + VideoPayload video_payload = 4; + + // The audio payload, a container of the audio uri. + AudioPayload audio_payload = 5; + } + + // Output only. Name of the data item, in format of: + // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + string name = 1; +} + +// AnnotatedDataset is a set holding annotations for data in a Dataset. Each +// labeling task will generate an AnnotatedDataset under the Dataset that the +// task is requested for. +message AnnotatedDataset { + // Output only. + // AnnotatedDataset resource name in format of: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; + + // Output only. The display name of the AnnotatedDataset. It is specified in + // HumanAnnotationConfig when user starts a labeling task. Maximum of 64 + // characters. + string display_name = 2; + + // Output only. The description of the AnnotatedDataset. It is specified in + // HumanAnnotationConfig when user starts a labeling task. Maximum of 10000 + // characters. + string description = 9; + + // Output only. Source of the annotation. + AnnotationSource annotation_source = 3; + + // Output only. Type of the annotation. It is specified when starting labeling + // task. + AnnotationType annotation_type = 8; + + // Output only. Number of examples in the annotated dataset. + int64 example_count = 4; + + // Output only. Number of examples that have annotation in the annotated + // dataset. + int64 completed_example_count = 5; + + // Output only. Per label statistics. + LabelStats label_stats = 6; + + // Output only. Time the AnnotatedDataset was created. + google.protobuf.Timestamp create_time = 7; + + // Output only. Additional information about AnnotatedDataset. + AnnotatedDatasetMetadata metadata = 10; +} + +// Metadata on AnnotatedDataset. +message AnnotatedDatasetMetadata { + // HumanAnnotationConfig used when requesting the human labeling task for this + // AnnotatedDataset. + HumanAnnotationConfig human_annotation_config = 1; + + // Specific request configuration used when requesting the labeling task. + oneof annotation_request_config { + // Configuration for image classification task. + ImageClassificationConfig image_classification_config = 2; + // Configuration for image bounding box and bounding poly task. + BoundingPolyConfig bounding_poly_config = 3; + // Configuration for image polyline task. + PolylineConfig polyline_config = 4; + // Configuration for image segmentation task. + SegmentationConfig segmentation_config = 5; + // Configuration for video classification task. + VideoClassificationConfig video_classification_config = 6; + // Configuration for video object detection task. + ObjectDetectionConfig object_detection_config = 7; + // Configuration for video object tracking task. + ObjectTrackingConfig object_tracking_config = 8; + // Configuration for video event labeling task. + EventConfig event_config = 9; + // Configuration for text classification task. + TextClassificationConfig text_classification_config = 10; + // Configuration for text entity extraction task. + TextEntityExtractionConfig text_entity_extraction_config = 11; + } +} + +// Statistics about annotation specs. +message LabelStats { + // Map of each annotation spec's example count. Key is the annotation spec + // name and value is the number of examples for that annotation spec. + map example_count = 1; +} + +// An Example is a piece of data and its annotation. For example, an image with +// label "house". +message Example { + // Output only. The data part of Example. + oneof payload { + // The image payload, a container of the image bytes/uri. + ImagePayload image_payload = 2; + + // The text payload, a container of the text content. + TextPayload text_payload = 6; + + // The video payload, a container of the video uri. + VideoPayload video_payload = 7; + + // The audio payload, a container of the audio uri. + AudioPayload audio_payload = 8; + } + + // Output only. Name of the example, in format of: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id}/examples/{example_id} + string name = 1; + + // Output only. Annotations for the piece of data in Example. + // One piece of data can have multiple annotations. + repeated Annotation annotations = 5; +} + +// Container of information about an image. +message ImagePayload { + // Image format. + string mime_type = 1; + + // A byte string of a full image. + bytes image_thumbnail = 2; + + // Image uri from the user bucket. + string image_uri = 3; +} + +// Container of information about a piece of text. +message TextPayload { + // Text content. + string text_content = 1; +} + +// Container of information of a video thumbnail. +message VideoThumbnail { + // A byte string of the video frame. + bytes thumbnail = 1; + + // Time offset relative to the beginning of the video, corresponding to the + // video frame where the thumbnail has been extracted from. + google.protobuf.Duration time_offset = 2; +} + +// Container of information of a video. +message VideoPayload { + // Video format. + string mime_type = 1; + + // Video uri from the user bucket. + string video_uri = 2; + + // The list of video thumbnails. + repeated VideoThumbnail video_thumbnails = 3; + + // FPS of the video. + float frame_rate = 4; +} + +// Container of information of an audio. +message AudioPayload { + // Audio uri in user bucket. + string audio_uri = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. This field is optional for `FLAC` and `WAV` + // audio files and required for all other audio formats. For details, + // see [AudioEncoding][google.cloud.datalabeling.v1beta1.AudioPayload.AudioEncoding]. + int32 sample_rate_hertz = 3; +} diff --git a/datalabeling/protos/human_annotation_config.proto b/datalabeling/protos/human_annotation_config.proto new file mode 100644 index 000000000000..96672aedaf53 --- /dev/null +++ b/datalabeling/protos/human_annotation_config.proto @@ -0,0 +1,208 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +enum StringAggregationType { + STRING_AGGREGATION_TYPE_UNSPECIFIED = 0; + + // Majority vote to aggregate answers. + MAJORITY_VOTE = 1; + + // Unanimous answers will be adopted. + UNANIMOUS_VOTE = 2; + + // Preserve all answers by crowd compute. + NO_AGGREGATION = 3; +} + +// Configuration for how human labeling task should be done. +message HumanAnnotationConfig { + // Required except for LabelAudio case. Instruction resource name. + string instruction = 1; + + // Required. A human-readable name for AnnotatedDataset defined by + // users. Maximum of 64 characters + // . + string annotated_dataset_display_name = 2; + + // Optional. A human-readable description for AnnotatedDataset. + // The description can be up to 10000 characters long. + string annotated_dataset_description = 3; + + // Optional. A human-readable label used to logically group labeling tasks. + // This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + string label_group = 4; + + // Optional. The Language of this question, as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // Default value is en-US. + // Only need to set this when task is language related. For example, French + // text classification or Chinese audio transcription. + string language_code = 5; + + // Optional. Replication of questions. Each question will be sent to up to + // this number of contributors to label. Aggregated answers will be returned. + // Default is set to 1. + // For image related labeling, valid values are 1, 3, 5. + int32 replica_count = 6; + + // Optional. Maximum duration for contributors to answer a question. Default + // is 1800 seconds. + google.protobuf.Duration question_duration = 7; + + // Optional. If you want your own labeling contributors to manage and work on + // this labeling request, you can set these contributors here. We will give + // them access to the question types in crowdcompute. Note that these + // emails must be registered in crowdcompute worker UI: + // https://crowd-compute.appspot.com/ + repeated string contributor_emails = 9; +} + +// Config for image classification human labeling task. +message ImageClassificationConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. If allow_multi_label is true, contributors are able to choose + // multiple labels for one image. + bool allow_multi_label = 2; + + // Optional. The type of how to aggregate answers. + StringAggregationType answer_aggregation_type = 3; +} + +// Config for image bounding poly (and bounding box) human labeling task. +message BoundingPolyConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. Instruction message showed on contributors UI. + string instruction_message = 2; +} + +// Config for image polyline human labeling task. +message PolylineConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. Instruction message showed on contributors UI. + string instruction_message = 2; +} + +// Config for image segmentation +message SegmentationConfig { + // Required. Annotation spec set resource name. format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string annotation_spec_set = 1; + + // Instruction message showed on labelers UI. + string instruction_message = 2; +} + +// Config for video classification human labeling task. +// Currently two types of video classification are supported: +// 1. Assign labels on the entire video. +// 2. Split the video into multiple video clips based on camera shot, and +// assign labels on each video clip. +message VideoClassificationConfig { + // Annotation spec set with the setting of allowing multi labels or not. + message AnnotationSpecSetConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. If allow_multi_label is true, contributors are able to + // choose multiple labels from one annotation spec set. + bool allow_multi_label = 2; + } + + // Required. The list of annotation spec set configs. + // Since watching a video clip takes much longer time than an image, we + // support label with multiple AnnotationSpecSet at the same time. Labels + // in each AnnotationSpecSet will be shown in a group to contributors. + // Contributors can select one or more (depending on whether to allow multi + // label) from each group. + repeated AnnotationSpecSetConfig annotation_spec_set_configs = 1; + + // Optional. Option to apply shot detection on the video. + bool apply_shot_detection = 2; +} + +// Config for video object detection human labeling task. +// Object detection will be conducted on the images extracted from the video, +// and those objects will be labeled with bounding boxes. +// User need to specify the number of images to be extracted per second as the +// extraction frame rate. +message ObjectDetectionConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; + + // Optional. Instruction message showed on labelers UI. + string instruction_message = 2; + + // Required. Number of frames per second to be extracted from the video. + double extraction_frame_rate = 3; +} + +// Config for video object tracking human labeling task. +message ObjectTrackingConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; +} + +// Config for video event human labeling task. +message EventConfig { + // Required. The list of annotation spec set resource name. Similar to video + // classification, we support selecting event from multiple AnnotationSpecSet + // at the same time. + repeated string annotation_spec_sets = 1; +} + +// Config for text classification human labeling task. +message TextClassificationConfig { + // Optional. If allow_multi_label is true, contributors are able to choose + // multiple labels for one text segment. + bool allow_multi_label = 1; + + // Required. Annotation spec set resource name. + string annotation_spec_set = 2; + + // Optional. Configs for sentiment selection. + SentimentConfig sentiment_config = 3; +} + +// Config for setting up sentiments. +message SentimentConfig { + // If set to true, contributors will have the option to select sentiment of + // the label they selected, to mark it as negative or positive label. Default + // is false. + bool enable_label_sentiment_selection = 1; +} + +// Config for text entity extraction human labeling task. +message TextEntityExtractionConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1; +} diff --git a/datalabeling/protos/instruction.proto b/datalabeling/protos/instruction.proto new file mode 100644 index 000000000000..d1a1e751c9a3 --- /dev/null +++ b/datalabeling/protos/instruction.proto @@ -0,0 +1,78 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + + +// Instruction of how to perform the labeling task for human operators. +// Currently two types of instruction are supported - CSV file and PDF. +// One of the two types instruction must be provided. +// CSV file is only supported for image classification task. Instructions for +// other task should be provided as PDF. +// For image classification, CSV and PDF can be provided at the same time. +message Instruction { + // Output only. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; + + // Required. The display name of the instruction. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the instruction. + // The description can be up to 10000 characters long. + string description = 3; + + // Output only. Creation time of instruction. + google.protobuf.Timestamp create_time = 4; + + // Output only. Last update time of instruction. + google.protobuf.Timestamp update_time = 5; + + // Required. The data type of this instruction. + DataType data_type = 6; + + // One of CSV and PDF instruction is required. + // Instruction from a csv file, such as for classification task. + // Csv file should have exact two columns, in the format of: + // The first column is labeled data, such as image reference, text. + // The second column is comma separated labels associated with data. + CsvInstruction csv_instruction = 7; + + // One of CSV and PDF instruction is required. + // Instruction from a PDF doc. The PDF doc should be in GCS bucket. + PdfInstruction pdf_instruction = 9; +} + +// Instruction from a CSV file. +message CsvInstruction { + // CSV file for the instruction. Only gcs path is allowed. + string gcs_file_uri = 1; +} + +// Instruction from a PDF file. +message PdfInstruction { + // PDF file for the instruction. Only gcs path is allowed. + string gcs_file_uri = 1; +} diff --git a/datalabeling/protos/operations.proto b/datalabeling/protos/operations.proto new file mode 100644 index 000000000000..71815e5310e3 --- /dev/null +++ b/datalabeling/protos/operations.proto @@ -0,0 +1,206 @@ +// 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 +// +// 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. +// + +syntax = "proto3"; + +package google.cloud.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/cloud/datalabeling/v1beta1/instruction.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; + +// Response used for ImportData longrunning operation. +message ImportDataOperationResponse { + // Ouptut only. The name of imported dataset. + string dataset = 1; + + // Output only. Total number of examples requested to import + int32 total_count = 2; + + // Output only. Number of examples imported successfully. + int32 import_count = 3; +} + +// Response used for ExportDataset longrunning operation. +message ExportDataOperationResponse { + // Ouptut only. The name of dataset. + // "projects/*/datasets/*/Datasets/*" + string dataset = 1; + + // Output only. Total number of examples requested to export + int32 total_count = 2; + + // Output only. Number of examples exported successfully. + int32 export_count = 3; + + // Output only. Statistic infos of labels in the exported dataset. + LabelStats label_stats = 4; + + // Output only. output_config in the ExportData request. + OutputConfig output_config = 5; +} + +// Metadata of an ImportData operation. +message ImportDataOperationMetadata { + // Ouptut only. The name of imported dataset. + // "projects/*/datasets/*" + string dataset = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; +} + +// Metadata of an ExportData operation. +message ExportDataOperationMetadata { + // Output only. The name of dataset to be exported. + // "projects/*/datasets/*/Datasets/*" + string dataset = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; +} + +// Metadata of a labeling operation, such as LabelImage or LabelVideo. +// Next tag: 16 +message LabelOperationMetadata { + // Output only. Progress of label operation. Range: [0, 100]. + // Currently not supported. + int32 progress_percent = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Ouptut only. Details of specific label operation. + oneof details { + LabelImageClassificationOperationMetadata image_classification_details = 3; + LabelImageBoundingBoxOperationMetadata image_bounding_box_details = 4; + LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11; + LabelImageOrientedBoundingBoxOperationMetadata + image_oriented_bounding_box_details = 14; + LabelImagePolylineOperationMetadata image_polyline_details = 12; + LabelImageSegmentationOperationMetadata image_segmentation_details = 15; + LabelVideoClassificationOperationMetadata video_classification_details = 5; + LabelVideoObjectDetectionOperationMetadata video_object_detection_details = + 6; + LabelVideoObjectTrackingOperationMetadata video_object_tracking_details = 7; + LabelVideoEventOperationMetadata video_event_details = 8; + LabelTextClassificationOperationMetadata text_classification_details = 9; + LabelAudioTranscriptionOperationMetadata audio_transcription_details = 10; + LabelTextEntityExtractionOperationMetadata text_entity_extraction_details = + 13; + } +} + +// Metadata of a LabelImageClassification operation. +message LabelImageClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageBoundingBox operation metadata. +message LabelImageBoundingBoxOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageOrientedBoundingBox operation metadata. +message LabelImageOrientedBoundingBoxOperationMetadata { + // Basic human annotation config. + HumanAnnotationConfig basic_config = 1; +} + +// Details of LabelImageBoundingPoly operation metadata. +message LabelImageBoundingPolyOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of LabelImagePolyline operation metadata. +message LabelImagePolylineOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageSegmentation operation metadata. +message LabelImageSegmentationOperationMetadata { + // Basic human annotation config. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoClassification operation metadata. +message LabelVideoClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoObjectDetection operation metadata. +message LabelVideoObjectDetectionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoObjectTracking operation metadata. +message LabelVideoObjectTrackingOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoEvent operation metadata. +message LabelVideoEventOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelTextClassification operation metadata. +message LabelTextClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +message LabelAudioTranscriptionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelTextEntityExtraction operation metadata. +message LabelTextEntityExtractionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Metadata of a CreateInstruction operation. +message CreateInstructionMetadata { + // Output only. The name of the created Instruction. + // projects/{project_id}/instructions/{instruction_id} + string instruction = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; +} diff --git a/datalabeling/setup.cfg b/datalabeling/setup.cfg new file mode 100644 index 000000000000..2a9acf13daa9 --- /dev/null +++ b/datalabeling/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/datalabeling/setup.py b/datalabeling/setup.py new file mode 100644 index 000000000000..e9365602a119 --- /dev/null +++ b/datalabeling/setup.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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 io +import os + +import setuptools + +name = 'google-cloud-datalabeling' +description = 'Data Labeling API client library' +version = '0.1.0' +release_status = '4 - Beta' +dependencies = [ + 'google-api-core[grpc] >= 1.4.1, < 2.0.0dev', + 'enum34; python_version < "3.4"', +] + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, 'README.rst') +with io.open(readme_filename, encoding='utf-8') as readme_file: + readme = readme_file.read() + +packages = [ + package for package in setuptools.find_packages() + if package.startswith('google') +] + +namespaces = ['google'] +if 'google.cloud' in packages: + namespaces.append('google.cloud') + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author='Google LLC', + author_email='googleapis-packages@google.com', + license='Apache 2.0', + url='https://github.com/GoogleCloudPlatform/google-cloud-python', + classifiers=[ + release_status, + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Operating System :: OS Independent', + 'Topic :: Internet', + ], + platforms='Posix; MacOS X; Windows', + packages=packages, + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/datalabeling/synth.metadata b/datalabeling/synth.metadata new file mode 100644 index 000000000000..b5492ce6b232 --- /dev/null +++ b/datalabeling/synth.metadata @@ -0,0 +1,39 @@ +{ + "updateTime": "2019-04-01T20:28:56.710893Z", + "sources": [ + { + "generator": { + "name": "artman", + "version": "0.16.22", + "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + } + }, + { + "git": { + "name": "googleapis", + "remote": "git@github.com:googleapis/googleapis.git", + "sha": "62baea94d3760d9a58064a6e6ee9b99eff2a608e", + "internalRef": "241370948" + } + }, + { + "template": { + "name": "python_library", + "origin": "synthtool.gcp", + "version": "2019.2.26" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "datalabeling", + "apiVersion": "v1beta1", + "language": "python", + "generator": "gapic", + "config": "google/cloud/datalabeling/artman_datalabeling_v1beta1.yaml" + } + } + ] +} \ No newline at end of file diff --git a/datalabeling/synth.py b/datalabeling/synth.py new file mode 100644 index 000000000000..5df23b5d288a --- /dev/null +++ b/datalabeling/synth.py @@ -0,0 +1,72 @@ +# Copyright 2019 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 +# +# 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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +from synthtool import gcp + +gapic = gcp.GAPICGenerator() +common = gcp.CommonTemplates() + +version = 'v1beta1' + +library = gapic.py_library( + 'datalabeling', + version, + config_path='/google/cloud/datalabeling/' + 'artman_datalabeling_v1beta1.yaml', + artman_output_name='datalabeling-v1beta1', + include_protos=True, +) + +s.move( + library, + excludes=[ + 'docs/conf.py', + 'docs/index.rst', + 'google/cloud/datalabeling_v1beta1/__init__.py', + 'README.rst', + 'nox*.py', + 'setup.py', + 'setup.cfg', + ], +) + +# Fixup issues in generated code +s.replace( + "./**/gapic/**/*client.py", + r"operations_pb2.ImportDataOperationResponse", + "proto_operations_pb2.ImportDataOperationResponse", +) + +s.replace( + "./**/gapic/**/*client.py", + r"operations_pb2.ImportDataOperationMetadata", + "proto_operations_pb2.ImportDataOperationMetadata", +) + +s.replace( + "./tests/unit/gapic/**/test*_client*.py", + r"operations_pb2.Operation\(", + "longrunning_operations_pb2.Operation(", +) + +# ---------------------------------------------------------------------------- +# Add templated files +# ---------------------------------------------------------------------------- +templated_files = common.py_library(unit_cov_level=80, cov_level=80) +s.move(templated_files) + +s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py b/datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py new file mode 100644 index 000000000000..3def608ec7e9 --- /dev/null +++ b/datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py @@ -0,0 +1,1309 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 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. +"""Unit tests.""" + +import mock +import pytest + +from google.rpc import status_pb2 + +from google.cloud import datalabeling_v1beta1 +from google.cloud.datalabeling_v1beta1 import enums +from google.cloud.datalabeling_v1beta1.proto import annotation_spec_set_pb2 +from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2 +from google.cloud.datalabeling_v1beta1.proto import dataset_pb2 +from google.cloud.datalabeling_v1beta1.proto import human_annotation_config_pb2 +from google.cloud.datalabeling_v1beta1.proto import instruction_pb2 +from google.cloud.datalabeling_v1beta1.proto import ( + operations_pb2 as proto_operations_pb2, +) +from google.longrunning import operations_pb2 as longrunning_operations_pb2 +from google.protobuf import empty_pb2 + + +class MultiCallableStub(object): + """Stub for the grpc.UnaryUnaryMultiCallable interface.""" + + def __init__(self, method, channel_stub): + self.method = method + self.channel_stub = channel_stub + + def __call__(self, request, timeout=None, metadata=None, credentials=None): + self.channel_stub.requests.append((self.method, request)) + + response = None + if self.channel_stub.responses: + response = self.channel_stub.responses.pop() + + if isinstance(response, Exception): + raise response + + if response: + return response + + +class ChannelStub(object): + """Stub for the grpc.Channel interface.""" + + def __init__(self, responses=[]): + self.responses = responses + self.requests = [] + + def unary_unary(self, method, request_serializer=None, response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestDataLabelingServiceClient(object): + def test_create_dataset(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + } + expected_response = dataset_pb2.Dataset(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + dataset = {} + + response = client.create_dataset(parent, dataset) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.CreateDatasetRequest( + parent=parent, dataset=dataset + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_dataset_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + dataset = {} + + with pytest.raises(CustomException): + client.create_dataset(parent, dataset) + + def test_get_dataset(self): + # Setup Expected Response + name_2 = "name2-1052831874" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name_2, + "display_name": display_name, + "description": description, + } + expected_response = dataset_pb2.Dataset(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.dataset_path("[PROJECT]", "[DATASET]") + + response = client.get_dataset(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.GetDatasetRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_dataset_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.dataset_path("[PROJECT]", "[DATASET]") + + with pytest.raises(CustomException): + client.get_dataset(name) + + def test_list_datasets(self): + # Setup Expected Response + next_page_token = "" + datasets_element = {} + datasets = [datasets_element] + expected_response = {"next_page_token": next_page_token, "datasets": datasets} + expected_response = data_labeling_service_pb2.ListDatasetsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_datasets(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.datasets[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ListDatasetsRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_datasets_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_datasets(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_delete_dataset(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.dataset_path("[PROJECT]", "[DATASET]") + + client.delete_dataset(name) + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.DeleteDatasetRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_dataset_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.dataset_path("[PROJECT]", "[DATASET]") + + with pytest.raises(CustomException): + client.delete_dataset(name) + + def test_import_data(self): + # Setup Expected Response + dataset = "dataset1443214456" + total_count = 407761836 + import_count = 1721296907 + expected_response = { + "dataset": dataset, + "total_count": total_count, + "import_count": import_count, + } + expected_response = proto_operations_pb2.ImportDataOperationResponse( + **expected_response + ) + operation = longrunning_operations_pb2.Operation( + name="operations/test_import_data", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.dataset_path("[PROJECT]", "[DATASET]") + input_config = {} + + response = client.import_data(name, input_config) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ImportDataRequest( + name=name, input_config=input_config + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_import_data_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_import_data_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.dataset_path("[PROJECT]", "[DATASET]") + input_config = {} + + response = client.import_data(name, input_config) + exception = response.exception() + assert exception.errors[0] == error + + def test_export_data(self): + # Setup Expected Response + dataset = "dataset1443214456" + total_count = 407761836 + export_count = 529256252 + expected_response = { + "dataset": dataset, + "total_count": total_count, + "export_count": export_count, + } + expected_response = proto_operations_pb2.ExportDataOperationResponse( + **expected_response + ) + operation = longrunning_operations_pb2.Operation( + name="operations/test_export_data", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.dataset_path("[PROJECT]", "[DATASET]") + annotated_dataset = "annotatedDataset-1407812655" + output_config = {} + + response = client.export_data(name, annotated_dataset, output_config) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ExportDataRequest( + name=name, annotated_dataset=annotated_dataset, output_config=output_config + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_export_data_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_export_data_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.dataset_path("[PROJECT]", "[DATASET]") + annotated_dataset = "annotatedDataset-1407812655" + output_config = {} + + response = client.export_data(name, annotated_dataset, output_config) + exception = response.exception() + assert exception.errors[0] == error + + def test_get_data_item(self): + # Setup Expected Response + name_2 = "name2-1052831874" + expected_response = {"name": name_2} + expected_response = dataset_pb2.DataItem(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.data_item_path("[PROJECT]", "[DATASET]", "[DATA_ITEM]") + + response = client.get_data_item(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.GetDataItemRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_data_item_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.data_item_path("[PROJECT]", "[DATASET]", "[DATA_ITEM]") + + with pytest.raises(CustomException): + client.get_data_item(name) + + def test_list_data_items(self): + # Setup Expected Response + next_page_token = "" + data_items_element = {} + data_items = [data_items_element] + expected_response = { + "next_page_token": next_page_token, + "data_items": data_items, + } + expected_response = data_labeling_service_pb2.ListDataItemsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + + paged_list_response = client.list_data_items(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.data_items[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ListDataItemsRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_data_items_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + + paged_list_response = client.list_data_items(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_get_annotated_dataset(self): + # Setup Expected Response + name_2 = "name2-1052831874" + display_name = "displayName1615086568" + description = "description-1724546052" + example_count = 1517063674 + completed_example_count = 612567290 + expected_response = { + "name": name_2, + "display_name": display_name, + "description": description, + "example_count": example_count, + "completed_example_count": completed_example_count, + } + expected_response = dataset_pb2.AnnotatedDataset(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.annotated_dataset_path( + "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" + ) + + response = client.get_annotated_dataset(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.GetAnnotatedDatasetRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_annotated_dataset_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.annotated_dataset_path( + "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" + ) + + with pytest.raises(CustomException): + client.get_annotated_dataset(name) + + def test_list_annotated_datasets(self): + # Setup Expected Response + next_page_token = "" + annotated_datasets_element = {} + annotated_datasets = [annotated_datasets_element] + expected_response = { + "next_page_token": next_page_token, + "annotated_datasets": annotated_datasets, + } + expected_response = data_labeling_service_pb2.ListAnnotatedDatasetsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + + paged_list_response = client.list_annotated_datasets(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.annotated_datasets[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ListAnnotatedDatasetsRequest( + parent=parent + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_annotated_datasets_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + + paged_list_response = client.list_annotated_datasets(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_label_image(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + example_count = 1517063674 + completed_example_count = 612567290 + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "example_count": example_count, + "completed_example_count": completed_example_count, + } + expected_response = dataset_pb2.AnnotatedDataset(**expected_response) + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_image", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelImageRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_image(parent, basic_config, feature) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.LabelImageRequest( + parent=parent, basic_config=basic_config, feature=feature + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_label_image_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_image_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelImageRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_image(parent, basic_config, feature) + exception = response.exception() + assert exception.errors[0] == error + + def test_label_video(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + example_count = 1517063674 + completed_example_count = 612567290 + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "example_count": example_count, + "completed_example_count": completed_example_count, + } + expected_response = dataset_pb2.AnnotatedDataset(**expected_response) + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_video", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelVideoRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_video(parent, basic_config, feature) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.LabelVideoRequest( + parent=parent, basic_config=basic_config, feature=feature + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_label_video_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_video_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelVideoRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_video(parent, basic_config, feature) + exception = response.exception() + assert exception.errors[0] == error + + def test_label_text(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + example_count = 1517063674 + completed_example_count = 612567290 + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "example_count": example_count, + "completed_example_count": completed_example_count, + } + expected_response = dataset_pb2.AnnotatedDataset(**expected_response) + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_text", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelTextRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_text(parent, basic_config, feature) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.LabelTextRequest( + parent=parent, basic_config=basic_config, feature=feature + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_label_text_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_text_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelTextRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_text(parent, basic_config, feature) + exception = response.exception() + assert exception.errors[0] == error + + def test_label_audio(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + example_count = 1517063674 + completed_example_count = 612567290 + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "example_count": example_count, + "completed_example_count": completed_example_count, + } + expected_response = dataset_pb2.AnnotatedDataset(**expected_response) + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_audio", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelAudioRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_audio(parent, basic_config, feature) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.LabelAudioRequest( + parent=parent, basic_config=basic_config, feature=feature + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_label_audio_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_label_audio_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.dataset_path("[PROJECT]", "[DATASET]") + basic_config = {} + feature = enums.LabelAudioRequest.Feature.FEATURE_UNSPECIFIED + + response = client.label_audio(parent, basic_config, feature) + exception = response.exception() + assert exception.errors[0] == error + + def test_get_example(self): + # Setup Expected Response + name_2 = "name2-1052831874" + expected_response = {"name": name_2} + expected_response = dataset_pb2.Example(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.example_path( + "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]" + ) + + response = client.get_example(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.GetExampleRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_example_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.example_path( + "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]" + ) + + with pytest.raises(CustomException): + client.get_example(name) + + def test_list_examples(self): + # Setup Expected Response + next_page_token = "" + examples_element = {} + examples = [examples_element] + expected_response = {"next_page_token": next_page_token, "examples": examples} + expected_response = data_labeling_service_pb2.ListExamplesResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.annotated_dataset_path( + "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" + ) + + paged_list_response = client.list_examples(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.examples[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ListExamplesRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_examples_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.annotated_dataset_path( + "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" + ) + + paged_list_response = client.list_examples(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_create_annotation_spec_set(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + } + expected_response = annotation_spec_set_pb2.AnnotationSpecSet( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + annotation_spec_set = {} + + response = client.create_annotation_spec_set(parent, annotation_spec_set) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.CreateAnnotationSpecSetRequest( + parent=parent, annotation_spec_set=annotation_spec_set + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_annotation_spec_set_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + annotation_spec_set = {} + + with pytest.raises(CustomException): + client.create_annotation_spec_set(parent, annotation_spec_set) + + def test_get_annotation_spec_set(self): + # Setup Expected Response + name_2 = "name2-1052831874" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name_2, + "display_name": display_name, + "description": description, + } + expected_response = annotation_spec_set_pb2.AnnotationSpecSet( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") + + response = client.get_annotation_spec_set(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.GetAnnotationSpecSetRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_annotation_spec_set_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") + + with pytest.raises(CustomException): + client.get_annotation_spec_set(name) + + def test_list_annotation_spec_sets(self): + # Setup Expected Response + next_page_token = "" + annotation_spec_sets_element = {} + annotation_spec_sets = [annotation_spec_sets_element] + expected_response = { + "next_page_token": next_page_token, + "annotation_spec_sets": annotation_spec_sets, + } + expected_response = data_labeling_service_pb2.ListAnnotationSpecSetsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_annotation_spec_sets(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.annotation_spec_sets[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ListAnnotationSpecSetsRequest( + parent=parent + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_annotation_spec_sets_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_annotation_spec_sets(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_delete_annotation_spec_set(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") + + client.delete_annotation_spec_set(name) + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.DeleteAnnotationSpecSetRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_annotation_spec_set_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") + + with pytest.raises(CustomException): + client.delete_annotation_spec_set(name) + + def test_create_instruction(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + } + expected_response = instruction_pb2.Instruction(**expected_response) + operation = longrunning_operations_pb2.Operation( + name="operations/test_create_instruction", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + instruction = {} + + response = client.create_instruction(parent, instruction) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.CreateInstructionRequest( + parent=parent, instruction=instruction + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_instruction_exception(self): + # Setup Response + error = status_pb2.Status() + operation = longrunning_operations_pb2.Operation( + name="operations/test_create_instruction_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + instruction = {} + + response = client.create_instruction(parent, instruction) + exception = response.exception() + assert exception.errors[0] == error + + def test_get_instruction(self): + # Setup Expected Response + name_2 = "name2-1052831874" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name_2, + "display_name": display_name, + "description": description, + } + expected_response = instruction_pb2.Instruction(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") + + response = client.get_instruction(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.GetInstructionRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_instruction_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") + + with pytest.raises(CustomException): + client.get_instruction(name) + + def test_list_instructions(self): + # Setup Expected Response + next_page_token = "" + instructions_element = {} + instructions = [instructions_element] + expected_response = { + "next_page_token": next_page_token, + "instructions": instructions, + } + expected_response = data_labeling_service_pb2.ListInstructionsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_instructions(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.instructions[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.ListInstructionsRequest( + parent=parent + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_instructions_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + parent = client.project_path("[PROJECT]") + + paged_list_response = client.list_instructions(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_delete_instruction(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup Request + name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") + + client.delete_instruction(name) + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.DeleteInstructionRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_instruction_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + # Setup request + name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") + + with pytest.raises(CustomException): + client.delete_instruction(name) + + def test_delete_annotated_dataset(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + client.delete_annotated_dataset() + + assert len(channel.requests) == 1 + expected_request = data_labeling_service_pb2.DeleteAnnotatedDatasetRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_annotated_dataset_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datalabeling_v1beta1.DataLabelingServiceClient() + + with pytest.raises(CustomException): + client.delete_annotated_dataset() diff --git a/docs/datalabeling b/docs/datalabeling new file mode 120000 index 000000000000..87c131ea5578 --- /dev/null +++ b/docs/datalabeling @@ -0,0 +1 @@ +../datalabeling/docs \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 19253b35391e..beb5be0990a5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,6 +10,7 @@ BigQuery Storage Bigtable Container + Data Labeling Data Loss Prevention Dataproc Datastore diff --git a/docs/requirements.txt b/docs/requirements.txt index d582684a7830..99b40f458c77 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -14,6 +14,7 @@ grpcio-gcp >= 0.2.2 -e bigquery_storage/ -e bigtable/ -e container/ +-e datalabeling/ -e dataproc/ -e datastore/ -e dlp/