exadel-inc / CompreFace

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

Can we install Compreface on Google cloud run ? #1089

Open ersaurabh101 opened 1 year ago

ersaurabh101 commented 1 year ago

Hii,

I want to install compreface on Google cloud run. Can we get a tutorial on the same.

or on any other container / docker platform like aws fargate, please guide. We dont want to host it on EC2 instance and involve a fixed cost

pospielov commented 1 year ago

CompreFace can be easily installed on the cloud. But I don't see how it can be used with a service like AWS Fargate, because CompreFace needs to store data somewhere and AWS Fargate doesn't allow it. So there are three ideas of how you can approach it, and none of them is good:

  1. The most proper way is to make a Kubernetes configuration that can scale a number of instances to zero. You can use our Kubernetes configuration as a base and add Knative here. Of course, it will require DevOps skills. Also, not sure if it will cost less than an EC2 instance, as you'll need to pay for a Kubernetes cluster even if there are no nodes.
  2. You can host DB on a separate instance and then use CompreFace single docker container in AWS Fargate. But it just means you need to pay constantly for DB
  3. As you don't expect a lot of requests, you can just use AWS Rekognition service, as it has a free tier of 5,000 images. CompreFace is very cost-effective if you have a lot of requests, but not so effective if you have like 10k images per month.
luicfrr commented 1 year ago

Hi,

I also want to install CompreFace on Google Cloud Run but as you said:

CompreFace needs to store data somewhere and AWS Fargate doesn't allow it

As far as I know, Cloud runs doesn't have any storage too and it clears any stored data after instance shut down and I think this leads to two problems wich are also my doubts about compatibility with my project:

1 - facial data and subject storaging 2 - project settings, api keys, user managements, etc...

Can we use CompreFace with firestore database or google storage to keep these data? Can you please provide a simple guide to usage with Google cloud services?

Thanks for the help

pospielov commented 1 year ago

CompreFace can store data only in PostgreSQL database now. So basically, you have the exact challenge as ersaurabh101 And the same approaches are applicable as I described in the previous answer, but, unfortunately, they are not ideal.

ersaurabh101 commented 1 year ago

I am using Microsoft cognitive facial recognition. I am getting 50$ bill average per month. Its better to go with compre any day. I need a tutorial as how to install compre face in a single docker image on AWS fargate and how much do we need to pay for DB instance. A quick and good tutorial will be really help @pospielov

luicfrr commented 1 year ago

I've ended using Google Cloud Functions with face-api firestore to store facial recognition

ersaurabh101 commented 1 year ago

We also did the same. How did you manage to crop only the face area and remove rest of image ? We are using webcam to capture face and we are trying to implement 1 is to 1 instead of 1 isto n, because i think face api on google functions may not be as accurate as compre face on a proper system. Can we connect on whatsapp for personal chat to share experience with each other +919216142737