Skip to content

Commit c105c1b

Browse files
czahedinnegrey
authored andcommitted
video: adding GA samples for logo detection [(#3098)](GoogleCloudPlatform/python-docs-samples#3098)
* DO NOT MERGE. vision: adding GA samples for logo detection * fixing linter issues across several sample files * responding to Noah's comments * responding to comments - fixing whitespace and file references * Addressing comments * Update video/cloud-client/analyze/video_detect_logo_gcs.py Deleting comma :) Co-Authored-By: Noah Negrey <[email protected]> * fixing broken test * typo Co-authored-by: Noah Negrey <[email protected]>
1 parent 2b9003d commit c105c1b

13 files changed

+833
-452
lines changed

packages/google-cloud-videointelligence/samples/analyze/analyze.py

Lines changed: 243 additions & 200 deletions
Large diffs are not rendered by default.

packages/google-cloud-videointelligence/samples/analyze/analyze_test.py

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,53 @@
1818

1919
import analyze
2020

21-
POSSIBLE_TEXTS = ['Google', 'SUR', 'SUR', 'ROTO', 'Vice President', '58oo9',
22-
'LONDRES', 'OMAR', 'PARIS', 'METRO', 'RUE', 'CARLO']
21+
POSSIBLE_TEXTS = [
22+
"Google",
23+
"SUR",
24+
"SUR",
25+
"ROTO",
26+
"Vice President",
27+
"58oo9",
28+
"LONDRES",
29+
"OMAR",
30+
"PARIS",
31+
"METRO",
32+
"RUE",
33+
"CARLO",
34+
]
2335

2436

2537
@pytest.mark.slow
2638
def test_analyze_shots(capsys):
27-
analyze.analyze_shots('gs://cloud-samples-data/video/gbikes_dinosaur.mp4')
39+
analyze.analyze_shots("gs://cloud-samples-data/video/gbikes_dinosaur.mp4")
2840
out, _ = capsys.readouterr()
29-
assert 'Shot 1:' in out
41+
assert "Shot 1:" in out
3042

3143

3244
@pytest.mark.slow
3345
def test_analyze_labels(capsys):
34-
analyze.analyze_labels('gs://cloud-samples-data/video/cat.mp4')
46+
analyze.analyze_labels("gs://cloud-samples-data/video/cat.mp4")
3547
out, _ = capsys.readouterr()
36-
assert 'label description: cat' in out
48+
assert "label description: cat" in out
3749

3850

3951
@pytest.mark.slow
4052
def test_analyze_explicit_content(capsys):
41-
analyze.analyze_explicit_content('gs://cloud-samples-data/video/cat.mp4')
53+
analyze.analyze_explicit_content("gs://cloud-samples-data/video/cat.mp4")
4254
out, _ = capsys.readouterr()
43-
assert 'pornography' in out
55+
assert "pornography" in out
4456

4557

4658
@pytest.mark.slow
4759
def test_speech_transcription(capsys):
48-
analyze.speech_transcription(
49-
'gs://cloud-samples-data/video/googlework_short.mp4')
60+
analyze.speech_transcription("gs://cloud-samples-data/video/googlework_short.mp4")
5061
out, _ = capsys.readouterr()
51-
assert 'cultural' in out
62+
assert "cultural" in out
5263

5364

5465
@pytest.mark.slow
5566
def test_detect_text_gcs(capsys):
56-
analyze.video_detect_text_gcs(
57-
'gs://cloud-samples-data/video/googlework_tiny.mp4')
67+
analyze.video_detect_text_gcs("gs://cloud-samples-data/video/googlework_tiny.mp4")
5868
out, _ = capsys.readouterr()
5969

6070
text_exists = False
@@ -67,7 +77,6 @@ def test_detect_text_gcs(capsys):
6777

6878
@pytest.mark.slow
6979
def test_track_objects_gcs(capsys):
70-
analyze.track_objects_gcs(
71-
'gs://cloud-samples-data/video/cat.mp4')
80+
analyze.track_objects_gcs("gs://cloud-samples-data/video/cat.mp4")
7281
out, _ = capsys.readouterr()
73-
assert 'cat' in out
82+
assert "cat" in out

0 commit comments

Comments
 (0)