|
15 | 15 | 'use strict';
|
16 | 16 |
|
17 | 17 | async function detectPerson(path) {
|
18 |
| - //[START video_detect_person_beta] |
| 18 | + // [START video_detect_person_beta] |
19 | 19 | // Imports the Google Cloud Video Intelligence library + Node's fs library
|
20 | 20 | const Video = require('@google-cloud/video-intelligence').v1p3beta1;
|
21 | 21 | const fs = require('fs');
|
@@ -44,6 +44,7 @@ async function detectPerson(path) {
|
44 | 44 | },
|
45 | 45 | };
|
46 | 46 | // Detects people in a video
|
| 47 | + // We get the first result because only one video is processed. |
47 | 48 | const [operation] = await video.annotateVideo(request);
|
48 | 49 | const results = await operation.promise();
|
49 | 50 | console.log('Waiting for operation to complete...');
|
@@ -96,7 +97,7 @@ async function detectPerson(path) {
|
96 | 97 | // [END video_detect_person_beta]
|
97 | 98 | }
|
98 | 99 | async function detectPersonGCS(gcsUri) {
|
99 |
| - //[START video_detect_person_gcs_beta] |
| 100 | + // [START video_detect_person_gcs_beta] |
100 | 101 | // Imports the Google Cloud Video Intelligence library
|
101 | 102 | const Video = require('@google-cloud/video-intelligence').v1p3beta1;
|
102 | 103 | // Creates a client
|
@@ -173,7 +174,7 @@ async function detectPersonGCS(gcsUri) {
|
173 | 174 | // [END video_detect_person_gcs_beta]
|
174 | 175 | }
|
175 | 176 | async function detectFaces(path) {
|
176 |
| - //[START video_detect_faces_beta] |
| 177 | + // [START video_detect_faces_beta] |
177 | 178 | // Imports the Google Cloud Video Intelligence library + Node's fs library
|
178 | 179 | const Video = require('@google-cloud/video-intelligence').v1p3beta1;
|
179 | 180 | const fs = require('fs');
|
@@ -244,10 +245,10 @@ async function detectFaces(path) {
|
244 | 245 | }
|
245 | 246 | }
|
246 | 247 | }
|
247 |
| - //[END video_detect_faces_beta] |
| 248 | + // [END video_detect_faces_beta] |
248 | 249 | }
|
249 | 250 | async function detectFacesGCS(gcsUri) {
|
250 |
| - //[START video_detect_faces_gcs_beta] |
| 251 | + // [START video_detect_faces_gcs_beta] |
251 | 252 | // Imports the Google Cloud Video Intelligence library
|
252 | 253 | const Video = require('@google-cloud/video-intelligence').v1p3beta1;
|
253 | 254 | // Creates a client
|
@@ -314,7 +315,7 @@ async function detectFacesGCS(gcsUri) {
|
314 | 315 | }
|
315 | 316 | }
|
316 | 317 | }
|
317 |
| - //[END video_detect_faces_gcs_beta] |
| 318 | + // [END video_detect_faces_gcs_beta] |
318 | 319 | }
|
319 | 320 |
|
320 | 321 | async function main() {
|
|
0 commit comments