exadel-inc / CompreFace

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

Error Trying To Reinstall #925

Open LordNex opened 2 years ago

LordNex commented 2 years ago

Describe the bug Before the upgrade to 1.1.0 everything worked fine. When I did the upgrade, I received a error starting it could not be downloaded. Reboots had no effect. I uninstalled it all together and now when I try and do an install again I get


Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

To Reproduce Steps to reproduce the behavior:

Unsure, try and upgrade and the uninstall and reinstall

Expected behavior Normal upgrade

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Mainly the iOS app on iOS 16

Additional context Add any other context about the problem here.

LordNex commented 2 years ago

Error from Supervisor Log


22-10-22 06:17:57 ERROR (SyncWorker_11) [supervisor.docker.addon] Can't build c7657554/amd64-addon-compreface:1.1.0: Head "https://registry-1.docker.io/v2/exadel/compreface/manifests/1.1.0": Get "https://auth.docker.io/token?scope=repository%3Aexadel%2Fcompreface%3Apull&service=registry.docker.io": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
22-10-22 06:17:57 ERROR (SyncWorker_11) [supervisor.docker.addon] Build log: 
Step 1/12 : FROM exadel/compreface:1.1.0
LordNex commented 2 years ago

Resolved through long convoluted process. But it's back and at the latest version.

Question, if using this in Home Assistant as an add on with HA being ran inside VMWare ESXi 7, is there a way to setup CompreFace to work with a USB Google TPU?

pospielov commented 2 years ago

It looks like you have a problem with the connection to DockerHub. Here is a thread with a discussion of how to solve it: https://forums.docker.com/t/docker-pull-results-in-request-canceled-while-waiting-for-connection-client-timeout-exceeded-while-awaiting-headers/73064 In short, it may be a problem with DNS or proxy.

is there a way to setup CompreFace to work with a USB Google TPU?

Google Coral doesn't support Tensorflow or MXNet libraries that CompreFace uses. So to support it, we need to rewrite all compreface-core services. And we need somebody who has Google Coral. Once, we had such a contributor, but she didn't finish it.

LordNex commented 2 years ago

I'll give that a try because doing a restore to 1.0.0 and then upgrading fails too with the following


Head "https://registry-1.docker.io/v2/exadel/compreface/manifests/1.1.0": Get "https://auth.docker.io/token?scope=repository%3Aexadel%2Fcompreface%3Apull&service=registry.docker.io": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

As far as the coral, I'd be happy to help. I've been trying to learn programming for some time and have some of the concepts down. Given I've been in the IT field professionally for 25+ years. But I don't know how much I could lend to the programming aspect of it. But I'd be happy to test code or I also have a Jetson Nano that's not currently in use. That would be a CUDA TensortFlow Lite I believe. But I could be wrong.

LordNex commented 2 years ago

It looks like you have a problem with the connection to DockerHub. Here is a thread with a discussion of how to solve it:

https://forums.docker.com/t/docker-pull-results-in-request-canceled-while-waiting-for-connection-client-timeout-exceeded-while-awaiting-headers/73064

In short, it may be a problem with DNS or proxy.

is there a way to setup CompreFace to work with a USB Google TPU?

Google Coral doesn't support Tensorflow or MXNet libraries that CompreFace uses. So to support it, we need to rewrite all compreface-core services. And we need somebody who has Google Coral. Once, we had such a contributor, but she didn't finish it.

Also, this is the OVA VMWare Install of HA with the addin installed. I'm not sure if I should change its underlying os. I guess I could sling up a separate copy of Ubuntu on my ESXi server, but it functioned perfectly until the update.which is what I don't understand. Additionally. I haven't had any problems installing other third part add ons from docker. I'm using this in the package that pulls down from DoubleTake so I don't know if that changes anything.

pospielov commented 2 years ago

Are you able to run docker commands on this machine? If yes, try to pull a simple image: docker pull hello-world and then, if it is successful, try to pull CompreFace images: docker pull exadel/compreface-admin:1.1.0 docker pull exadel/compreface-fe:1.1.0 docker pull exadel/compreface-core:1.1.0 docker pull exadel/compreface-api:1.1.0 docker pull exadel/compreface-postgres-db:1.1.0

Regarding Coral, you can start with this pull request: https://github.com/exadel-inc/CompreFace/pull/580/files There are two files: tpu.Dockerfile and tpu.Dockerfile.full can help you build CompreFace with Coral support. I didn't test it, but if you succeed, you can merge the master branch to this one and try how it will work with new changes. After this, we will be able to merge it into the master.

LordNex commented 2 years ago

Are you able to run docker commands on this machine?

If yes, try to pull a simple image:

docker pull hello-world

and then, if it is successful, try to pull CompreFace images:

docker pull exadel/compreface-admin:1.1.0

docker pull exadel/compreface-fe:1.1.0

docker pull exadel/compreface-core:1.1.0

docker pull exadel/compreface-api:1.1.0

docker pull exadel/compreface-postgres-db:1.1.0

Regarding Coral, you can start with this pull request:

https://github.com/exadel-inc/CompreFace/pull/580/files

There are two files: tpu.Dockerfile and tpu.Dockerfile.full can help you build CompreFace with Coral support. I didn't test it, but if you succeed, you can merge the master branch to this one and try how it will work with new changes. After this, we will be able to merge it into the master.

Well it's running in Home Assistant OS which has its own supervisor to control each plugin as it's own docker container. But I might be able to get the portainer addon working enough to test.

As far as the coral, I'm not too much or a programmer but do have over 25 years of professional IT work. The Coral TPU is currently attached to a separate install of Ubuntu Server with Docker Compose running Frigate. I guess I could try pulling an image from it but I'd much rather either leave it running as a Home Assistant Addon so it doesn't affect frigate's resources. Or even better, finding a way to get CompreFace to run on a 4gig Jetson Nano

LordNex commented 2 years ago

Ohh plus, the version I'm using is the one packaged with Double Take and is using the single container build. So pulling down the individual containers on the machine is question wouldn't work.

Again I could move the install. But with Frigate tying up the Coral TPU, the only thing I have besides putting some form of video card in a Dell PowerEdge R620(very hard due to slot space), is use the Jetson Nano. Any suggestions?

pospielov commented 2 years ago

Jetson Nano is run on ARM CPU, and compiling CompreFace for ARM is a big challenge. And then running it with Jetson Nano GPU support will be an even bigger challenge. I think adding Google Coral support is easier as soon as it is used on x86 machine.

Regarding manually pulling images, you can pull single image: docker pull exadel/compreface:1.1.0 or if you use mobilenet docker pull exadel/compreface:1.1.0-mobilenet

What is the end goal of running CompreFace on GPU or TPU? I mean, I understand that it will improve the recognition speed. What recognition rate do you have now, and what do you want to achieve?

LordNex commented 2 years ago

I somewhat resolved the issues I was having. See https://github.com/home-assistant/core/issues/81433 for more info.

Im still toying with what would be better, going all in with Frigate and CompreFace on the 4gig Nano using the Coral USB TPU for object detection. And then the GPU for transcoding and facial recognition. Or stay utilizing the Dell PowerEdge R620 40 core and throw the Nano in with it.

I have a spare Nano, it just happens to be in a case that makes it a PITA to get the SD Card out. I also have a new RPi4B+ 8gig that's free.

From there I'll have to start with the Jetson Nano SDK image from Nvidia and see if I can figure out the process. I don't consider my self anywhere near a programmer but I have decades of IT exp. So I'm trying to really figure out how to write a python program and get it to run. But ever dam tutorial wants to teach you about loops and functions. I get all that.

But where do I put what?

How do I name things so that I can call them later?

How does the programming structure work in a file system structure?

If I build all the files and put them in the right folders what should I do then to properly compile and bug test the app?

Again, it's probably more me than anything else. But thanks for any help guys!

LordNex commented 2 years ago

Jetson Nano is run on ARM CPU, and compiling CompreFace for ARM is a big challenge. And then running it with Jetson Nano GPU support will be an even bigger challenge.

I think adding Google Coral support is easier as soon as it is used on x86 machine.

Regarding manually pulling images, you can pull single image:

docker pull exadel/compreface:1.1.0

or if you use mobilenet

docker pull exadel/compreface:1.1.0-mobilenet

What is the end goal of running CompreFace on GPU or TPU?

I mean, I understand that it will improve the recognition speed.

What recognition rate do you have now, and what do you want to achieve?

My over all goal is to have all of my cameras tied to an NVR like Frigate, then be able to detect people and faces and send them for recognition. I would also like to use a program like PhotoPrism to be and to scan my person database of files and attach metadata of faces recognized. This it already does but there is not integration between it and Frigate or DoubleTake/CompreFace. And ultimately be able to input a url or other list of images such as the sex offenders list or the Department of Justice and other public photo databases to be able to pull and recognize who is in the image and any pertinent data regarding them. That way you true know who is at the door, regardless of attire or other outfits, before you open it

Now I have the hardware to accomplish this, it's more of a matter of programming experience that I lack. I've been hacking things together since 1988 and don't plan on stopping anytime soon.

And don't open my bedroom door or a bunch of plastic ninja swords WILL attack :-)