To use a Clarifai's pre-built model, you need 2 things:
- The model_id
- Your API credentials (Personal Access Token)
How do I find the model_id?
How do I find my PAT?
Example use case:
- I want to use the general classification model to predict an image containing a dog: https://www.clarifai.com/models/image-recognition-ai
1. I find the model_id for the general model by searching "general" via the portal's model mode
2. I go over to https://docs.clarifai.com/api-guide/api-overview/api-clients and grab one of the API clients. I choose Python:
3. I go ahead and copy-paste the prediction code snippet I found here: https://docs.clarifai.com/api-guide/predict/images and complete the snippet with the image_url of a dog and the infos I grabbed in step 1 and at the beginning of this tutorial:
4. Run the code
Note: You can replace any of this step with any PAT or any model_id. This specific process works for calling Models only. To call Workflows, you will need to slightly modify the code snippet: https://docs.clarifai.com/api-guide/workflows/common-workflows/workflow-predict