exadel-inc / CompreFace

Leading free and open-source face recognition system
https://exadel.com/accelerator-showcase/compreface/
Apache License 2.0
5.51k stars 754 forks source link

{ "message" : "Required part file is missing", "code" : 34 } #997

Open vmajor opened 1 year ago

vmajor commented 1 year ago

Describe the bug When attempting to make a curl request in terminal I get the following response:

{
  "message" : "Required part file is missing",
  "code" : 34
}

To Reproduce Steps to reproduce the behavior:

run this in a terminal:

curl -X POST http://localhost:8000/api/v1/recognition/recognize -H "x-api-key: 6b9cca31-a5fe-xxxx-xxxx-6373513a1f83" -H "Content-Type: multipart/form-data" -F file=person_1.jpg

What am I doing wrong? I am trying to implement this API call in Python and am getting a 400 instead of a 200 and a result.

vmajor commented 1 year ago

Let me try to do this a bit better.... perhaps by following the specs

vmajor commented 1 year ago

Nope.

Setting all options still produces the same error:

curl  -X POST "http://localhost:8000/api/v1/recognition/recognize?limit=0&predictio
n_count=1&det_prob_threshold=0.8&face_plugins=&status=true" -H "x-api-key: 6b9cca31-xxxx-xxxx-xxxx-6373513a1f83" -H "Content-Type: multipart/form-data" -F file=person_1.jpg
vmajor commented 1 year ago

Never mind, I got it to work by changing the implementation to pycurl. I could not get requests to work and even the reference python snippets were returning an error, "Something went wrong".

pospielov commented 1 year ago

The easiest way to reproduce it in CURL is to make a request using UI in Google Chrome, then open the network panel, find the request, click the right button on it and find there something like "copy CURL" There will be lots of extra lines, but you can clean it as soon as you reproduce

SOHUMKABRA commented 1 year ago

Is there any solution to these issue

pospielov commented 1 year ago

There is no issue on CompreFace side. You should be able to send requests to CompreFace using CURL https://documenter.getpostman.com/view/17578263/UUxzAnde#209ebff0-4995-4f6e-b27b-08872b49123b You can also try to see the example in Postman documentation

snolentinque commented 1 year ago

Describe the bug When attempting to make a curl request in terminal I get the following response:

{
  "message" : "Required part file is missing",
  "code" : 34
}

To Reproduce Steps to reproduce the behavior:

run this in a terminal:

curl -X POST http://localhost:8000/api/v1/recognition/recognize -H "x-api-key: 6b9cca31-a5fe-xxxx-xxxx-6373513a1f83" -H "Content-Type: multipart/form-data" -F file=person_1.jpg

What am I doing wrong? I am trying to implement this API call in Python and am getting a 400 instead of a 200 and a result.

I had the same issue. Try pass your filename with @, for example:

file=@person_1.jpg