Labeling objects

One of the most important steps is to ensure that you properly label objects by adding tags to your data.

You must label at least five separate instances of each object for training. For example, if you want to train the data set to recognize cars and you have three images and one video, you must add the "car" tag to each image and at least two frames of the video. Tagging five cars in one image would not be adequate. If this requirement is not met and you train the model, it will not be trained to recognize that type of object.

Note: A data set with a variety of representative objects tagged will train a more accurate model. The exact number of images and objects cannot be specified, but some guidelines recommend as many as 1,000 representative images for each class. However, you might not need a data this large to train a model with satisfactory accuracy.

If your data set does not have many images or sufficient variety for training, consider using the Augmentation feature to increase the data set.

Recommendation: Label and class names should be 64 characters or less. Longer label names are supported but using international characters or very long label names can cause an internal metadata error, resulting in a training failure.

Labeling videos

  1. Select the video from your data set and select Label Objects.
  2. Capture frames by using one of these options:
    • Auto capture frames - PowerAI Vision captures a video frame every n seconds, where n is specified in the Capture Interval (seconds) field.
      Note:
      • Depending on the length and size of the video and the interval you specified to capture frames, the process to capture frames can take several minutes.
      • When performing multiple auto label operations on the same video, it is possible to get multiple frames with the same time offset. This situation can occur when the intervals overlap and labels have been edited on the frames at the overlap points.

        For example, labeling at a 10 second interval, editing some of the labels on those frames, and then labeling again at 5 a second interval has an overlap every 10 seconds. There might be duplicate images at each of the 10 second intervals with edited labels.

    • Manually capture frames - use Capture frame to capture relevant frames.
  3. If required, manually add new frames to an existing data set. This might happen if Auto capture frames does not produce enough frames with a specific object type. To manually add new frames, follow these steps:
    1. Play the video and when the frame you want is displayed, click the pause icon.
      Tip: You can use the video player's status bar to find a frame you want.
    2. Click Capture Frame.
  4. Create new object labels for the data set by clicking Add object in the left pane. To add multiple object labels, enter one label, click +, then enter the next until you are done. Label names cannot contain any special characters other than the underscore ( _ ). For example, characters such as these are not allowed: "/ \ | { } ( ) ; : ,
  5. Tag the objects in the images by following these steps.
    1. Select the first frame in the carousel.
    2. Select the correct object label.
    3. Click and hold down the left mouse button to draw a box around the object.
    Follow these guidelines when identifying and drawing objects in video frames:
    • Do not label part of an object. For example, do not label a car that is only partially in the frame.
    • If a frame has more than one object, you must label all objects. For example, if you have cars and motorcycles in a video frame, you must label the cars and the motorcycles. Label objects with a consistent approach.
    • Draw a box around each individual object. Do not draw a box around groups of objects. For example, if two cars are right next to each other, you must draw a box around each car.
    • Draw the box as close to the objects as possible. Do not leave blank space around the objects.
    • You can draw boxes around objects that overlap. For example, if one object is behind another object, you can label them both. However, it is recommended that you only label objects if the majority of the object is visible. You can also draw boxes that touch each other.
    • You can zoom in on the frame to make it easier to draw the box around objects.
    • Boxes cannot extend off the edge of the frame.
  6. After all objects are labeled in all of the images in the carousel, click Done editing.

Labeling images

Follow these steps to label images in your data set:
  1. Create new object labels for the data set by clicking Add object in the left pane. To add multiple object labels, enter one label, click +, then enter the next until you are done. Label names cannot contain any special characters other than the underscore ( _ ). For example, characters such as these are not allowed: "/ \ | { } ( ) ; : ,
  2. Tag the objects in the images, following these guidelines:
    • Do not label part of an object. For example, do not label a car that is only partially in the image.
    • If an image has more than one object, you must label all objects. For example, if you have cars and motorcycles in an image, you must label the cars and the motorcycles. Label objects consistently.
    • Draw a box around each individual object. Do not draw a box around groups of objects. For example, if two cars are right next to each other, you must draw a box around each car.
    • Draw the box as close to the objects as possible. Do not leave blank space around the objects.
    • You can draw boxes around objects that overlap. For example, if one object is behind another object, you can label them both. However, it is recommended that you only label objects if the majority of the object is visible. You can also draw boxes that touch each other.
    • You can zoom in on the image to make it easier to draw the box around objects.
    • Boxes cannot extend off the edge of the image.