AzureVision (version 1.0.2)

add_image_tags: Tag and untag images uploaded to a project

Description

Tag and untag images uploaded to a project

Usage

add_image_tags(project, image_ids, tags)

# S3 method for classification_project add_image_tags(project, image_ids = list_images(project, "untagged"), tags)

remove_image_tags(project, image_ids = list_images(project, "tagged", as = "ids"), tags = list_tags(project, as = "ids"))

Arguments

project

a Custom Vision classification project.

image_ids

The IDs of the images to tag or untag.

tags

For add_image_tags, the tag labels to add to the images. For remove_image_tags, the tags (either text labels or IDs) to remove from images. The default for untagging is to remove all assigned tags.

Value

The vector of IDs for the images affected, invisibly.

Details

add_image_tags is for tagging images that were uploaded previously, while remove_image_tags untags them. Adding tags does not remove previously assigned ones. Similarly, removing one tag from an image leaves any other tags intact.

Tags can be specified in the following ways:

  • For a regular classification project (one tag per image), as a vector of strings. The tags will be applied to the images in order. If the length of the vector is 1, it will be recycled to the length of image_ids.

  • For a multilabel classification project (multiple tags per image), as a list of vectors of strings. Each vector in the list contains the tags to be assigned to the corresponding image. If the length of the list is 1, it will be recycled to the length of image_ids.

If the length of the vector is 1, it will be recycled to the length of image_ids.

See Also

add_images, add_tags

add_image_regions for object detection projects

Examples

Run this code
# NOT RUN {
imgs <- dir("path/to/images", full.names=TRUE)
img_ids <- add_images(myproj, imgs)
add_image_tags(myproj, "mytag")
remove_image_tags(myproj, img_ids[1])
add_image_tags(myproj, img_ids[1], "myothertag")

# }

Run the code above in your browser using DataCamp Workspace