Skip to content

Commit

Permalink
docs: fix failing video tests and remove invalid file (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnegrey authored Apr 6, 2020
1 parent 60029e7 commit 27e256d
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions video-intelligence/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,14 @@ async function main() {
)
.example(`node $0 shots gs://cloud-samples-data/video/googlework_short.mp4`)
.example(`node $0 labels-gcs gs://cloud-samples-data/video/cat.mp4`)
.example(`node $0 labels-file cat.mp4`)
.example(`node $0 safe-search gs://cloud-samples-data/video/cat.mp4`)
.example(`node $0 labels-file googlework_short.mp4`)
.example(`node $0 safe-search gs://cloud-samples-data/video/googlework_short.mp4`)
.example(`node $0 transcription gs://cloud-samples-data/video/cat.mp4`)
.example(`node $0 video-text ./resources/googlework_short.mp4`)
.example(
`node $0 video-text-gcs gs://nodejs-docs-samples/video/googlework_short.mp4`
)
.example(`node $0 track-objects ./resources/cat.mp4`)
.example(`node $0 track-objects ./resources/googlework_short.mp4`)
.example(`node $0 track-objects-gcs gs://nodejs-docs-samples/video/cat.mp4`)
.wrap(120)
.recommendCommands()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-annotation-to-storage.js`;
const project = process.env.GCLOUD_PROJECT;
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';
const outputUri = 'gs://' + project + '/VIDEO_STREAMING_OUTPUT';

describe('streaming annotation to storage', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
const cmd = `node analyze-streaming-automl-classification.js`;
const modelId = `VCN3094808572840640512`;
const project = process.env.GCLOUD_PROJECT;
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';

describe('streaming automl classification', () => {
it('should classify the action in the streaming video', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {describe, it} = require('mocha');
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-labels.js`;
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';

describe('streaming label', () => {
it('should analyze labels in a streaming video', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {describe, it} = require('mocha');
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-object.js`;
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';

describe('streaming object', () => {
it('should track an object in a streaming video', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const {describe, it} = require('mocha');
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-safe-search.js`;
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';

describe('streaming safe search', () => {
it('should analyze explicit content in a streaming video', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {describe, it} = require('mocha');
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = `node analyze-streaming-shot-change.js`;
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';

describe('streaming shot change', () => {
it('should analyze shot changes in a streaming video', async () => {
Expand Down
4 changes: 2 additions & 2 deletions video-intelligence/system-test/analyze.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = 'node analyze.js';
const catUrl = 'gs://cloud-samples-data/video/cat.mp4';
const file = 'resources/cat.mp4';
const file = 'resources/googlework_short.mp4';
const file2 = 'resources/googlework_short.mp4';
const possibleTexts = /Google|GOOGLE|SUR|OMAR|ROTO|Vice President|58oo9|LONDRES|PARIS|METRO|RUE|CARLO/;

describe('analyze samples', () => {
// analyze_labels_local
it('should analyze labels in a local file', async () => {
const output = execSync(`${cmd} labels-file ${file}`);
assert.match(output, /Label whiskers occurs at:/);
assert.match(output, /Label/);
assert.match(output, /Confidence: \d+\.\d+/);
});

Expand Down
2 changes: 1 addition & 1 deletion video-intelligence/system-test/analyze.v1p2beta1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = 'node analyze.v1p2beta1.js';
const url = 'gs://cloud-samples-data/video/cat.mp4';
const file1 = 'resources/cat.mp4';
const file1 = 'resources/googlework_short.mp4';
const file2 = 'resources/googlework_short.mp4';
const possibleTexts = /Google|GOOGLE|SUR|OMAR|ROTO|Vice President|58oo9|LONDRES|PARIS|METRO|RUE|CARLO/;

Expand Down

0 comments on commit 27e256d

Please sign in to comment.