Skip to content

Commit a4dac66

Browse files
authored
Vision snippets. (#294)
1 parent 16411a7 commit a4dac66

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

packages/google-cloud-vision/samples/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ content.
1313

1414
* [Setup](#setup)
1515
* [Samples](#samples)
16+
* [Detection snippets](#detection-snippets)
1617
* [Face detection](#face-detection)
1718
* [Label detection](#label-detection)
1819
* [Landmark detection](#landmark-detection)
@@ -30,6 +31,54 @@ content.
3031

3132
## Samples
3233

34+
### Detection snippets
35+
36+
View the [documentation][detect_docs] or the [source code][detect_code].
37+
38+
__Usage:__ `node detect.js --help`
39+
40+
```
41+
Commands:
42+
faces <fileName> Detects faces in a local image file.
43+
faces-gcs <bucket> <fileName> Detects faces in an image in Google Cloud Storage.
44+
labels <fileName> Detects labels in a local image file.
45+
labels-gcs <bucket> <fileName> Detects labels in an image in Google Cloud Storage.
46+
landmarks <fileName> Detects landmarks in a local image file.
47+
landmarks-gcs <bucket> <fileName> Detects landmarks in an image in Google Cloud Storage.
48+
text <fileName> Detects text in a local image file.
49+
text-gcs <bucket> <fileName> Detects text in an image in Google Cloud Storage.
50+
logos <fileName> Detects logos in a local image file.
51+
logos-gcs <bucket> <fileName> Detects logos in an image in Google Cloud Storage.
52+
properties <fileName> Detects image properties in a local image file.
53+
properties-gcs <bucket> <fileName> Detects image properties in an image in Google Cloud Storage.
54+
safe-search <fileName> Detects safe search properties in a local image file.
55+
safe-search-gcs <bucket> <fileName> Detects safe search properties in an image in Google Cloud Storage.
56+
57+
Options:
58+
--help Show help [boolean]
59+
60+
Examples:
61+
node detect.js faces ./resources/face_no_surprise.jpg
62+
node detect.js faces-gcs my-bucket your-image.jpg
63+
node detect.js labels ./resources/wakeupcat.jpg
64+
node detect.js labels-gcs my-bucket your-image.jpg
65+
node detect.js landmarks ./resources/landmark.jpg
66+
node detect.js landmarks-gcs my-bucket your-image.jpg
67+
node detect.js text ./resources/wakeupcat.jpg
68+
node detect.js text-gcs my-bucket your-image.jpg
69+
node detect.js logos ./resources/logos.png
70+
node detect.js logos-gcs my-bucket your-image.jpg.png
71+
node detect.js properties ./resources/landmark.jpg
72+
node detect.js properties-gcs my-bucket your-image.jpg
73+
node detect.js safe-search ./resources/wakeupcat.jpg
74+
node detect.js safe-search-gcs my-bucket your-image.jpg
75+
76+
For more information, see https://cloud.google.com/vision/docs
77+
```
78+
79+
[detect_docs]: https://cloud.google.com/vision/docs
80+
[detect_code]: detect.js
81+
3382
### Face detection
3483

3584
View the [documentation][face_docs] or the [source code][face_code].

packages/google-cloud-vision/samples/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
"license": "Apache Version 2.0",
66
"author": "Google Inc.",
77
"scripts": {
8-
"test": "cd ..; npm run st -- --verbose vision/system-test/*.test.js"
8+
"test": "cd ..; npm run st -- --verbose vision/system-test/detect.test.js"
99
},
1010
"dependencies": {
11+
"@google-cloud/storage": "0.6.0",
1112
"@google-cloud/vision": "0.7.0",
1213
"async": "2.1.4",
1314
"natural": "0.4.0",
14-
"redis": "2.6.3"
15+
"redis": "2.6.3",
16+
"yargs": "6.6.0"
1517
},
1618
"optionalDependencies": {
1719
"canvas": "1.6.2"

0 commit comments

Comments
 (0)