Registering faces


and thanks for a very good piece code.

Now to my question.
Is it possible and better for face recognition to register more than one face for one person.
In short, how do I optimize deepstack for recognizing at its best??

Best regards

You are able to upload more than one image at a time which is shown in the examples somewhere.

My question about that is that the “documentation” shows uploading each one using form fields “image1”, “image2”, etc. Do you have to use one form field per image, or can you upload multiple images in the same form field? I have been using postman and it accepts multiple images using the “image” field, but I am unsure if it is actually processing them or not.

The second question that looks like it would help both of us… Do you have to upload all the images for a person every time, or can you just keep adding one image at a time to further train it for a person?

1 Like

Ok. I did a little more testing. It looks like doing a single multi-select file upload only looks at the first file in the array of files uploaded. Having a bunch of fields named “image” with a single file in each results in the same thing. If you want to register more than one face when training, you have to follow the example and upload one file per form field and use numbered fields (image1, image2, image3…).

It also seems that you must upload all the images at once when training. If you train it using 10 images, then later upload 1 image for that userid, it only remembers that one image and forgets the previous 10. Just be careful uploading a bunch of images, I locked up the VM that was running DeepStack container.

I figured both of these out by both judging the time it takes to process the upload, and by throwing a picture at it afterwards. So this info may be incorrect, but this is what my tests revealed.

Pictures of how I trained it:

Can anyone confirm what @vrelk wrote about registering faces? Is that the case that deepstack only remembers the latest picture(s) registered for a given user?

I can confirm @vrelk finding. Here’s the test:

% Teach & Test Person A
$ curl -F "image=@Person_A.bmp" -F "userid=Test" deepstack/v1/vision/face/register
{"success":true,"message":"face added"}
$ curl -X POST -F "image=@Person_A.bmp" deepstack/v1/vision/face/recognize

% Teach & Test Person B
$ curl -F "image=@Person_B.bmp" -F "userid=Test" deepstack/v1/vision/face/register
{"success":true,"message":"face updated"}
$ curl -X POST -F "image=@Person_B.bmp" deepstack/v1/vision/face/recognize

% Test Person A again
$ curl -X POST -F "image=@Person_A.bmp" deepstack/v1/vision/face/recognize

Is that by design?