0

I'll be thankful if you can assist me on an issue with Clarifai API.

I made a simple application of Face Detection using the API. I've followed the documentation and from my client I ran the following code snippet:

app.models
  .predict(Clarifai.FACE_DETECT_MODEL, this.state.input)
  .then((response) => setImageBox(this.calculateBox(response)))
  .catch((err) => {
    console.log("Clarifai Error:", err);
  });

It used to work until 2 days ago. Now I get an error. Chrome Dev Tool shows me on the Network->Headers tab:

Request URL: https://api.clarifai.com/v2/models/a403429f2ddf4b49b307e318f00e528b/outputs Request Method: POST Status Code: 404 Not Found Remote Address: 54.208.138.170:443 Referrer Policy: no-referrer-when-downgrade

On the Network-> Response tab I get this error object:

{ "status":{ "code":21200, "description":"Model does not exist", "details":"A model with ID 'a403429f2ddf4b49b307e318f00e528b' not found. Check the url of your request.", "req_id":"2fc7d5ed414a48eead697d9bdcf187b7" }, "outputs":[] }

I even tried to reinstall the Clarifai NPM package but nothing has changed. When I looked the value of Clarifai.FACE_DETECT_MODEL it's indeed the ID of a403429f2ddf4b49b307e318f00e528b but the Clarifai servers don't recognize it.

Is it a bug of the Clarifai API?

How this issue can be solved?

Thanks, Eli

Eli Van Rock
  • 157
  • 1
  • 1
  • 15

2 Answers2

2

The issue was solved when I used the perdict function By Model Version ID.

Therefore the code snippet is the following:

app.models
  .predict(
    {
      id: "a403429f2ddf4b49b307e318f00e528b",
      version: "34ce21a40cc24b6b96ffee54aabff139",
    },
    this.state.input
  )
  .then((response) => setImageBox(this.calculateBox(response)))
  .catch((err) => {
    console.log("Clarifai Error:", err);
  });

I would like to thank the Clarifai support team for solving this issue.

Keep Safe!

Eli Van Rock
  • 157
  • 1
  • 1
  • 15
1

Clarifai Support here!

I apologize for the inconvenience. There was an error that happened on our side. We have resolved that issue and the model should be working fine. Please let us know if you are still receiving this error.

If you are still getting the error, please try using this model_id to get the face model and it should resolve the issue.

model_id= 'a403429f2ddf4b49b307e318f00e528b'

Best Regards, Clarifai Team

  • Thanks for your quick reply. I've tried again several times and I used the given model_id but still it gives the same error. – Eli Van Rock Jun 22 '20 at 16:00
  • 1
    Could you try calling the model by the model_id and version_id. The model id would be a403429f2ddf4b49b307e318f00e528b and the version id would be 34ce21a40cc24b6b96ffee54aabff139. You can see how to make a call with these parameters in JS in the following documentation. https://docs.clarifai.com/api-guide/predict/prediction-parameters#by-model-version-id – Clarifai Support Jun 22 '20 at 21:23
  • I used this solution and everything works as expected! Thank you very much and keep safe! – Eli Van Rock Jun 22 '20 at 21:47
  • 1
    Great. Glad that we could help – Clarifai Support Jun 22 '20 at 22:43