exadel-inc / CompreFace

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

When adding an example image to a subject, allow to specify and image name, tag or key, or to specify the image_id #1090

Closed calloatti closed 1 year ago

calloatti commented 1 year ago

Is your feature request related to a problem? Please describe.

I have 160K images of 250 subjects, I programatically select the best 5 images of each subject to upload as subject examples for face recognition.

When uploading an example, I get back and image_id. The problem is that if I upload the same image to two different compreface servers, I get a different image_id for the same image.

Since I keep track of uploaded examples in my own application, this kind of complicates things.

Describe the solution you'd like

One solution would be to be able to specify a name, tag or key when uploading an example that would be returned along with the subject and image_id when listing saved examples of a subject.

Describe alternatives you've considered

Another option would be to be able to specify the image_id when uploading an image example for a subject. This would be as simple as:

{{compreface_base_url}}/api/v1/recognition/faces?subject={{subject_name}}&det_prob_threshold={{det_prob_threshold}}&image_id={{image_id}}

Additional context Add any other context or screenshots about the feature request here.

pospielov commented 1 year ago

I created a story for this. But I can't promise that we will take it to work in the nearest future. Instead, I would like to know more about your use case. Probably, we can think of some kind of workaround. Just two ideas:

  1. You can create a subject for each example. And use naming like _. So when you receive the recognition result, you know that you can split it by the underscore symbol and receive the subject and tag. As you don't need to create a subject explicitly when you upload a new example - a new subject creates automatically so that you won't increase the number of requests. The drawback - I'm not sure how it will affect the performance, I think it shouldn't, but I don't have statistics. Also, working with images on UI will be extremely difficult.
  2. You can use one PostgreSQL for both CompreFace instances. I think if one of them uses it in read-only mode, there shouldn't be any problems. Of course, it can be impossible in your use case. This is why I need to know more about it.
calloatti commented 1 year ago

My use case is so I can have the same data on the production server and on the dev pc, the workaround I am using now is to use https://hub.docker.com/extensions/docker/volumes-backup-extension for the PostgreSQL volume. The MySQL I use on my side I just use mysql backup/restore

Not really a high priority feature anyway, but being able to assign image ids on the client side could be useful in other scenarios imho.