Locate and count items with object detection  

Create a model and a REST endpoint to let your app detect, locate, and count items in an image

Last updated | By Mark Sturdevant


Object detection has different uses and different opportunities than image classification. This code pattern demonstrates how to use PowerAI Vision Object Detection to detect and label objects within an image (in this case, Coca-Cola products), based on customized training. You can then easily customize this initial dataset example with your own datasets–without writing any code.


Imagine that you’re a supplier of an item (such as a soft drink) and you want to know how many bottles there are on a store’s shelf. You can build an app that helps you do just that. PowerAI Vision uses deep learning to create trained models based on images that you upload and label. You don’t need to write any code to train, deploy, and test a new object detection model. You simply upload the images, use your mouse to label the objects in your images, and then let PowerAI Vision do the learning.

With this pattern, you will use deep learning training to create a model for object detection. With just a few clicks, you can train and deploy the model. After you train and deploy the model, a REST endpoint lets you locate and count items in an image. The code pattern includes an example dataset to help you build a Coke bottle detector, but you can use your own examples and detect other objects.

PowerAI Vision presents REST APIs for inference operations. You can use any REST client for object detection with your custom model, and you can use PowerAI Vision UI to test it. This example includes an example Node.js app that demonstrates how to upload an image and then draw the image with labels and bounding boxes around detected objects.

When you have completed this code pattern, you should know how to:

  • Create a dataset for object detection with PowerAI Vision
  • Train and deploy a model based on the dataset
  • Test the model using REST calls


  1. Upload the images to create a PowerAI Vision dataset.
  2. Label the objects in the image dataset prior to training.
  3. Train, deploy, and test the model in PowerAI Vision.
  4. Use a REST client to detect objects in images.


Find the detailed steps for this pattern in the README. Those steps will show you how to:

  1. Clone the powerai-vision-object-detection GitHub repo.
  2. Login to PowerAI Vision.
  3. Create a new dataset for object detection training.
  4. Create tags for training objects and label the objects.
  5. Create a DL task.
  6. Deploy and test the model.
  7. Run the app.

Related Blogs

Open Digital Lab Meetup – Our Debut with CIMON

On August 14th 2018, we held our first Open Digital Lab Meetup in Darmstadt, Germany. Our intention is to share ideas, skills, and practical experiences around technology; we want to glean insights from data and assist individuals to make use of them. For our debut, we had an exhilarating topic: Artificial Intelligence which is currently...

Continue reading Open Digital Lab Meetup – Our Debut with CIMON

Related Links

Architecture center

Learn how this code pattern fits into the Cognitive discovery Reference Architecture

From the developers

IBM PowerAI Vision speeds transfer learning with greater accuracy — a real world example