I'm trying to dig through the CustomVision Python SDK and can't find a way to get the ID of an image from a prediction ID. The goal is to be able to tag images after were sent through the classify_image function of the prediction client, not during. Classify_image returns ImagePrediction objects with prediction IDs, and I need a way to tag that image using the prediction ID.
Asked
Active
Viewed 147 times
1 Answers
0
You can use "Query predictions" method from the "Training API" (not the prediction one) of Custom Vision.
See method documentation here: https://westeurope.dev.cognitive.microsoft.com/docs/services/Custom_Vision_Training_3.3/operations/5eb0bcc7548b571998fdded8
With this method, you can get the predictions realized on a specific iteration of a project (using time filtering also), then you can filter the results using the image ID because the response format is the following:
Use results "id" field to filter

Nicolas R
- 13,812
- 2
- 28
- 57
-
thanks for the comment. However, in the docs I see the "results" output are StoredImagePrediction objects, and the "id" is `:ivar id: Prediction Id.` not the Image ID. Also I'm assuming I don't know the Image ID beforehand, I'm trying to get the Image ID through the Prediction ID. Any other thoughts? – Evan Jul 28 '20 at 17:41
-
Sorry, I don't understand what you need in that case. if during classification you have prediction ID, which "image ID" do you want? – Nicolas R Jul 28 '20 at 18:46
-
basically, I'm automatically tagging the image based on the prediction with the highest probability. if that prediction was incorrect, i'd like to be able to change the tag of the already tagged image, and I assume in order to do that I need the image's ID. So all I have is the Prediction ID on hand and my assumption is that I don't directly know the image's ID. Sorry for any confusion – Evan Jul 29 '20 at 19:10