The course is part of these learning paths
Artificial Intelligence is not a future or distant concept; it is here and now, and being used by many companies of various sizes and industries. The foundational theory for AI was actually developed several decades ago, but recent advancements in big data, computing power, cloud, and algorithms have made it affordable and widespread today. With AI and Machine Learning, computers are now able to start reasoning, understanding, and interacting in ways that were never possible before.
Microsoft has created a predefined set of AI models available for companies of all sizes to start with called Cognitive Services, and best of all, they require little to no knowledge of data science. In this course, you will learn how to infuse your apps—on an architectural level—with the intelligence that Cognitive Services provide. We will cover what Cognitive Services are and how to use the various solutions they provide, including Vision, Speech, Language, Decision, and Web Search.
Learning Objectives
- Understand the functionality provided by Azure Cognitive Services
- Learn how to incorporate these services into your apps
Intended Audience
- People who want to learn more about Azure Cognitive Services
Prerequisites
- Knowledge of Azure
- Knowledge of at least one programming language
- Experience using REST APIs
In the previous demo, we have created this Computer Vision resource, as you can see here in the portal. I now want to test this API, and for that I'll use a tool called Postman. What is great about Postman is that you can play with your APIs without necessarily having the overhead of creating and compiling code.
To save time, I have already created a POST request, so let me describe that for you. Here on the top, you can see that the address starts with cacv.cognitiveservices.azure.com. Where did I get this from? Well, if I switch here to the Azure Portal, here's the endpoint for the resource I created on the last demo.
Also, see this key here on the page? I'm actually also using that on my Postman request. I'll show you that in a moment.
Switching back to Postman, you see that the URL also has /vision/v2.1/analyze, and then a bunch of parameters in my request. How did I know what to put here? Well, if you remember from the last demo, I have shown you this API documentation page. All the information I need to construct this request is right here.
Back to Postman, notice that the params tab has the same keys on the URL, so I can use either option to build these parameters. Now switching to the headers section, this Ocp-Apmi-Subscription-Key is the one holding the key I've shown you from the Azure Portal. The content type of JSON means that I'm passing my image URL as a JSON file.
Going into body, the JSON file I have just mentioned has a link to a picture of Mona Lisa. Let's click on Send and see what happens.
Looking at the results, I can see that it generated a lot of information about this picture. Note the tags: art, human face, gallery, museum, indoor, woman, painting. But the best part, though, is the description: a painting of Mona Lisa, who by the way, appears to be 30 years old, amazing, huh?
Next, I want to show you the Face API. I could use Postman as well, but I want to show you a new trick. Most of Microsoft's Cognitive Services have a landing page where you can test the product. So, on the Face API home page, I'll click demo, and I can play with the technology from here.
I'll select detection_01, which gives far more information. It detects the location of the face, that she has brown hair, that she is a 24-year-old female, wearing glasses and makeup, and clearly happy. Also, notice these face landmarks here, that can be used later on to identify her.
Switching on the top to Face Verification, you see that it identified that these two pictures belong to the same person, with 93% confidence, even though his face on the pictures are on different angles.
Finally, switching to the Perceived Emotion tab, let me select the picture of this boy, which is clearly surprised, but a little happy as well - perhaps he got what he wanted for Christmas!
As I mentioned before, because there are so many Cognitive Services, I won't be able to show you each one of them individually, or in detail. But remember the parrots and cockatoos model I have described? Well, here on the Custom Vision portal, I have created a model and uploaded 10 pictures: five of cockatoos, five of parrots, and then I trained the model. Now if I come here to predictions and add a picture of a few cockatoos hanging out in a park, here's my prediction, with 99.9% certainty that these are cockatoos. Trust me, I actually spent more time getting these 10 images from the internet than creating and training this model.
Emilio Melo has been involved in IT projects in over 15 countries, with roles ranging across support, consultancy, teaching, project and department management, and sales—mostly focused on Microsoft software. After 15 years of on-premises experience in infrastructure, data, and collaboration, he became fascinated by Cloud technologies and the incredible transformation potential it brings. His passion outside work is to travel and discover the wonderful things this world has to offer.