Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when run:fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, enable_cuda=True, flip_input=False) #65

Closed
Edwardmark opened this issue Apr 24, 2018 · 10 comments

Comments

@Edwardmark
Copy link

Downloading the face detection CNN. Please wait...
Traceback (most recent call last):
File "/opt/conda/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/opt/conda/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/opt/conda/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/opt/conda/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/opt/conda/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/opt/conda/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/opt/conda/lib/python3.5/http/client.py", line 1260, in connect
server_hostname=server_hostname)
File "/opt/conda/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/opt/conda/lib/python3.5/ssl.py", line 752, in init
self.do_handshake()
File "/opt/conda/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/opt/conda/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/workspace/face-alignment/face_alignment/api.py", line 81, in init
os.path.join(path_to_detector))
File "/opt/conda/lib/python3.5/urllib/request.py", line 188, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/opt/conda/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/opt/conda/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/opt/conda/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/opt/conda/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/opt/conda/lib/python3.5/urllib/request.py", line 1297, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/opt/conda/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:645)>

@Edwardmark
Copy link
Author

I use docker image to run the code.

@Edwardmark
Copy link
Author

@1adrianb Thank you! I have solved this issue by manually downloading the face_detector and face_alignment model. Your passion and politeness impress me, thank you very much!
Best,
Edward

@1adrianb
Copy link
Owner

@Edwardmark I am glad it works! I am really sorry for the issue you experienced.

@Edwardmark
Copy link
Author

@1adrianb Another question, do you have any ideas about how to actually align the faces based on the landmark locations? Maybe use some affine functions? Any advise?

@1adrianb
Copy link
Owner

@Edwardmark as a simple approach, you can try to use Procrustes (https://www.mathworks.com/help/stats/procrustes.html) but depending on how accurate you need to be or how difficult your poses are you may need something better.

@Urviagrawal
Copy link

Hey @Edwardmark Did you find any method for actually aligning faces. I need to align face in 3D co-ordinates(frontal alignment).
Thank you in advance

@Sam7791
Copy link

Sam7791 commented Jul 12, 2019

hello,
I experience the same issue because my network administrator don't allow the connection.
Where I can download the face_detector and face_alignment model?
how I will modify the code to allow offline call of
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)
Thanks in advance.
Samir

@1adrianb
Copy link
Owner

'2DFAN-4': 'https://www.adrianbulat.com/downloads/python-fan/2DFAN4-11f355bf06.pth.tar',
'3DFAN-4': 'https://www.adrianbulat.com/downloads/python-fan/3DFAN4-7835d9f11d.pth.tar',
'depth': 'https://www.adrianbulat.com/downloads/python-fan/depth-2a464da4ea.pth.tar',

@Sam7791
Copy link

Sam7791 commented Jul 18, 2019

Great thanks!

@skixmr
Copy link

skixmr commented Oct 22, 2023

'2DFAN-4': 'https://www.adrianbulat.com/downloads/python-fan/2DFAN4-11f355bf06.pth.tar',
'3DFAN-4': 'https://www.adrianbulat.com/downloads/python-fan/3DFAN4-7835d9f11d.pth.tar',
'depth': 'https://www.adrianbulat.com/downloads/python-fan/depth-2a464da4ea.pth.tar',

Where do you paste those files to after downloading them, I am having problems doing so, any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants