GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — nodejs-docs-samples/vision at master · enterstudio/nodejs-docs-samples

Expand file tree

/

vision

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

vision

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
resources
resources
 
 
system-test
system-test
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
detect.js
detect.js
 
 
faceDetection.js
faceDetection.js
 
 
package.json
package.json
 
 
quickstart.js
quickstart.js
 
 
textDetection.js
textDetection.js
 
 
yarn.lock
yarn.lock
 
 

README.md

Outline

Google Cloud Platform logo

Google Cloud Vision API Node.js Samples

The Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.

Table of Contents

  • Setup
  • Samples
    • Detection snippets
    • Face detection
    • Text detection

Setup

  1. Read Prerequisites and How to run a sample first.

  2. Install dependencies:

     npm install
    

Samples

Detection snippets

View the documentation or the source code.

Usage: node detect.js --help

Commands:
  faces <fileName>                     Detects faces in a local image file.
  faces-gcs <bucket> <fileName>        Detects faces in an image in Google Cloud Storage.
  labels <fileName>                    Detects labels in a local image file.
  labels-gcs <bucket> <fileName>       Detects labels in an image in Google Cloud Storage.
  landmarks <fileName>                 Detects landmarks in a local image file.
  landmarks-gcs <bucket> <fileName>    Detects landmarks in an image in Google Cloud Storage.
  text <fileName>                      Detects text in a local image file.
  text-gcs <bucket> <fileName>         Detects text in an image in Google Cloud Storage.
  logos <fileName>                     Detects logos in a local image file.
  logos-gcs <bucket> <fileName>        Detects logos in an image in Google Cloud Storage.
  properties <fileName>                Detects image properties in a local image file.
  properties-gcs <bucket> <fileName>   Detects image properties in an image in Google Cloud Storage.
  safe-search <fileName>               Detects safe search properties in a local image file.
  safe-search-gcs <bucket> <fileName>  Detects safe search properties in an image in Google Cloud Storage.

Options:
  --help  Show help                                                                                            [boolean]

Examples:
  node detect.js faces ./resources/face_no_surprise.jpg
  node detect.js faces-gcs my-bucket your-image.jpg
  node detect.js labels ./resources/wakeupcat.jpg
  node detect.js labels-gcs my-bucket your-image.jpg
  node detect.js landmarks ./resources/landmark.jpg
  node detect.js landmarks-gcs my-bucket your-image.jpg
  node detect.js text ./resources/wakeupcat.jpg
  node detect.js text-gcs my-bucket your-image.jpg
  node detect.js logos ./resources/logos.png
  node detect.js logos-gcs my-bucket your-image.jpg.png
  node detect.js properties ./resources/landmark.jpg
  node detect.js properties-gcs my-bucket your-image.jpg
  node detect.js safe-search ./resources/wakeupcat.jpg
  node detect.js safe-search-gcs my-bucket your-image.jpg

For more information, see https://cloud.google.com/vision/docs

Face detection tutorial

View the documentation or the source code.

This sample uses node-canvas to draw an output image. node-canvas depends on Cairo, which may require separate installation. See the node-canvas installation section for details.

Run the sample:

Usage: node faceDetection <path-to-image-file>

Example:

node faceDetection "./resources/face.png"

Text detection tutorial

View the source code.

Run the sample:

Usage: node textDetection <command> [args]...

Analyze images:

node textDetection analyze "./resources/"

Look up words:

node textDetection lookup the sunbeams in
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.