1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.89k stars 1.33k forks source link

Does Face Alignment face detection (sfd and blazeface) require connection to internet? #234

Closed rakadambi closed 3 years ago

rakadambi commented 3 years ago

This is something I found out by accident.

My internet went down and the code was running. It failed at face detection for both SFD and Blazeface stating that the soket connection failed.

Do we need Intenet connection to run FA?

rakadambi commented 3 years ago

Pasting the error here. I see this when network goes down.

raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /hollance/BlazeFace-PyTorch/master/anchors.npy (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fca33019850>: Failed to establish a new connection: [Errno -2] Name or service not known'))

1adrianb commented 3 years ago

You shouldn't need internet once the models are downloaded. I see however that for blaze face indeed there is one file that is not stored locally. I will push a fix for this.

rakadambi commented 3 years ago

Hi @1adrianb . It is the same error for SFD as well. At first I thought it was only for blazeface. But it is the same error for SFD

1adrianb commented 3 years ago

I've just made a commit that should address the blaze face issue. I tried running the code without an internet connection, however I am unable to reproduce the error. The model downloading and caching is now in all cases handled by the torch.hub module which is the same used for example by the torchvision pretrained models.

rakadambi commented 3 years ago

Thank you! Thank you! This is amazing!