We run the project in this video. Learn how the Vision API can recognize the details of a submitted image.
- [Instructor] Now let's go ahead and run this project. Basically, what I intend to do now is that I intend to call analyzeImage, pass in a file name, and then hopefully if everything is read properly, it should call this function here and it should tell me whether it's an error or success. I would like you to notice that I have a typo here. You'll see that the typo is actually caught by the API and I want to show you how the error message looks like.
I'm going to need some images to try this out. Luckily, I have couple of images here. One is a dog, second is a sunset. I'm going to drop them in the source folder. You're welcome to use these images but I encourage you to try it with really any image. Let's try the dog image first. Let's go in here and I'm going to go ahead with this typo, set a break point here, and call analyzeImage dog.jpg and hit F5.
You see that the break point does get hit but if I hover over body, it says specified feature type is not valid. Okay, we need to fix that typo. As you notice here, we show features. Feature type is not valid, let's fix this. Let's call it description. Let's go ahead and run it one more time. This time around, it is actually able to recognize the picture nicely. Look at all the information it give us. Let's hit F10.
Let's look at all the information it returned us. It says tags, grass, dog, outdoor, looking, sitting, car, brown, small, white. Imagine if you have an image library and you want to tag that image meaningfully. This is amazing, captions, text. A dog looking at the camera. It even gives you a confidence score so the service is 93.625% sure that this is indeed a dog looking at the camera.
Adds things like metadata, height, width, format. The dominant color, just think of this. If you had a huge image library that you're trying to make sense of, what could this service add as value to that image library? This is truly amazing. Let's try it with another picture. Notice that I have another picture here, the sunset.jpg, so this is the sunset picture. This is how it looks like, let's try this out as well, sunset.jpg.
Just go up here in your code and change dog.jpg to sunset.jpg. Let's go ahead and run this again. Again, the services analyzes my picture. Categories, name, abstract. Sky, cloud, the tags are water, nature, plane, sunset, man, ocean, airplane, wave, beach. This is amazing.
Text, a sunset over a body of water. Confidence, 78.8%, you'd almost think that there's a person on the other end looking at these pictures, but it's a service, it's a web service. This is truly amazing.
- Exploring the possibilities of the Vision API
- Submitting an image to the Vision API for processing
- Asking the Vision API to recognize faces
- Working with the Speech API
- Writing speech-to-text code
- Working with the Language API
- Getting languages for translation
- Language Understanding (LUIS) concepts