0

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

akhetos
  • 686
  • 1
  • 10
  • 31
  • There's no way to get the image ID just from the image. You need to save the ID that was returned when you uploaded it. As a workaround, you can use the customvision.ai site to manage your projects – Hong Ooi Jan 08 '20 at 13:21
  • I used `classify_image` [doc here](https://learn.microsoft.com/fr-fr/python/api/azure-cognitiveservices-vision-customvision/azure.cognitiveservices.vision.customvision.prediction.custom_vision_prediction_client.customvisionpredictionclient?view=azure-python#classify-image-project-id--published-name--image-data--application-none--custom-headers-none--raw-false----operation-config-) to upload my classified data, so it's mean my classified image have no ID? Is there any way to delet them using API or SDK? – akhetos Jan 08 '20 at 13:26
  • You are talking about deleting training images or predicted images? – Nicolas R Jan 08 '20 at 22:41
  • For my project I want to delete training images, but for curiosity I'm also trying to find a way to delete predicted images with script – akhetos Jan 09 '20 at 08:25

1 Answers1

1

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.

George Chen
  • 13,703
  • 2
  • 11
  • 26
  • Deleting image from portal take very long. Deleting image using their ID can be very powerfull when you want to train a new model with (for example) removing 50% of images from classe A. – akhetos Jan 10 '20 at 08:31