Skip to content

Commit

Permalink
remove smoke-test hack (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhenliu-gg5 authored and Ace Nassri committed Nov 17, 2022
1 parent d6266cf commit 8af10b2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions video-intelligence/analyze-streaming-automl-classification.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ async function main(
const labels = annotations.labelAnnotations;
labels.forEach(label => {
console.log(
`Label ${label.entity.description} occurs at: ${label.frames[0]
.timeOffset.seconds || 0}` +
`.${(label.frames[0].timeOffset.nanos / 1e6).toFixed(0)}s`
`Label ${label.entity.description} occurs at: ${
label.frames[0].timeOffset.seconds || 0
}` + `.${(label.frames[0].timeOffset.nanos / 1e6).toFixed(0)}s`
);
console.log(` Confidence: ${label.frames[0].confidence}`);
});
Expand Down
6 changes: 3 additions & 3 deletions video-intelligence/analyze-streaming-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ async function main(path = 'YOUR_LOCAL_FILE') {
const labels = annotations.labelAnnotations;
labels.forEach(label => {
console.log(
`Label ${label.entity.description} occurs at: ${label.frames[0]
.timeOffset.seconds || 0}` +
`.${(label.frames[0].timeOffset.nanos / 1e6).toFixed(0)}s`
`Label ${label.entity.description} occurs at: ${
label.frames[0].timeOffset.seconds || 0
}` + `.${(label.frames[0].timeOffset.nanos / 1e6).toFixed(0)}s`
);
console.log(` Confidence: ${label.frames[0].confidence}`);
});
Expand Down
5 changes: 3 additions & 2 deletions video-intelligence/analyze-streaming-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ async function main(path = 'YOUR_LOCAL_FILE') {
console.log(`Track id: ${object.trackId}`);
console.log(`Confidence: ${object.confidence}`);
console.log(
`Time offset for the frame: ${object.frames[0].timeOffset.seconds ||
0}` + `.${(object.frames[0].timeOffset.nanos / 1e6).toFixed(0)}s`
`Time offset for the frame: ${
object.frames[0].timeOffset.seconds || 0
}` + `.${(object.frames[0].timeOffset.nanos / 1e6).toFixed(0)}s`
);
//Every annotation has only one frame.
const box = object.frames[0].normalizedBoundingBox;
Expand Down
5 changes: 3 additions & 2 deletions video-intelligence/analyze-streaming-shot-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ async function main(path = 'YOUR_LOCAL_FILE') {
shotChanges.forEach(shot => {
console.log(
` Shot: ${shot.startTimeOffset.seconds || 0}` +
`.${(shot.startTimeOffset.nanos / 1e6).toFixed(0)}s to ${shot
.endTimeOffset.seconds || 0}` +
`.${(shot.startTimeOffset.nanos / 1e6).toFixed(0)}s to ${
shot.endTimeOffset.seconds || 0
}` +
`.${(shot.endTimeOffset.nanos / 1e6).toFixed(0)}s`
);
});
Expand Down
10 changes: 6 additions & 4 deletions video-intelligence/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,9 @@ async function analyzeObjectTrackingGCS(gcsUri) {
const time = object.segment;
console.log(
`Segment: ${time.startTimeOffset.seconds || 0}` +
`.${(time.startTimeOffset.nanos / 1e6).toFixed(0)}s to ${time
.endTimeOffset.seconds || 0}.` +
`.${(time.startTimeOffset.nanos / 1e6).toFixed(0)}s to ${
time.endTimeOffset.seconds || 0
}.` +
`${(time.endTimeOffset.nanos / 1e6).toFixed(0)}s`
);
console.log(`Confidence: ${object.confidence}`);
Expand Down Expand Up @@ -514,8 +515,9 @@ async function analyzeObjectTracking(path) {
const time = object.segment;
console.log(
`Segment: ${time.startTimeOffset.seconds || 0}` +
`.${(time.startTimeOffset.nanos / 1e6).toFixed(0)}s to ${time
.endTimeOffset.seconds || 0}.` +
`.${(time.startTimeOffset.nanos / 1e6).toFixed(0)}s to ${
time.endTimeOffset.seconds || 0
}.` +
`${(time.endTimeOffset.nanos / 1e6).toFixed(0)}s`
);
console.log(`Confidence: ${object.confidence}`);
Expand Down

0 comments on commit 8af10b2

Please sign in to comment.