Removing images from your dataset - Amazon Lookout for Vision

Removing images from your dataset

You can't delete images directly from a dataset. Instead you must delete the existing dataset and create a new dataset without the images that you want to remove. How you remove images depends how you imported images into the existing dataset (manifest file, Amazon S3 bucket, or local computer).

You can also use the AWS SDK to remove images. This is useful when creating an image segmentation model without an image segmentation manifest file, making it unnecessary to redraw the image masks with the Amazon Lookout for Vision console.

Removing images from a dataset (Console)

Use the following procedure to remove images from a dataset with the Amazon Lookout for Vision console.

To remove images from a dataset (console)
  1. Open the project's dataset gallery.

  2. Note the name of each image that you want to remove.

  3. Delete the existing dataset.

  4. Do one of the following:

    • If you created the dataset with a manifest file, do:

      1. In a text editor, open the manifest file that you used to create the dataset.

      2. Remove the JSON line for each image that you noted in step 2. You can identify the JSON line for an image by checking the source-ref field.

      3. Save the manifest file.

      4. Create a new dataset with the updated manifest file.

    • If you created the dataset from images imported from an Amazon S3 bucket, do:

      1. Delete the images you noted in step 2 from the Amazon S3 bucket.

      2. Create a new dataset with the remaining images in the Amazon S3 bucket. If you classify images by folder name, you don't need to classify images in the next step.

      3. Do one of the following:

        • If you are creating an image classification model, classify each unlabeled image.

        • If you are creating an image segmentation model, classify and segment each unlabeled image.

    • If you created the dataset from images imported from a local computer, do:

      1. On your computer, create a folder with the images that you want to use. Don't include the images you want to remove from the dataset. For more information, see Creating a dataset using images stored on your local computer.

      2. Create the dataset with the images in the folder that you created in step 4.a.

      3. Do one of the following:

        • If you are creating an image classification model, classify each unlabeled image.

        • If you are creating an image segmentation model, classify and segment each unlabeled image.

  5. Train the model.

Removing images from a dataset (SDK)

You can use the AWS SDK to remove images from a dataset.

To remove images from a dataset (SDK)
  1. Open the project's dataset gallery.

  2. Note the name of each image that you want to remove.

  3. Export the JSON lines for the dataset by using the ListDatasetEntries operation.

  4. Create a manifest file with the exported JSON lines.

  5. In a text editor, open the manifest file.

  6. Remove the JSON line for each image that you noted in step 2. You can identify the JSON line for an image by checking the source-ref field.

  7. Save the manifest file.

  8. Delete the existing dataset.

  9. Create a new dataset with the updated manifest file.

  10. Train the model.