diff --git a/video-intelligence/analyze-face-detection-gcs.js b/video-intelligence/analyze-face-detection-gcs.js index 6b5e200afa..4055ef4393 100644 --- a/video-intelligence/analyze-face-detection-gcs.js +++ b/video-intelligence/analyze-face-detection-gcs.js @@ -53,18 +53,6 @@ function main(gcsUri = 'YOUR_STORAGE_URI') { console.log('Face detected:'); for (const {segment, timestampedObjects} of tracks) { - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}.` + `${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` diff --git a/video-intelligence/analyze-face-detection.js b/video-intelligence/analyze-face-detection.js index 12756a4e34..a7b07e59a1 100644 --- a/video-intelligence/analyze-face-detection.js +++ b/video-intelligence/analyze-face-detection.js @@ -56,18 +56,6 @@ function main(path = 'YOUR_LOCAL_FILE') { for (const {tracks} of faceAnnotations) { console.log('Face detected:'); for (const {segment, timestampedObjects} of tracks) { - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}` + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` diff --git a/video-intelligence/analyze-person-detection-gcs.js b/video-intelligence/analyze-person-detection-gcs.js index 2c8f3b4a7e..0ffb247b94 100644 --- a/video-intelligence/analyze-person-detection-gcs.js +++ b/video-intelligence/analyze-person-detection-gcs.js @@ -54,18 +54,6 @@ function main(gcsUri = 'YOUR_STORAGE_URI') { console.log('Person detected:'); for (const {segment, timestampedObjects} of tracks) { - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}` + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` diff --git a/video-intelligence/analyze-person-detection.js b/video-intelligence/analyze-person-detection.js index 0fcbe6282b..717ded3e76 100644 --- a/video-intelligence/analyze-person-detection.js +++ b/video-intelligence/analyze-person-detection.js @@ -63,18 +63,6 @@ function main(path = 'YOUR_LOCAL_FILE') { console.log('Person detected:'); for (const {segment, timestampedObjects} of tracks) { - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}` + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` diff --git a/video-intelligence/quickstart.js b/video-intelligence/quickstart.js index 66866db4f4..92ee050f9f 100644 --- a/video-intelligence/quickstart.js +++ b/video-intelligence/quickstart.js @@ -48,18 +48,6 @@ async function main() { console.log(`Label ${label.entity.description} occurs at:`); label.segments.forEach(segment => { segment = segment.segment; - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}` + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s`