Closed shampooooo closed 2 years ago
dlib.shape_predictor()
expects a str
, and got a PosixPath
instead. See:
I believe this line could could be the culprit: https://github.com/yuval-alaluf/stylegan3-editing/blob/e2a63fc7f072c4f8b8a7ba1dac8c7f87a8eb1647/prepare_data/preparing_faces_parallel.py#L42
Thanks @woctezuma for the correction! I guess we missed this in our tests before the release. This has been fixed using your suggestion.
'pretrained_models/shape_predictor_68_face_landmarks.dat' file exists in the path. What's the problem?
!python prepare_data/preparing_faces_parallel.py \ --root_path /content/drive/MyDrive/Dataset/landscape \ --mode align
1 Running on 201 paths Here we goooo multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/pool.py", line 121, in worker result = (True, func(*args, *kwds)) File "/usr/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "prepare_data/preparing_faces_parallel.py", line 42, in extract_on_paths predictor = dlib.shape_predictor(SHAPE_PREDICTOR_PATH) TypeError: init(): incompatible constructor arguments. The following argument types are supported:
Invoked with: PosixPath('pretrained_models/shape_predictor_68_face_landmarks.dat') """
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "prepare_data/preparing_faces_parallel.py", line 91, in
run()
File "/usr/local/lib/python3.7/dist-packages/pyrallis/argparsing.py", line 158, in wrapper_inner
response = fn(cfg, *args, **kwargs)
File "prepare_data/preparing_faces_parallel.py", line 85, in run
pool.map(partial(extract_on_paths, args=args), file_chunks)
File "/usr/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
TypeError: init(): incompatible constructor arguments. The following argument types are supported:
Invoked with: PosixPath('pretrained_models/shape_predictor_68_face_landmarks.dat')