Learn with our tutorials and training

developerWorks provides tutorials, articles and other
technical resources to help you grow your development skills
on a wide variety of topics and products. Learn about a specific
product or take a course and get certified. So, what do you want to learn
about?

Featured products

Featured destinations

Find a community and connect

Learn from the experts and share with other developers in one of our
dev centers. Ask questions and get answers with dW answers. Search for local events
in your area. All in developerWorks communities.

Sample code: Recognize and identify faces in an image with the Watson
Visual Recognition service

Interactive code: When you see Run at the top of a code sample, you can run the code, check the results,
make changes, and run it again. When you see Deploy, you can deploy the code
into the developerWorks IBM Cloud account. To deploy the code, please sign in.

About this code

This code shows you how to use the node.js API for the Watson Visual
Recognition service. Given an image, Watson looks for faces in that image
and attempts to recognize each of those faces.

The code has two basic sections:

The main() method. This is the entry point to the code.
It creates the VisualRecognitionV3 object and then
invokes the detectFaces() method.

A set of default parameters and the code that runs this module if it
is invoked by itself (as opposed to being invoked by a
require() statement). See the Node.js documentation for more information on the
implications of the require.main === module statement.