Trebs
Trebs

Reputation: 3

Clarifai Face detection response gives a 404 Error

I'm currently building a react app for face detection. I use the code below to implement the Clarifai Face Detection API but I get a 404 error instead of a response. Is my syntax wrong?

const Clarifai = require("clarifai");

const app = new Clarifai.App({
  apiKey: "my-api-key",
});

app.models
      .predict(
        "45fb9a671625463fa646c3523a3087d5",
        this.state.input
      )
      .then(
        function (response) {
          // do something with response
          console.log(response);
        },
        function (err) {
          // there was an error
        }
      );

Upvotes: 0

Views: 218

Answers (1)

Jeremy Faret
Jeremy Faret

Reputation: 326

At first, please use the updated gRPC Node client: https://www.npmjs.com/package/clarifai-nodejs-grpc

(Clarifai has deprecated the REST clients in 2020)

Let me know if that solved your issue.

Upvotes: 0

Related Questions