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

docs: add samples from video/cloud-client/shotchange #72

Merged
merged 59 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b674615
Adds tutorials using Cloud Client [(#930)](https://github.com/GoogleC…
gguuss May 5, 2017
8a5ce83
Adds one more tutorial as well as fixes some copy/paste typos. [(#933…
gguuss May 5, 2017
f044dd6
Adds new examples, replaces markdown with restructured text [(#945)](…
gguuss May 18, 2017
cabc26a
Updates requirements [(#952)](https://github.com/GoogleCloudPlatform/…
gguuss May 18, 2017
4f9e8d6
Fix README rst links [(#962)](https://github.com/GoogleCloudPlatform/…
waprin May 24, 2017
384aec2
change the usage file sample [(#958)](https://github.com/GoogleCloudP…
merla18 May 24, 2017
77fdffa
Updates examples for video [(#968)](https://github.com/GoogleCloudPla…
gguuss May 31, 2017
4e138c1
Auto-update dependencies. [(#1093)](https://github.com/GoogleCloudPla…
dpebot Aug 29, 2017
2697805
Update all generated readme auth instructions [(#1121)](https://githu…
Sep 18, 2017
96bb40f
Auto-update dependencies. [(#1123)](https://github.com/GoogleCloudPla…
dpebot Sep 19, 2017
26b6337
Video v1beta2 [(#1088)](https://github.com/GoogleCloudPlatform/python…
dizcology Sep 19, 2017
6b0c420
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
Oct 12, 2017
aef3308
Tweak doc/help strings for sample tools [(#1160)](https://github.com…
pstoll Oct 12, 2017
3acd5f5
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot Nov 1, 2017
df56ca2
update samples to v1 [(#1221)](https://github.com/GoogleCloudPlatform…
dizcology Nov 29, 2017
5d379ef
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
Dec 7, 2017
f405142
Auto-update dependencies. [(#1377)](https://github.com/GoogleCloudPla…
dpebot Mar 5, 2018
3eadd14
Auto-update dependencies.
dpebot Apr 2, 2018
5686751
Regenerate the README files and fix the Open in Cloud Shell link for …
Apr 7, 2018
8f83644
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn Apr 26, 2018
7340ef6
Resolved conflicts.
michaelawyu Jun 29, 2018
83d9727
Merge branch 'dpebot-repositorygardener' despite flaky dataproc tests
michaelawyu Jun 29, 2018
4e944dd
Video Intelligence region tag update [(#1639)](https://github.com/Goo…
alixhami Aug 20, 2018
9be4a76
Auto-update dependencies. [(#1658)](https://github.com/GoogleCloudPla…
dpebot Aug 28, 2018
474bd6c
Use explicit URIs for Video Intelligence sample tests [(#1743)](https…
alixhami Oct 10, 2018
dea7bc7
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot Nov 20, 2018
5821ca2
Longer timeouts to address intermittent failures [(#1871)](https://gi…
engelke Nov 26, 2018
932893c
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot Feb 6, 2019
83e80fe
replace demomaker with cloud-samples-data/video for video intelligenc…
dizcology May 16, 2019
403e73a
Adds updates for samples profiler ... vision [(#2439)](https://github…
gguuss Oct 7, 2019
908d403
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot Dec 21, 2019
a4bb557
chore(deps): update dependency google-cloud-videointelligence to v1.1…
renovate-bot Mar 27, 2020
3c6b399
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg Apr 2, 2020
2fba04c
fix: changes positional to named pararameters in Video samples [(#401…
telpirion Jun 9, 2020
2687328
Update dependency google-cloud-videointelligence to v1.15.0 [(#4041)]…
renovate-bot Jun 16, 2020
0c11743
chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot Jul 12, 2020
0827a3b
Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot Aug 1, 2020
f71d869
Merge branch 'shotchange-samples' into add-shotchange-samples
danoscarmike Sep 28, 2020
01fd2f9
chore: pin sphinx
danoscarmike Sep 28, 2020
7a8da9f
Merge branch 'master' into add-shotchange-samples
danoscarmike Oct 1, 2020
add5724
chore: adds samples templates
danoscarmike Oct 1, 2020
5a08c9d
chore: temporarily pins sphinx
danoscarmike Oct 1, 2020
1c232ed
Merge branch 'master' into add-shotchange-samples
gcf-merge-on-green[bot] Oct 2, 2020
906cf07
Merge branch 'master' into add-shotchange-samples
danoscarmike Oct 2, 2020
f5a9a0b
chore: blacken noxfile
danoscarmike Oct 2, 2020
218ec30
Merge branch 'add-shotchange-samples' of github.com:danoscarmike/pyth…
danoscarmike Oct 2, 2020
e4d5e55
chore: lints
danoscarmike Oct 6, 2020
827f0e1
chore(deps): update dependency google-cloud-videointelligence to v1.1…
renovate-bot Oct 8, 2020
b324561
chore: fixes flaky tests
danoscarmike Oct 8, 2020
c71f2cc
Merge branch 'master' into add-shotchange-samples
danoscarmike Oct 8, 2020
81fe388
chore(deps): update dependency pytest to v6.1.1 [(#4761)](https://git…
renovate-bot Oct 14, 2020
330a5f6
chore(deps): update dependency pytest to v6.1.2 [(#4921)](https://git…
renovate-bot Oct 29, 2020
8ecf08e
Merge branch 'shotchange-samples' into add-shotchange-samples
danoscarmike Nov 16, 2020
a02408c
chore: updates samples templates
danoscarmike Nov 16, 2020
3541deb
Merge branch 'master' into add-shotchange-samples
danoscarmike Nov 18, 2020
8dd7618
merge upstream
danoscarmike Nov 18, 2020
2de0132
chore: cleans up merge conflicts
danoscarmike Nov 18, 2020
e5e7dfb
chore: blacken
danoscarmike Nov 18, 2020
a532d38
Merge branch 'danoscarmike-add-shotchange-samples'
danoscarmike Nov 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions samples/analyze/README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.. This file is automatically generated. Do not edit this file directly.

Google Cloud Video Intelligence API Python Samples
Expand All @@ -16,11 +15,13 @@ This directory contains samples for Google Cloud Video Intelligence API. `Google
.. _Google Cloud Video Intelligence API: https://cloud.google.com/video-intelligence/docs





Setup
-------------------------------------------------------------------------------



Authentication
++++++++++++++

Expand All @@ -31,9 +32,6 @@ credentials for applications.
.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started




Install Dependencies
++++++++++++++++++++

Expand All @@ -48,7 +46,7 @@ Install Dependencies
.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 3.6+.
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

.. code-block:: bash

Expand All @@ -64,15 +62,9 @@ Install Dependencies
.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/






Samples
-------------------------------------------------------------------------------


analyze
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand All @@ -88,7 +80,6 @@ To run this sample:

$ python analyze.py


usage: analyze.py [-h]
{labels,labels_file,explicit_content,shots,transcribe,text_gcs,text_file,objects_gcs,objects_file}
...
Expand Down Expand Up @@ -124,8 +115,6 @@ To run this sample:





beta samples
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand All @@ -141,7 +130,6 @@ To run this sample:

$ python beta_snippets.py


usage: beta_snippets.py [-h]
{transcription,video-text-gcs,video-text,track-objects-gcs,track-objects,streaming-labels,streaming-shot-change,streaming-objects,streaming-explicit-content,streaming-annotation-storage,streaming-automl-classification}
...
Expand Down Expand Up @@ -189,10 +177,6 @@ To run this sample:







The client library
-------------------------------------------------------------------------------

Expand All @@ -208,5 +192,4 @@ to `browse the source`_ and `report issues`_.
https://github.com/GoogleCloudPlatform/google-cloud-python/issues



.. _Google Cloud SDK: https://cloud.google.com/sdk/
.. _Google Cloud SDK: https://cloud.google.com/sdk/
34 changes: 17 additions & 17 deletions samples/quickstart/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,28 @@

TEST_CONFIG = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
'ignored_versions': ["2.7"],

# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
'enforce_type_hints': False,

# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
# to use your own Cloud project.
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',

# A dictionary you want to inject into your test. Don't put any
# secrets here. These values will override predefined values.
"envs": {},
'envs': {},
}


try:
# Ensure we can import noxfile_config in the project's directory.
sys.path.append(".")
sys.path.append('.')
from noxfile_config import TEST_CONFIG_OVERRIDE
except ImportError as e:
print("No user noxfile_config found: detail: {}".format(e))
Expand All @@ -70,12 +73,12 @@ def get_pytest_env_vars():
ret = {}

# Override the GCLOUD_PROJECT and the alias.
env_key = TEST_CONFIG["gcloud_project_env"]
env_key = TEST_CONFIG['gcloud_project_env']
# This should error out if not set.
ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key]
ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key]

# Apply user supplied envs.
ret.update(TEST_CONFIG["envs"])
ret.update(TEST_CONFIG['envs'])
return ret


Expand All @@ -84,7 +87,7 @@ def get_pytest_env_vars():
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']

TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS])

Expand Down Expand Up @@ -133,7 +136,7 @@ def _determine_local_import_names(start_dir):

@nox.session
def lint(session):
if not TEST_CONFIG["enforce_type_hints"]:
if not TEST_CONFIG['enforce_type_hints']:
session.install("flake8", "flake8-import-order")
else:
session.install("flake8", "flake8-import-order", "flake8-annotations")
Expand All @@ -142,11 +145,9 @@ def lint(session):
args = FLAKE8_COMMON_ARGS + [
"--application-import-names",
",".join(local_names),
".",
"."
]
session.run("flake8", *args)


#
# Black
#
Expand All @@ -159,7 +160,6 @@ def blacken(session):

session.run("black", *python_files)


#
# Sample Tests
#
Expand Down Expand Up @@ -199,9 +199,9 @@ def py(session):
if session.python in TESTED_VERSIONS:
_session_tests(session)
else:
session.skip(
"SKIPPED: {} tests are disabled for this sample.".format(session.python)
)
session.skip("SKIPPED: {} tests are disabled for this sample.".format(
session.python
))


#
Expand Down
134 changes: 134 additions & 0 deletions samples/shotchange/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

.. This file is automatically generated. Do not edit this file directly.

Google Cloud Video Intelligence API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=video/cloud-client/shotchange/README.rst


This directory contains samples for Google Cloud Video Intelligence API. `Google Cloud Video Intelligence API`_ allows developers to easily integrate feature detection in video.




.. _Google Cloud Video Intelligence API: https://cloud.google.com/video-intelligence/docs


Setup
-------------------------------------------------------------------------------



Authentication
++++++++++++++

This sample requires you to have authentication setup. Refer to the
`Authentication Getting Started Guide`_ for instructions on setting up
credentials for applications.

.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started




Install Dependencies
++++++++++++++++++++

#. Clone python-docs-samples and change directory to the sample directory you want to use.

.. code-block:: bash

$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git

#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.

.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 3.6+.

.. code-block:: bash

$ virtualenv env
$ source env/bin/activate

#. Install the dependencies needed to run the samples.

.. code-block:: bash

$ pip install -r requirements.txt

.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/






Samples
-------------------------------------------------------------------------------


Shot Change Detection
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=video/cloud-client/shotchange/shotchange.py,video/cloud-client/shotchange/README.rst




To run this sample:

.. code-block:: bash

$ python shotchange.py


usage: shotchange.py [-h] path

This application demonstrates how to identify all different shots
in a video using the Google Cloud Video Intelligence API.

For more information, check out the documentation at
https://cloud.google.com/videointelligence/docs.

Example Usage:

python shotchange.py gs://cloud-samples-data/video/gbikes_dinosaur.mp4

positional arguments:
path GCS path for shot change detection.

optional arguments:
-h, --help show this help message and exit









The client library
-------------------------------------------------------------------------------

This sample uses the `Google Cloud Client Library for Python`_.
You can read the documentation for more details on API usage and use GitHub
to `browse the source`_ and `report issues`_.

.. _Google Cloud Client Library for Python:
https://googlecloudplatform.github.io/google-cloud-python/
.. _browse the source:
https://github.com/GoogleCloudPlatform/google-cloud-python
.. _report issues:
https://github.com/GoogleCloudPlatform/google-cloud-python/issues



.. _Google Cloud SDK: https://cloud.google.com/sdk/
22 changes: 22 additions & 0 deletions samples/shotchange/README.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is used to generate README.rst

product:
name: Google Cloud Video Intelligence API
short_name: Cloud Video Intelligence API
url: https://cloud.google.com/video-intelligence/docs
description: >
`Google Cloud Video Intelligence API`_ allows developers to easily
integrate feature detection in video.

setup:
- auth
- install_deps

samples:
- name: Shot Change Detection
file: shotchange.py
show_help: True

cloud_client_library: true

folder: video/cloud-client/shotchange
Loading