Clarifai
is not a class in that repository... https://github.com/Clarifai/clarifai-java
AFAIK, you need to use create a ClarifaiBuilder
, then call build()
on that, and then you can call getDefaultModels()
From the unit tests.
@NotNull final ClarifaiClient client = new ClarifaiBuilder(appID, appSecret)
.baseURL(baseURL)
.client(new OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.addInterceptor(new HttpLoggingInterceptor(System.out::println).setLevel(HttpLoggingInterceptor.Level.BODY))
.build()
)
.buildSync();
...
@Test public void quickStartPredict() {
final ClarifaiResponse<List<ClarifaiOutput<Concept>>> predictionResults =
client.getDefaultModels().generalModel() // You can also do client.getModelByID("id") to get custom models
.predict()
.withInputs(
ClarifaiInput.forImage(ClarifaiImage.of("@@sampleTrain"))
)
.executeSync();
}