Description Usage Arguments Details Value See Also Examples
Add and remove regions from images
| 1 2 3 4 5 | add_image_regions(project, image_ids, regions)
remove_image_regions(project, image_ids, region_ids = NULL)
identify_regions(project, image)
 | 
| project | A Custom Vision object detection project. | 
| image_ids | For  | 
| regions | For  | 
| region_ids | For  | 
| image | For  | 
add_image_regions and remove_image_regions let you specify the regions in an image that contain an object. You can use identify_regions to have Custom Vision try to guess the regions for an image.
The regions to add should be specified as a list of data frames, with one data frame per image. Each data frame should have one row per region, and the following columns:
left, top, width, height: the location and dimensions of the region bounding box, normalised to be between 0 and 1.
tag: the name of the tag to associate with the region.
Any other columns in the data frame will be ignored.
For add_image_regions, a data frame containing the details on the added regions.
For remove_image_regions, the value of image_ids invisibly, if this argument was provided; NULL otherwise.
For identify_regions, a list with the following components: projectId, the ID of the project; imageId, the ID of the image; and proposals, a data frame containing the coordinates of each identified region along with a confidence score.
add_image_tags for classification projects
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run: 
img_ids <- add_images(myproj, c("catanddog.jpg", "cat.jpg", "dog.jpg"))
regions <- list(
    data.frame(
        tag=c("cat", "dog"),
        left=c(0.1, 0.5),
        top=c(0.25, 0.28),
        width=c(0.24, 0.21),
        height=c(0.7, 0.6)
    ),
    data.frame(
        tag="cat", left=0.5, top=0.35, width=0.25, height=0.62
    ),
    data.frame(
        tag="dog", left=0.07, top=0.12, width=0.79, height=0.5
    )
)
add_image_regions(myproj, img_ids, regions)
remove_image_regions(myproj, img_ids[3])
add_image_regions(myproj, img_ids[3],
    list(data.frame(
        tag="dog", left=0.5, top=0.12, width=0.4, height=0.7
    ))
)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.