In Azure Custom Vision, when you're working with code that interacts with a model you've trained, you'll often need to specify the model's ID so the code knows which model to use for predictions. The model_id = "YOUR_MODEL_ID" line is where you need to insert the specific ID of the model you want to work with.
Here's a step-by-step guide on how you can find your model's ID in Azure Custom Vision:
-
Log in to the Azure Portal: Go to the Azure portal and sign in with your credentials.
-
Access Custom Vision: Once logged in, navigate to the Custom Vision service. You can find this by either searching for "Custom Vision" in the search bar or locating it within your list of resources if you've already created a Custom Vision resource.
-
Open Your Project: In the Custom Vision portal, open the project that contains the model you want to use.
-
Go to the Performance Tab: Inside your project, navigate to the "Performance" tab. This section shows you all the iterations (versions) of your trained models.
-
Find Your Model's ID: Each iteration will have its own unique ID. This ID is typically not displayed directly on the interface, but you can find it as part of the URL when you select an iteration, or by using the API to list all iterations and their details.
-
Using the API to Get the Model ID: If you prefer to use the Custom Vision API to get your model's ID, you can use the "Get Iterations" API call. This will return a list of iterations for your project, including their names, IDs, and other details. The API documentation provides detailed instructions on how to make this call.
-
Insert the Model ID into Your Code: Once you've located your model's ID, you replace "YOUR_MODEL_ID" in the code with the actual ID. Make sure to keep the quotation marks. For example, if your model ID is abcd1234, you would change the line to model_id = "abcd1234".
Remember, the model ID is specific to an iteration of your model. If you re-train your model and create a new iteration, the ID will change, and you'll need to update your code to use the new ID if you want to use the updated model for predictions.
If you're having trouble finding the ID or if the Azure Custom Vision interface has changed, I recommend checking the official Azure Custom Vision documentation or the help section for the most current information.