Skip to content

Commit

Permalink
chore: Cleanup timestamp setting blocks in samples (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicain authored and ahrarmonsur committed Nov 17, 2022
1 parent 87274e4 commit 875f36c
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 60 deletions.
12 changes: 0 additions & 12 deletions video-intelligence/analyze-face-detection-gcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
12 changes: 0 additions & 12 deletions video-intelligence/analyze-face-detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
12 changes: 0 additions & 12 deletions video-intelligence/analyze-person-detection-gcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
12 changes: 0 additions & 12 deletions video-intelligence/analyze-person-detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
12 changes: 0 additions & 12 deletions video-intelligence/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 875f36c

Please sign in to comment.