@@ -23,66 +23,19 @@ const cp = require('child_process');
2323const execSync = cmd => cp . execSync ( cmd , { encoding : 'utf-8' } ) ;
2424
2525const cmd = 'node analyze.js' ;
26- const url = 'gs://nodejs-docs-samples-video/quickstart.mp4' ;
27- const shortUrl = 'gs://nodejs-docs-samples-video/quickstart_short.mp4' ;
28- const catUrl = 'gs://nodejs-docs-samples/video/cat.mp4' ;
26+ const catUrl = 'gs://cloud-samples-data/video/cat.mp4' ;
2927const file = 'resources/cat.mp4' ;
3028const file2 = 'resources/googlework_short.mp4' ;
3129const possibleTexts = / G o o g l e | G O O G L E | S U R | O M A R | R O T O | V i c e P r e s i d e n t | 5 8 o o 9 | L O N D R E S | P A R I S | M E T R O | R U E | C A R L O / ;
3230
3331describe ( 'analyze samples' , ( ) => {
34- // analyze_labels_gcs (one scene)
35- it ( 'should analyze labels in a GCS file with one scene' , async ( ) => {
36- const output = execSync ( `${ cmd } labels-gcs ${ shortUrl } ` ) ;
37- assert . match ( output , / L a b e l s h i r t o c c u r s a t : / ) ;
38- assert . match ( output , / C o n f i d e n c e : \d + \. \d + / ) ;
39- } ) ;
40-
41- // analyze_labels_gcs (multiple scenes)
42- it ( 'should analyze labels in a GCS file with multiple scenes' , async ( ) => {
43- const output = execSync ( `${ cmd } labels-gcs ${ url } ` ) ;
44- assert . match ( output , / L a b e l s h i r t o c c u r s a t : / ) ;
45- assert . match ( output , / C o n f i d e n c e : \d + \. \d + / ) ;
46- } ) ;
47-
4832 // analyze_labels_local
4933 it ( 'should analyze labels in a local file' , async ( ) => {
5034 const output = execSync ( `${ cmd } labels-file ${ file } ` ) ;
5135 assert . match ( output , / L a b e l w h i s k e r s o c c u r s a t : / ) ;
5236 assert . match ( output , / C o n f i d e n c e : \d + \. \d + / ) ;
5337 } ) ;
5438
55- // analyze_shots (multiple shots)
56- it ( 'should analyze shots in a GCS file with multiple shots' , async ( ) => {
57- const output = execSync ( `${ cmd } shots ${ url } ` ) ;
58- assert . match ( output , / S c e n e 0 o c c u r s f r o m : / ) ;
59- } ) ;
60-
61- // analyze_shots (one shot)
62- it ( 'should analyze shots in a GCS file with one shot' , async ( ) => {
63- const output = execSync ( `${ cmd } shots ${ shortUrl } ` ) ;
64- assert . match ( output , / T h e e n t i r e v i d e o i s o n e s h o t ./ ) ;
65- } ) ;
66-
67- // analyze_safe_search
68- it ( 'should analyze safe search results in a GCS file' , async ( ) => {
69- const output = execSync ( `${ cmd } safe-search ${ url } ` ) ;
70- assert . match ( output , / T i m e : \d + \. \d + s / ) ;
71- assert . match ( output , / E x p l i c i t a n n o t a t i o n r e s u l t s : / ) ;
72- } ) ;
73-
74- // analyze_video_transcription
75- it ( 'should analyze video transcription results in a GCS file' , async ( ) => {
76- const output = execSync ( `${ cmd } transcription ${ shortUrl } ` ) ;
77- assert . match ( output , / o v e r t h e p a s s / ) ;
78- } ) ;
79-
80- //detect_text_gcs
81- it ( 'should detect text in a GCS file' , async ( ) => {
82- const output = execSync ( `${ cmd } video-text-gcs ${ shortUrl } ` ) ;
83- assert . match ( output , possibleTexts ) ;
84- } ) ;
85-
8639 //detect_text
8740 it ( 'should detect text in a local file' , async ( ) => {
8841 const output = execSync ( `${ cmd } video-text ${ file2 } ` ) ;
0 commit comments