AI On Azure Custom Vision and Cognitive Services
AI On Azure Custom Vision and Cognitive Services
• Custom Vision: A dedicated resource for the custom vision service, which can be training,
a prediction, or both resources.
• Cognitive Services: A general cognitive services resource that includes Custom Vision
along with many other cognitive services. You can use this type of resource for training,
prediction, or both.
Model training
To train a classification model, you must upload images to your
training resource and label them with the appropriate class labels.
Model evaluation
Model training process is an iterative process in which the Custom
Vision service repeatedly trains the model using some of the data,
but holds some back to evaluate the model.
• Precision: What percentage of the class predictions made by the model were correct? For example,
if the model predicted that 10 images are oranges, of which eight were actually oranges, then the
precision is 0.8 (80%).
• Recall: What percentage of class predictions did the model correctly identify? For example, if there
are 10 images of apples, and the model found 7 of them, then the recall is 0.7 (70%).
• Average Precision (AP): An overall metric that takes into account both precision and recall).
Using the model for prediction
After you've trained the model, and you're satisfied with its
evaluated performance, you can publish the model to your
prediction resource.
• Project ID: The unique ID of the Custom Vision project you created to train the model.
• Model name: The name you assigned to the model during publishing.
• Prediction endpoint: The HTTP address of the endpoints for the prediction resource to which you
published the model (not the training resource).
• Prediction key: The authentication key for the prediction resource to which you published the model
(not the training resource).
Demo
Classify Cats and Dogs
Knowledge check
You plan to use the Custom Vision service to train an image
classification model. You want to create a resource that can only
be used for model training, and not for prediction. Which kind of
resource should you create in your Azure subscription?
A. Custom Vision
A. Custom Vision
Type the answer in the chat C. Add more images to the training set.
You train an image classification model that achieves less
than satisfactory evaluation metrics. How might you improve
it?
Codespaces
Flask fundamentals
Flask fundamentals
Flask is an open-source web "micro-framework".
Responding to user requests with routes
When a user uses a web application, they indicate what they want to
do, or the information they're seeking, by browsing to different
uniform resource locators (or URLs).
• https://adventure-works.com/ for the main page
• https://adventure-works.com/products/widget for details on a Widget
• https://adventure-works.com/cart/buy to complete a purchase
Methods or verbs
Routes can be accessed in many ways, through what are known as
methods or verbs (the two terms mean the same thing and can be
used interchangeably).
HTML
Vote at <LINK>
Flask is a framework for building web apps in which of the
following languages?
Vote at <LINK>
Exercise
Create an app
Create core application
Add the route
Create an app Create the HTML template for our form
Test the application
Knowledge check
What is the default port number that Flask uses to service
HTTP requests?
A. 80
B. 5000
Question 2 C. 8080
Vote at <LINK>
What is the default port number that Flask uses to service
HTTP requests?
A. 80
B. 5000
Question 2 C. 8080
Vote at <LINK>
Translation
Translation
While solutions using machine learning or artificial intelligence have
become increasingly common, they can still be difficult to create
from scratch.
Translator service
Translator service, part of Cognitive Services, will translate to and
from dozens of languages.
Key management
To call Translator service (or any other Cognitive Service), we'll need
a key.
Exercise
Create Translator service
Create Get Translator service key
A. Ocp-Apim-Cognitive-Key
B. Ocp-Apim-Subscription-Key
Question 4 C. Ocp-Apim-Auth-Key
Vote at <LINK>
What is the name of the HTTP header that carries API keys in
calls to Azure Cognitive Services?
A. Ocp-Apim-Cognitive-Key
B. Ocp-Apim-Subscription-Key
Question 4 C. Ocp-Apim-Auth-Key
Vote at <LINK>
Summary
Summary
In this module, you learned the core concepts of building websites in
Python by using the Flask framework.
@bethanyjep
Thank you.