Registering faces

Hello,

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
/Magnus

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: https://imgur.com/a/v2o2FCp

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
{"success":true,"predictions":[{"confidence":1,"userid":"Test","y_min":101,"x_min":152,"y_max":283,"x_max":278}]}

% 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
{"success":true,"predictions":[{"confidence":1,"userid":"Test","y_min":99,"x_min":150,"y_max":230,"x_max":248}]}

% Test Person A again
$ curl -X POST -F "image=@Person_A.bmp" deepstack/v1/vision/face/recognize
{"success":true,"predictions":[{"confidence":0,"userid":"unknown","y_min":101,"x_min":152,"y_max":283,"x_max":278}]}

Is that by design?

1 Like

Please refer to this post.

Hello,
I’m new at Deepstack.
I looked at your screenshot and trying to figure out how you got the deepstack ui?

@7thstorm Are you referring to the DeepStack UI project by @robmarkcole ?

You might want to checkout the GitHub repo linked below.

robmarkcole/deepstack-ui: UI for working with Deepstack (github.com)

2 Likes

Thanks a lot.
I am wondering if you would be so kind enough to assist with the issue I’m having.

I have confirmed that Deepstack gpu is running. I was able to list and register some faces.
next, I tried to install deepstack-ui by following the instructions on github:

sudo docker pull robmarkcole/deepstack-ui:latest

and verified it by listing all docker images

image

However, when I try to run it, I’m running into issues

sudo docker run -p 8501:8501 -e DEEPSTACK_IP='localhost' deepstack-ui

output:
Unable to find image 'deepstack-ui:latest' locally
docker: Error response from daemon: pull access denied for deepstack-ui, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

Not sure what I’m doing wrong? I’m running this command from my home directory. I tried with the docker IP as well as the system ip
appreciate any feedback

OK, apparently I solved this one.
Unlike some other docker containers, this one required the full name to run.

so instead of:
sudo docker run -p 8501:8501 -e DEEPSTACK_IP='localhost' -e DEEPSTACK_PORT=xxx deepstack-ui

I had to do:
sudo docker run -p 8501:8501 -e DEEPSTACK_IP='localhost' -e DEEPSTACK_PORT=xxx robmarkcole/deepstack-ui

Hope this is helpful to someone else