pythonazureazure-cognitive-servicesmicrosoft-custom-vision

Azure custom vision get image ID to delete them


I'm looking for a way using Azure custom vision API or SDK to get training image ID to delete them using for example: https://westeurope.dev.cognitive.microsoft.com/docs/services/Custom_Vision_Training_3.0/operations/5c771cdcbf6a2b18a0c3b800

I also want to to access predicted images ID but also can't figure out how to get it.

edit: for example I could use this function to delet training images using ID but look like I never created ID for my images. I used this function to upload training images


Solution

  • Actually when you upload the images you could get the id with the response when you set the raw=true(check the method parameter description). Check the rest api sample response you could find the id property under the image, this is the imageid you want.

    For now if you don't know the image id you couldn't get image directly. The simplest way is go your custom vision portal, then use browser console choose the image you want to delete get the image url, you could get the image id from the url.

    Like the below image, firstly is the image endpoint then is the i-project id, the next parameter is i-image id.

    enter image description here

    And if you want to delete images in batch, you could use get_tagged_images method, it comes from this API, you could get all tagged images Image class, in the Image class it includes the image id and image uri.

    Also why don't just delete the image in the portal, if you don't know the image this way is more efficient.