Prediction parameters
Select Concepts
app.models.predict(Clarifai.GENERAL_MODEL, 'https://samples.clarifai.com/metro-north.jpg', {
selectConcepts: [
{name: 'train'},
{id: 'ai_6kTjGfF6'}
]
})from clarifai.rest import ClarifaiApp, Concept
app = ClarifaiApp(api_key='YOUR_API_KEY')
model = app.models.get('general-v1.3')
select_concept_list = [Concept(concept_name='train'), Concept(concept_id='ai_6kTjGfF6')]
model.predict_by_url(url='https://samples.clarifai.com/metro-north.jpg', select_concepts=select_concept_list)client.predict(client.getDefaultModels().generalModel().id())
.withInputs(ClarifaiInput.forImage("https://samples.clarifai.com/metro-north.jpg"))
.selectConcepts(Concept.forID("dog"), Concept.forID("cat"))
.executeSync();using System.Collections.Generic;
using System.Threading.Tasks;
using Clarifai.API;
using Clarifai.DTOs.Inputs;
using Clarifai.DTOs.Predictions;
namespace YourNamespace
{
public class YourClassName
{
public static async Task Main()
{
var client = new ClarifaiClient("YOUR_API_KEY");
await client.Predict<Concept>(
client.PublicModels.GeneralModel.ModelID,
new ClarifaiURLImage("https://samples.clarifai.com/metro-north.jpg"),
selectConcepts: new List<Concept>
{
new Concept(id: "", name: "dog"),
new Concept(id: "", name: "cat")
})
.ExecuteAsync();
}
}
}{
"status": {
"code": 10000,
"description": "Ok"
},
"outputs": [
{
"id": "c8abf5cbe52746efa9df8a2319d49d0a",
"status": {
"code": 10000,
"description": "Ok"
},
"created_at": "2017-06-27T13:31:57.493797045Z",
"model": {
"id": "aaa03c23b3724a16a56b629203edc62c",
"name": "general-v1.3",
"created_at": "2016-03-09T17:11:39.608845Z",
"app_id": "main",
"output_info": {
"message": "Show output_info with: GET /models/{model_id}/output_info",
"type": "concept",
"type_ext": "concept"
},
"model_version": {
"id": "aa9ca48295b37401f8af92ad1af0d91d",
"created_at": "2016-07-13T01:19:12.147644Z",
"status": {
"code": 21100,
"description": "Model trained successfully"
}
}
},
"input": {
"id": "c613b3254da34382b2fca65365da7c49",
"data": {
"image": {
"url": "https://samples.clarifai.com/metro-north.jpg"
}
}
},
"data": {
"concepts": [
{
"id": "ai_HLmqFqBf",
"name": "train",
"value": 0.9989112,
"app_id": "main"
},
{
"id": "ai_6kTjGfF6",
"name": "station",
"value": 0.992573,
"app_id": "main"
}
]
}
}
]
}Maximum Concepts
Minimum Prediction Value
By Model Version ID
Last updated
Was this helpful?