Hey, everybody, so we just saw the power of the Clarify API.
It's pretty exciting, isn't it?
Some really, really cool functionality and lots of possibilities now because I want to make sure that
everybody gets through this course and you're able to successfully finish the app, deploy the app and
show it off on your portfolio.
I've made this video to just show you some of the common issues people might have.
Also some of the power that you now have with clarify.
So let's go through it.
One is that I'm going to provide code for you at the end of each of the sections that are coming up
as we build our Smart Brain app into more and more complex things with the back end, with the database,
I'm going to provide code that you can always come back to.
Let's say you are unable to code along or you don't know why your app isn't working.
There's going to be different versions of the app.
Obviously, this is going to be the first version that I'm going to link to at the end of this section.
So one is the front end, which is called face recognition brain, at least for now.
And then the next one is the face recognition brain API, which is the back end that we're going to
build in later sections.
But let me show you how things would work.
Let's say we cloned both of these repos and they both have read me to show you how to get started again.
Don't worry, because the API we're going to work on in later section and the front end, we still have
a little bit to go.
The one thing that you want to make sure is that you grab your own clarify API key.
So clarify, although the website might change, is still going to have the same functionality.
You're going to have to sign up if you don't have an account or you can just log in and once you log
in, it's going to take you to their dashboard.
Now, in my case, I already have an application built, but otherwise you can just click on create
application and once you do that, it's going to ask you to put in the name some details.
And then from there, you'll have this dashboard.
Now, all we have to do is just click on Create New APIC, you can leave all the check boxes checked
and just create an API key from here.
This is your API key that you can use.
So you just copy it.
You added into the.
Source app, dodgiest file.
And you'll see here that I left it.
For you to enter, it says your API key here.
So you're going to replace that string with the API key.
And you should be good to go, at least for now.
Let's look at the map, so I'm just going to start the server and the front end.
Don't worry, this part you haven't done yet, but I just want to debug the app with you just so you
can see some of the common mistakes that people have.
So I'm just going to sign in with an account that I've already created for this app.
You see that I remember remembers my name, one thing is that Chrome has a new security feature.
But again, this is our app that we're just starting off with, so you can just click, OK, if you
get that prompt, not a big deal.
And I have an image here, which is Tom Hanks.
Let's copy that, making sure that we always copy a JPEG image, not a format that our app won't understand.
So it's always a good idea to do a jpeg, an actual link to an image like this.
And if I paste this in and I detect.
Look at that, it detects the face and it puts a box around the face, very, very cool.
Now, the cool thing with clarify is that, well, it's got multiple models that we can use in our case,
we're using the face detection model.
Now, when we use an API, sometimes a server goes down or an API doesn't work, especially since we're
using the free version.
So a good way to check if the API is working is to go to a link.
I'll provide for you after this lecture where it actually checks the face detection model so you can
actually see that the face detection model here is working for them.
If it's not working well, then this blue box wouldn't appear on this website.
So this is a good way to try and make sure that their model works.
You can also go to their documentation, so this is what we're going to be using.
We're going to be using the predict images and we go to the JavaScript tab to actually learn about the
clarify models in the future.
We can even do videos if we want, predicting whatever video information we feed it.
And also this model gallery to show you that there's different things that we can do.
We have celebrity model.
We have apparel model.
We have color model.
So there's a lot of cool things that we can do.
Such as the general model with our app.
Now, the reason I'm showing you this is because sometimes a model might be working, might not be working,
and I already shows you how to test if a model is working, but if you're getting any errors.
I've provided a little rehme for you, especially when we call the clarify phase detect model, so another
option is to use this piece of string.
I've added comments here for you to decide so I could actually change this from clarify face to tech
model to a string.
And if the clarify face model isn't working, this should still work.
So let me sign in again.
Let's grab Tom Hanks.
Face again.
And you see that that is working as well.
So that is another option in case the clarify model is a working.
Or maybe you want to expand your app once you're done with the course and don't worry, you'll get there.
You can try different models that they have.
So remember, there's different types of face to tech models or different types of models that they
have.
So let's say we do the general model.
And in here, let's just consider the response or say console log, hey, let's see what kind of response
we get with a general model.
So, again, I'm going to go back in to our app.
Grab our good old friend, Tom Hanks.
Pieces in here, I'm going to open up the developer console to see what we get and I had detect.
All right, we don't have to worry about this error, it's the error is because we're not using the
face detect model, so it doesn't understand how to put the box around it.
But because we're using the general model.
Check this out.
If we now go to Output's Zero and data, this is the data that the general model returns for us.
And check this out.
This is really cool.
It returns for us, concepts and concepts are look at that, it understands the picture or at least
the model does it, saying the picture is of tag people, it's 90 percent confident of a politician.
Ninety seven percent confidence of a portrait of a one man, of a business of administration.
It's a press conference, banking.
So kind of cool it understands the picture.
So by just changing the model, I was able to learn new information about the picture.
So after this course, if you want to explore and do something other than face, detect maybe an app
that describes what the picture is and displays it, that's another cool option.
So, again, the reason I am showing you this is that there's a lot of cool things that you can do with
clarify.
The reason I've used it for this course is because it allows all of you to build different apps that
don't just look the same for everyone.
So hopefully this gets you excited.
And I'll link to a bunch of resources for you to check out that.
Once you're done with the app, you're done with the course, you're going to have different ways to
customize everything.
All right, that's a lot of talk for me.
I'll see you in the next one.
Bye bye.